today is my first day to study assembly language and my lecturer give me assignment to do. I need help.

**************************
ax=16 bit , ah=8 bit , al=8bit

mov ax, 12
mov bx, 13
add ax,bx

bx=? , ax=? , ah=? , al=?
**************************
I know bx= 13 and ax= 25 but how to know ah and al answer? Is there any formula or calculation to do it?
Posted on 2004-12-06 05:44:40 by subaru1603
Both al and ah makes up ax. You just need to figure out which is the lower 8bit and which is the higher 8bit.
Posted on 2004-12-06 05:54:51 by roticv
how to figure ah and al is higher or lower? can u show me?
Posted on 2004-12-06 05:58:07 by subaru1603
Hi...

here is a listing...



.data
TextAppName db "Addition",0
Template db "bx=%d ax=%d ah=%d al=%d",0
Buffer db 100 dup(0)

.code
xor eax,eax
xor ebx,ebx
xor ecx,ecx
xor edx,edx
mov ax,12
mov bx,13
add ax,bx
mov ecx,eax
shr ecx,8
and ecx,00FFh
mov edx,eax
and edx,00FFh
invoke wsprintf,ADDR cBuffer,ADDR Template,ebx,eax,ecx,edx
invoke MessageBox,NULL,addr cBuffer,addr TextAppName,MB_OK or MB_ICONEXCLAMATION



I think you will enjoy...

You are a fresher...

Gerard..
-------------
Posted on 2004-12-06 06:19:45 by gerard