2
 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 ; Load the counter LEA SI,X ; SI pointed to the source location x LEA DI,Y ; DI pointed to the destination location y UP: MOV BL,[SI] ; Move the SI content to BL register MOV AL,[DI] ; Move the DI content to AL register MOV [SI],AL ; Move AL register content to content of SI MOV [DI],BL ; Move BL register content to content of DI INC SI ; Update SI and DI INC DI DEC CX ; Decrement the counter till it becomes zero JNZ UP MOV AH,4CH INT 21H CODE ENDS END START

BL.ASM_1

  • Upload
    bhaskar

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

Page 1: BL.ASM_1

7/21/2019 BL.ASM_1

http://slidepdf.com/reader/full/blasm1 1/1

DATA SEGMENTX DB 01H,02H,03H,04H,05HY DB 11H,12H,13H,14H,15HDATA ENDSCODE SEGMENTASSUME CS:CODE,DS:DATASTART:MOV AX,DATAMOV DS,AXMOV CX,05H ; Load the counterLEA SI,X ; SI pointed to the source location xLEA DI,Y ; DI pointed to the destination location yUP: MOV BL,[SI] ; Move the SI content to BL registerMOV AL,[DI] ; Move the DI content to AL registerMOV [SI],AL ; Move AL register content to content of SIMOV [DI],BL ; Move BL register content to content of DIINC SI ; Update SI and DIINC DIDEC CX ; Decrement the counter till it becomes zeroJNZ UPMOV AH,4CHINT 21HCODE ENDSEND START