The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: Warlock on December 12, 2009, 09:17:43 AM

Title: Can Someone help me on this...
Post by: Warlock on December 12, 2009, 09:17:43 AM
Look at this

Quote
mov ax,09
mov ax,9
mov ax,09h

is there any different?

If yes, what is the different...I am new to assembly...
Title: Re: Can Someone help me on this...
Post by: Vortex on December 12, 2009, 09:20:54 AM
The third line takes a hexadecimal value : 09h
Title: Re: Can Someone help me on this...
Post by: jj2007 on December 12, 2009, 09:22:55 AM
Quote from: Vortex on December 12, 2009, 09:20:54 AM
The third line takes a hexadecimal value : 09h
Which happens to be identical to the decimal value 9 :wink
Title: Re: Can Someone help me on this...
Post by: Warlock on December 12, 2009, 10:10:54 AM
So this mean that the

mov ax,09   
mov ax,9

is both the same.

mov ax,09h is different.(Decimal value 9)

Right ???  :wink
Title: Re: Can Someone help me on this...
Post by: MichaelW on December 12, 2009, 10:24:46 AM
For all three forms the assembled instructions are the same:

0B67:0100 B80900        MOV     AX,0009
0B67:0103 B80900        MOV     AX,0009
0B67:0106 B80900        MOV     AX,0009

The only differences I can see would be in the steps that the assembler goes through to convert the constant operand into a value.
Title: Re: Can Someone help me on this...
Post by: Warlock on December 12, 2009, 11:36:51 AM
Thanks you...You help me a lot...