............ data ............
reslt1 db 0AEh ; MASM needs '0' prefix for hex values
reslt2 db 0A3h ; starting with [A..F].
reslt3 db 0C5h
reslt4 db 23 ; Note: MASM's default integers are decimal (base 10)
reslt5 db 162
reslt6 db 11001001b ; Binary numbers can be entered with 'b' suffix
reslt7 db 01010101b
reslt8 db 'E' ; ASCII values can be entered with quotes.
reslt9 db -74
x1 dw 7 ; Define six 16-bit variables in memory
x2 dw 10E7h
x3 dw 239Ch
x4 dw 0EC29h
x5 dw 8A92h
x6 dw 0BED1h
............ code ............
mov ax, cseg
mov ds, ax ; Initialize DS
sal reslt1, 1
rcr reslt2, 1
mov ax, x1
sub reslt3, al
shr al, 1
mov cx, ax
mov di, offset reslt4
sar byte ptr [di], cl
shr cl, 1
adc [di+1], cl
mov ah, reslt6
mov al, reslt7
xor reslt7, ah
and reslt6, al
mov ch, 0A0h
add ch, 70h
sbb reslt8, 4
not reslt9
test x1, 0FFF1h
jnz JumpThis
and x2, 2468h
JumpThis:
or x3, 5055h
add x4, 30
adc x5, 7777h
adc x6, 8765
|