实验任务1
任务1-1
运行截图:
①076A 076B 076C
②X-2 X-1
任务1-2
运行截图:
①076A 076B 076C
②X-2 X-1
任务1-3
运行截图:
①076A 076C 076E
②x-4 x-2
任务1-4
运行截图:
①076C 076E 076A
②X+2 X+4
任务1-5
①(N/16+1)*16 字节
②task1_4.asm是可以正常执行的
结论:因为在task1_4.asm中,代码段本身位置就处于程序入口处,所以在没有start时,仍然可以正常运行。
实验任务2
运行截图:
源代码:
assume cs:code code segment mov ax,0b800h mov ds,ax mov bx,0f00h mov cx,80 s:mov ds:[bx],0403h add bx,2 loop s mov ah,4ch int 21h code ends end
实验任务3
运行截图:
源代码:
assume cs:code,ds:data1,ds:data2,ds:data3 data1 segment db 50, 48, 50, 50, 0, 48, 49, 0, 48, 49 ; ten numbers data1 ends data2 segment db 0, 0, 0, 0, 47, 0, 0, 47, 0, 0 ; ten numbers data2 ends data3 segment db 16 dup(0) data3 ends code segment start: mov ax,data1 mov ds,ax mov dx,data3 mov ss,dx mov cx,10 mov bx,0 s1:mov al,ds:[bx] mov ss:[bx],al inc bx loop s1 mov ax,data2 mov ds,ax mov cx,10 mov bx,0 s2:mov al,ds:[bx] mov dl,ss:[bx] add al,dl mov ss:[bx],al inc bx loop s2 mov ah,4ch int 21h code ends end start
data1
data2
data3
相加后
实验任务4
运行截图:
内存处结果显示
源代码:
assume cs:code,ds:data1,ss:data2 data1 segment dw 2, 0, 4, 9, 2, 0, 1, 9 data1 ends data2 segment dw 8 dup(?) data2 ends code segment start: mov dx,data1 mov ds,dx; mov ax,data2 mov ss,ax mov sp,10h mov bx,0 mov cx,8 s:push ds:[bx] add bx,2 loop s mov ah, 4ch int 21h code ends end start
实验任务5
源代码:
assume cs:code, ds:data data segment db 'Nuist' db 2, 3, 4, 5, 6 data ends code segment start: mov ax, data mov ds, ax mov ax, 0b800H mov es, ax mov cx, 5 mov si, 0 mov di, 0f00h s: mov al, [si] and al, 0dfh mov es:[di], al mov al, [5+si] mov es:[di+1], al inc si add di, 2 loop s mov ah, 4ch int 21h code ends end start
运行截图:
源代码中line19将数据段字母部分凡是小写字母,变为大写字母
作用:控制数据显示时的颜色
实验任务6
源代码:
assume cs:code, ds:data data segment db 'Pink Floyd ' db 'JOAN Baez ' db 'NEIL Young ' db 'Joan Lennon ' data ends code segment start: mov ax,data mov ds,ax mov cx,4 mov bx,0 s: mov al,[bx] or al,20H mov [bx],al add bx,16 loop s mov ah, 4ch int 21h code ends end start
运行截图:
实验任务7
源代码:
assume cs:code, ds:data, es:table data segment db '1975', '1976', '1977', '1978', '1979' dw 16, 22, 382, 1356, 2390 dw 3, 7, 9, 13, 28 data ends table segment db 5 dup( 16 dup(' ') ) ; table ends code segment start: mov ax,data mov ds,ax mov dx,table mov es,dx mov cx,5 mov si,0 mov di,0 s1: mov ax,cx mov cx,3 mov bx,0 s2: mov dx,[di+bx] mov es:[si+bx],dx inc bx loop s2 add si,16 add di,4 mov cx,ax loop s1 mov cx,5 mov si,5 mov bp,20 mov di,0 s3: mov ax,word ptr ds:[bp+di] mov es:[si],ax mov es:[si+2],word ptr 0 add si,16 add di,2 loop s3 mov cx,5 mov si,10 mov bp,30 mov di,0 s4: mov ax,word ptr ds:[bp+di] mov es:[si],ax add si,16 add di,2 loop s4 mov cx,5 mov si,5 s5: mov dx,0 mov ax,word ptr es:[si] mov bx,word ptr es:[si+5] div bx mov es:[si+8],ax add si,16 loop s5 mov ah, 4ch int 21h code ends end start
运行截图: