You are here:

Assembly Language/in which format register stores data

Advertisement


Question
it seems to be a very basic question but i couldn't find an answer anywhere i.e after reading a character((MOV AH,1;INT 21h)) now in which format our input is actually stored in AL, is it in HEX or Binary also while displaying back(MOV AH,02;MOV DL,AL;INT 21h) now what will happen does the assembly prints the register's value as it is or it converts again its format.
I used debug to check it, it displays the input in HEX format but my confusion is, if the data is stored in HEX format then all the bit manipulations we do using shl,and,or etc is it just a logical operation. thanx

Answer
You didn't specify what platform you are on, but I presume it is Intel. Strictly speaking, it's not my forté, but I can answer in general terms. ALL data are stored in binary, which facilitates the use of logical and bit instructions AND, NOR, SHL, etc.

Hex[adecimal], in the sense that you are using it, is simply a convenient means of reading, writing, and printing data which are represented in binary. It's easier to write FF than 11111111. For a fairly comprehensive explanation see http://en.wikipedia.org/wiki/Hexadecimal#Mapping_to_binary

HTH

Assembly Language

All Answers


Ask Experts

Volunteer


Kimberly Batteau

Expertise

My expertise is strictly limited to IBM Enterprise ("370") assembler. I have no expertise in assembly language for other hardware platforms. Within the IBM Enterprise platform, I can answer nearly any question.

Experience


Past/Present clients
Hamilton-Beach/Proctor-Silex
James River Corporation
University of Virginia
Philip Morris USA
Virginia Commonwealth University

©2012 About.com, a part of The New York Times Company. All rights reserved.