On 12/7/2005 at 9:03 PM Patrick Finnegan wrote:
Chuck Guzis declared on Wednesday 07 December 2005
20:26:
keeping things like the DAA instruction intact
and supporting a bunch
of do-nothing instructions like MOV DL,DL.
FYI, that most certainly doesn't just "do nothing." It updates the flags
based on the contents of the DL register, and you could do a conditional
jump based on the results.
With all due respect, I suggest that you review your X86 instructions and
their effect on flags. Try running this little bit of code under your
favorite debugger (DEBUG is fine) and have a gander at the flags register:
xor ax,ax
mov dl,-1
mov dl,dl
int 3
Now, if your point of view held, the condition code should show a nonzero
negative (signed) value. In fact, they show a zero positive value (i.e.
the results of the XOR AX,AX). In fact, moves, be they register to memory,
register to register or memory to register or memory to memory do not
affect condition code bits. Else why have a nutty instruction like JCXZ?
You coiuld just MOV CX,CX and jumpt on the zero result...
Consider on
Windows XP that you can still run the following code:
mov cl,9
mov dx,offset HWMes
call 5
mov cl,0
call 5
Huh? Do you mean this?
MOV AH, 9
MOV DX, HWMes
INT 21h
MOV AH, 0
INT 21h
Nope, I mean what I said--try it. This little tidbit goes all the way back
to the time before DOS 1.0, when some level of compatibility with CP/M
applications was implemented. Notice that I didn't say "CP/M-86", which
uses int 224 to make system calls (which will not work under MS-DOS or
Windows of any flavor). I suspect this is an artifact of old SC-DOS/QDOS.
Cheers,
Chuck