data segment
data ends
stack segment stack
top label word
dw 100 dup (?)
stack ends
code segment
assume cs:code,ds:data,ss:stack
main proc far
mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
lea sp,top
;0000 0001 1100 1010 | 0000 0010 0001 1111
;逻辑左移三位后:0 0001 1100 1010 000 | 0 0010 0001 1111000
;dx=0E50 ax=10F8
mov dx,458 ;0000 0001 1100 1010
mov ax,543 ;0000 0010 0001 1111
mov cx,3
L1:
shl ax,1 ;ax逻辑左移1位
rcl dx,1 ;dx带进位循环左移1位
loop L1
mov ah,4ch
int 21h
main endp
code ends
end main