Wednesday, 28 May 2014

Microprocessor lab external-1

       I have already explained in my previous blog post about how my microprocessor lab external was but now I would like to just write the program I had got in the exam so that I can recall easily later whenever necessary.
     The question I had got was : Write an alp to perform block interchange of data.
The solution goes like this :
Data segment 
X db 01h,02h,03h,04h,05h
Y db 11h,12h,13h,14h,15h
Data ends
Code segment
Assume cs:code,ds:data
Start:mov ax,data
         Mov ds,ax
         Mov cx,05h
         Lea si,x
         Lea di,y
Up:mov bl,[si]
      Mov al,[di]
      Mov [si],al
      Mov [di],bl
      Inc cx
      Inc dx
      Dec cx
      Jnz up
      Mov ah,4ch
      Int 21h
Code ends
End start

No comments:

Post a Comment