1, Experimental purpose
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

Question answer:
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

Question answer:
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
Commissioning screenshot:
Question answer:
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

Question answer:
xxx segment db N dup(0) xxx ends
After modification, program 123 cannot be executed correctly, and program 4 can still be executed correctly, because deleting start does not indicate the entry of the program. By default, the execution starts from the first line of the program, only Task1_ The beginning of 4 can be executed.
2. Experimental task 2
Assembly source code:assume cs:code code segment mov ax,0b800h mov ds,ax mov ax,0403h mov bx,0f00h mov cx,160 s: mov [bx],ax inc bx inc bx loop s mov ax,4c00h int 21h code ends end

3. Experimental task 3
Assembly source code: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 ax,data1 mov ds,ax mov bx,0 mov cx,0ah s:mov ax,ds:[bx] add ax,ds:[bx+10h] mov ds:[bx+20h],ax inc bx loop s mov ah,4ch int 21h code ends end start

Before adding:

After addition:
4. Experimental task 4
Assembly source code: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 bx, 0 mov ax, data1 mov ds, ax mov cx, 8 s1: push [bx] add bx, 2 loop s1 mov bx, 0 mov cx, 8 s2: pop [bx] add bx, 2 loop s2 mov ah, 4ch int 21h code ends end start
Commissioning screenshot:
Screenshot after program running:
5. Experimental task 5
task5 source code:assume cs:code, ds:data data segment db 'Nuist' db 5 dup(2) 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
Operation results:
Commissioning screenshot:
Screenshot after modification:
The function of numerical value is to determine the color of characters
6. Experimental task 6
Source code:
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 mov al,[bx+1] or al,20h; mov [bx+1],al mov al,[bx+2] or al,20h; mov [bx+2],al mov al,[bx+3] or al,20h; mov [bx+3],al add bx,16 loop s mov ah, 4ch int 21h code ends end start
Commissioning screenshot:
View memory space:
7. Experimental task 7
Source code:
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 bx, 0 mov bp, 0 mov cx, 5 years: mov ax, [bx] mov es:[bp], ax mov ax, [bx+2] mov es:[bp+2], ax add bx, 4 add bp, 10h loop years mov bp, 5 mov cx, 5 income: mov ax, [bx] mov es:[bp], ax add bx, 2 add bp, 10h loop income mov cx, 5 mov bp, 10 people: mov ax, [bx] mov es:[bp], ax add bx, 2 add bp, 10h loop people mov cx, 5 mov bp, 5 average: mov ax, es:[bp] mov bl, es:[bp+5] div bl mov es:[bp+8], al add bp,10h loop average mov ah, 4ch int 21h code ends end start

After structured data storage:
3, Experimental summary
Through this experiment, I have a further understanding of the structure of assembly source program, can clarify the meaning of different logic segments, strengthen the application of addressing mode, and practice the usage of assembly instructions loop and div.