data segment
data ends
stack segment stacktop label worddw 100 dup (?)
stack ends
code segmentassume cs:code,ds:data,ss:stack
main proc farmov ax,datamov ds,axmov ax,stackmov ss,axlea sp,top;0000 0001 1100 1010 | 0000 0010 0001 1111;逻辑左移三位后:0 0001 1100 1010 000 | 0 0010 0001 1111000;dx=0E50 ax=10F8mov dx,458 ;0000 0001 1100 1010mov ax,543 ;0000 0010 0001 1111mov cx,3
L1:shl ax,1 ;ax逻辑左移1位rcl dx,1 ;dx带进位循环左移1位loop L1mov ah,4chint 21h
main endp
code endsend main