|
-
September 17th, 2002, 09:18 PM
#1
OFF TOPIC! General Registers
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:
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
-
September 17th, 2002, 09:21 PM
#2
You definitely can. But what is that "R" instruction ? try something like "ADD AL, BL", that should work correctly.
-
September 18th, 2002, 01:19 AM
#3
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.
Succinct is verbose for terse
-
September 18th, 2002, 06:23 AM
#4
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
-
September 18th, 2002, 06:31 AM
#5
Sorry I figured it out. You cannot directly access the H and L other then actually specifying the values in AX. So:
Code:
- 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
-
September 18th, 2002, 06:34 AM
#6
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
Succinct is verbose for terse
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|