assume ds:data, cs:code, ss:stack data segment db 16 dup(0) data ends stack segment db 16 dup(0) stack ends code segment start: mov ax, data mov ds, ax mov ax, stack mov ss, ax mov sp, 16 mov ah, 4ch int 21h code ends end start
task1_1调试到line17结束、line19之前截图。
① 在debug中将执行到line17结束、line19之前,记录此时:寄存器(DS) = 076A, 寄存器(SS)= 076B, 寄存器(CS) = 076C
② 假设程序加载后,code段的段地址是X,则,data段的段地址是_X-0002H_, stack的段地址是_X-0001H_。
assume ds:data, cs:code, ss:stack data segment db 4 dup(0) data ends stack segment db 8 dup(0) stack ends code segment start: mov ax, data mov ds, ax mov ax, stack mov ss, ax mov sp, 8 mov ah, 4ch int 21h code ends end start
task1_2调试到line17结束、line19之前观察寄存器DS, CS, SS值的截图
① 在debug中将执行到line17结束、line19之前,记录此时:寄存器(DS) = 076A, 寄存器(SS)= 076B, 寄存器(CS) = 076C
② 假设程序加载后,code段的段地址是X,则,data段的段地址是__X-0002H__, stack的段地址是_X-0001H___。
assume ds:data, cs:code, ss:stack data segment db 20 dup(0) data ends stack segment db 20 dup(0) stack ends code segment start: mov ax, data mov ds, ax mov ax, stack mov ss, ax mov sp, 20 mov ah, 4ch int 21h code ends end start
task1_3调试到line17结束、line19之前观察寄存器DS, CS, SS值的截图
① 在debug中将执行到line17结束、line19之前,记录此时:寄存器(DS) = 076A, 寄存器(SS)= 076C, 寄存器(CS) = 076E
② 假设程序加载后,code段的段地址是X,则,data段的段地址是__X-0004H__, stack的段地址是__X-0002H__。
assume ds:data, cs:code, ss:stack code segment start: mov ax, data mov ds, ax mov ax, stack mov ss, ax mov sp, 20 mov ah, 4ch int 21h code ends data segment db 20 dup(0) data ends stack segment db 20 dup(0) stack ends end start
task1_4调试到line17结束、line19之前观察寄存器DS, CS, SS值的截图
① 在debug中将执行到line9结束、line11之前,记录此时:寄存器(DS) = 076C, 寄存器(SS) =076E, 寄存器(CS) = 076A
② 假设程序加载后,code段的段地址是X,则data段的段地址是__X+0002H__, stack的段地址是_X+0004H___。
基于上述四个实验任务的实践、观察,总结并回答:
xxx segment db N dup(0) xxx ends
assume cs:code code segment start: mov ax,0b800h mov ds,ax mov bx,0f00h mov cx,80 s: mov [bx],0403h add bx,2 loop s mov ah, 4ch int 21h code ends end start
assume cs:code 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 cx,10 mov bx,0 mov dx,0 s: mov dx,0 mov ax,data1 mov ds,ax add dl,[bx] mov ax,data2 mov ds,ax add dl,[bx] mov ax,data3 mov ds,ax mov [bx],dl inc bx loop s mov ax,4c00h int 21h code ends end start
assume cs:code data1 segment dw 2, 0, 4, 9, 2, 0, 1, 9 data1 ends data2 segment dw 8 dup(?) data2 ends code segment start: mov ax,data1 mov ds,ax 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
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
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 bx,0 mov cx,4 s: mov al,[bx] or al,20h mov [bx],al add bx,16 loop s mov ah, 4ch int 21h code ends end start
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 ax,table mov es,ax mov si,0 mov di,0 mov bx,0 mov cx,5 mov sp,0 s: mov ax,[si] mov es:[di],ax mov ax,[si+2] mov es:[di+2],ax mov ax,[bx+20] mov es:[di+5],ax mov dx,0 mov es:[di+7],dx push cx mov cx,[20+10+bx] mov es:[di+10],cx div cx pop cx mov es:[di+0dh],ax add si,4 add di,16 add bx,2 loop s mov ah, 4ch int 21h code ends end start