Article From:https://www.cnblogs.com/zakon/p/9967243.html

1:

1. By using loop, [bx], a complete assembler program is compiled to fill the word data 0403H in 16 consecutive word units starting from memory b800:07b8.

 

The code is as follows:

assume cs:code
code segment
    mov ax,0b800h
    mov ds,ax
    mov cx,16
    mov bx,07b8H
    mov ax,0403h

s:  mov [bx],al
    inc bx
    mov [bx],ah
    inc bx
    loop s
        mov ax,4c00h
    int 21h
code ends
end

The results are as follows:

2. By using loop, [bx], a complete assembly source program is compiled to transmit data 0-63 (3FH) to memory 0:200-0:23F in turn.

 The code is as follows:

assume cs:code
code segment
        mov ax,20h
        mov ds,ax
        mov bx,0
        mov cx,64
s:  mov [bx],bx
        inc bx
        loop s
        mov ax,4c00h
        int 21h
code ends
end

The results are as follows:

3.The function of the following program is to copy the instructions before “mov ax, 4c00h” to 0:200 memory. The completion procedure. Debugging on the computer and tracking the running results.

assume cs:code
code segment
        mov ax,code
        mov ds,ax
        mov ax,0020h
        mov es,ax
        mov bx,0
        mov cx,16h
s:  mov al,[bx]
        mov es:[bx],al
        inc bx
        loop s
        mov ax,4c00h
        int 21h
code ends
end

The results are as follows:

(tCommand)

(gCommand execution)

 

 

 Two: summing up experience

Through this experiment, I learned about the inter-register addressing mode [bx].

Understanding the nature of loops in programming languages

Leave a Reply

Your email address will not be published. Required fields are marked *