Wang Shuang assembles 11.10 (2) serial transfer instructions for programming, copying the last 16 bytes in the F000H segment to the data segment

1. Experimental requirements

Second, the code implementation

assume cs: code, ds: data 

data segment     
    db 16 dup ( 0 ) 
data ends 

code segment 
start:   mov     ax, 0f000h
         mov ds, ax
         mov si, 0ffffh     ; ds: si points to f000: ffff 
        mov ax, data    
         mov es, ax
         mov di, 15         ; es: di points to data: 15 
        mov cx, 16         ; (cx0) = 16, rep loops 16 times 
        
        std               ; set df = 1, reverse 
        rep  movsb 
        
        mov ax, 4c00h
        int 21h
code ends
end start

3. Commissioning

1. View the disassembly code and execute to the specified line with the g instruction

2. View the source data (ds: si = F000: FFF0) View the target data (es: si = 0B38: 0000)

 It can be seen from the above figure that the data copy is successful 

Guess you like

Origin www.cnblogs.com/TonyJia/p/12651303.html