← Back to Home

Practical 3

To implement block transfer and exchange using SI, DI registers.

Theory

  1. What is the purpose of SI and DI registers in 8086 assembly language?
  2. Explain the block transfer operation using REP MOVSB instruction.
  3. How does the CLD instruction affect string operations in 8086?
  4. Why is it necessary to initialize both DS and ES segment registers for block transfer?

Code

Create a file named exp3.asm in Notepad and save it in D:\TASM:

.model small                                   
.stack 100h

.data
src db 10h,20h,30h,40h,50h,60h,70h,80h,90h,0A0h
dest db 10 dup(?)

.code
main proc
    mov ax, @data                              
    mov ds, ax
  
    lea si, src
    lea di, dest
    mov cx, 10
    cld                                 
    rep movsb

    mov ah, 4ch 
    int 21h    
main endp
end main
    

Compilation and Execution using TASM

Inside DOSBox, compile and run:

    tasm filename.asm
    tlink filename.obj
    

Using Debug Tool

Run Debug:

td filename.exe