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
..start
mov ax, cs
mov ds, ax ; Initialize DS
sal byte [reslt1], 1
rcr byte [reslt2], 1
mov ax, [x1]
sub byte [reslt3], al
shr al, 1
mov cx, ax
mov di, reslt4
sar byte [di], cl
shr cl, 1
adc [di+1], cl
mov ah, [reslt6]
mov al, [reslt7]
xor byte [reslt7], ah
and byte [reslt6], al
mov ch, 0A0h
add ch, 70h
sbb byte [reslt8], 4
not byte [reslt9]
test word [x1], 0FFF1h
jnz JumpThis
and word [x2], 2468h
JumpThis:
or word [x3], 5055h
add word [x4], 30
adc word [x5], 7777h
adc word [x6], 8765
|