|
-
Sep 6th, 2002, 04:36 PM
#1
Thread Starter
Frenzied Member
Adding hex segments and offsets
Code:
MOV AX, 0 ; AX = 0
MOV AL, 0 ; AL = 0
MOV AH, 0 ; AH = 0
MOV AL, FFh ; AL = FFh
; AX = 00FFh
; AH = 00h
;I understand up to here
INC AX ; AX = AX + 1
; AX = 0100h
; AH = 01h
; AL = 00h
;but not this. I thought that:
; since AL (FFh) + 1 = 100
; and AH (00h) +1 = 01h
; that AH|AL would be 01|100, but it should be 0100h. What am I missing?
retired member. Thanks for everything 
-
Sep 10th, 2002, 09:48 AM
#2
Code:
Since AH and AL form the AX register together you have
; start
mov ax, 0
; AX: 00 00h
; AH AL
mov al, 0
mov ah, 0
; those were both redundant, since they are already 0
mov al, FFh
; AX: 00 FFh
; AH AL
inc ax
; AX: 01 00h
; AH AL
; AL cannot hold more than FFh
It's a little bit confusing, but AX is not an independent register but only the merger of AH and AL.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 27th, 2003, 12:44 PM
#3
Fanatic Member
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Jun 27th, 2003, 01:41 PM
#4
I think it has, but I never heard from the poster again.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|