微机原理 汇编语言 data segmentbuf1 db 1,3,4,5,7,9n1 equ$-buf1buf2 db 2,4,6,8,10,12n2 equ$-buf2buf3 db n1+n2 dup(0)data endscode segmentassume cs:code,ds:datastart:mov ax,datamov ds,axlea si,buf1lea di,buf2lea bx,buf3mov cx,0;ch->;index for buf1cl->;index for buf21:cmp ch,n1jz$8cmp cl,n2jz$9mov al,[si]cmp al,[di]ja$2jb$3mov[bx],alinc bxinc siinc diinc chinc cljmp$12:mov al,[di]mov[bx],alinc clinc bxinc dijmp$13:mov[bx],alinc chinc bxinc sijmp$18:cmp cl,n2jz$10mov al,[di]mov[bx],alinc bxinc diinc cljmp$89:cmp ch,n1jz$10mov al,[si]mov[bx],alinc siinc bxinc chjmp$910:mov ah,4chint 21hcode endsend start
微机原理与汇编语言 先判断开关是否完全闭合,如果闭合,灯全亮;在判断开关的高四位闭合还是低4位闭合,高四位闭合则执行HIGH,低四位执行LOWW。ZERO子程序里面加 JMP STOP是因为不需要执行后面的程序。后面判断低高位的STOP 加在主程序里面就行了,节省代码。
微机原理汇编问题 data segmentvalue db 4dup(0)data endscode segmentassume ds:data,cs:codestart:mov ax,datamov ds,axmov es,axlea di,valuemov cl,4begin:push axand ax,0x0000Fstosbpopshr ax,4loop beginxor bx,bxxor cx,cxlea si valuemov bh,byte ptr[si]mov bl,byte ptr[si+1]mov ch,byte ptr[si+2]mov cl,byte ptr[si+3]mov ax,4c00hint 21hcode ends