............ data ............
rslt1 db 0C5h ; MASM needs '0' prefix for hex values
rslt2 db 0C5h ; starting with [A..F].
rslt3 db 0C5h
rslt4 db 14 ; Note: MASM's default integers are decimal (base 10).
rslt5 db 14
rslt6 db 01111100b ; Binary numbers can be entered with 'b' suffix.
rslt7 db 11011100b
rslt8 db 'C' ; ASCII values can be entered with quotes.
rslt9 db 74
x1 dw 0 ; Define five 16-bit variables in memory
x2 dw 1887h
x3 dw 2FCFh
x4 dw 0AAAAh
x5 dw 1111h
............ code ............
SHR rslt1, 1
SAR rslt2, 1
MOV CH, 0FFh
MOV CL, 3
ADD CH,CL
RCR rslt3, CL
MOV SI, offset rslt4
SUB [SI], CL
SHL CL,1
SUB [SI+1], CL
MOV BL, rslt7
MOV BH, rslt6
OR rslt6, BL
XOR rslt7, BH
MOV AH,90h
ADD AH,80h
SBB rslt8, 1
NEG rslt9
SUB x1,4
AND x2, 3C28h
TEST x3, 5090h
ADD x4,0CCCCh
ADC x5, 5555h
|