1、3-1assume cs:code,ds:data,ss:stackstack segmentdw 512 dup (0)stack endscode segmentdw 512 dup (0)data segmentdata endsstart:mov ax,datamov ds,axmov ax,stackmov ss,axmov ax,codemov bx,0mov ax,ss:bx code endsend start7-1assume cs:code,ds:datadata segmentdb welcome to masm!db data endscode segmentstart
2、: mov ax,datamov ds,axmov cx,8mov si,0s: mov ax,0simov 16si,axadd si,2loop smov ax,4c00hint 21hcode endsend start7-6assume cs:code,ds:datadata segmentdb 1. file db 2. edit db 3. search db 4. view db 5. options db 6. help data endscode segmentstart: mov ax,datamov ds,axmov bx,0mov cx,6s: mov al,bx+4a
3、nd al,11011111bmov bx+4,aladd bx,16loop s mov ax,4c00hint 21hcode endsend start7-8assume cs:code,ds:datadata segmentdb 1. file db 2. edit db 3. search db 4. view db 5. options db 6. help data endscode segmentstart: mov ax,datamov ds,axmov bx,0mov cx,6s0: mov dx,cxmov si,4mov cx,7s1: mov al,bx+siand
4、al,11011111bmov bx+si,alinc siloop s1mov cx,dxadd bx,16loop s0mov ax,4c00hint 21hcode endsend start7-9assume cs:code,ds:datadata segmentdb 1. file db 2. edit db 3. search db 4. view db 5. options db 6. help dw 0data endscode segmentstart: mov ax,datamov ds,axmov bx,0mov cx,6s0: mov ds:40h,cxmov si,4
5、mov cx,7s1: mov al,bx+siand al,11011111bmov bx+si,alinc siloop s1mov cx,ds:40hadd bx,16loop s0mov ax,4c00hint 21hcode endsend start8-1assume cs:code,ds:data, ss:stackdata segmentdb testdata endsstack segmentdw 0,0,0,0,0,0,0,0,0stack endscode segmentstart:mov ax,datamov ds,axmov bx,0mov bp,1hmov si,0mov di,0mov ax,bpmov ss,bpmov ax,4c00hint 21hcode endsend start