Click to See Complete Forum and Search --> : OFF TOPIC! General Registers
MikeB
September 17th, 2002, 09:18 PM
I am reviewing some assembly notes, simply out of curiosity, and I come across something that I am not sure of. In the 8088 processor, you can access the general registers high byte and low byte by denoting with a H or L respectively. In DEBUG, I typed the following:
- R AH
and it gives me an error. Can I not access the high and low byte of the general registers on a P4 processor?
Mike B
Yves M
September 17th, 2002, 09:21 PM
You definitely can. But what is that "R" instruction ? try something like "ADD AL, BL", that should work correctly.
cup
September 18th, 2002, 01:19 AM
r cannot be used to modify the 8-bit registers. The best you can do is look at the AX value and modify the upper 8 bits.
debug.exe is a 32-bit version of a 16-bit program. It is a hangover from the DOS days. The r instruction for modifying registers only seems to work for the 16-bit registers. .
I use it in batch files as a version of Unix's sed. It is absolutely brilliant for that.
MikeB
September 18th, 2002, 06:23 AM
You definitely can. But what is that "R" instruction ? try something like "ADD AL, BL", that should work correctly.
I am looking at it using DEBUG.EXE where R instruction is used to edit a register.
r cannot be used to modify the 8-bit registers. The best you can do is look at the AX value and modify the upper 8 bits.
So what can I use to set the value in the AL and HL?
Nothing?
Mike B
MikeB
September 18th, 2002, 06:31 AM
Sorry I figured it out. You cannot directly access the H and L other then actually specifying the values in AX. So:
- R AX
AX 0000
: 0102
-R IP
IP 0100
: 100
- E 100
0AEA:0100 AA.00 43.C4
The above code will add the high and low bytes of AX
ADD AH, AL
Mike B
cup
September 18th, 2002, 06:34 AM
Like I said earlier, you have to use AX to set it. eg if you wish to set AL to 99 hex
r AX
AX 1234
:1299
Similarly, if you wish to set AH to 50 hex
r AX
AX 1234
:5034
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.