Friday, April 13, 2012

String transfer in reverse direction using 8086

ASSUME  CS:CODE, DS:DATA, ES:data
DATA    SEGMeNT
        ORG 8000H
STRING1 DB  'balaram'
LENGTH_STRING1 EQU $-STRING1
data ends
EXTRA SEGMENT
ORG 9000H
STRING2 DB 50D DUP(0H)
EXTRA ENDS
CODE    SEGMENT
START:  MOV AX, DATA
        MOV DS, AX
        MOV AX, EXTRA
        MOV ES, AX
        lea SI, string1
        lea DI, string2
        MOV CX, LENGTH_STRING1
        add di, LENGTH_STRING1-1
        CLD
go:     MOVSB
        dec di
        dec di
        dec cx
        jnz go
        mov ah, 4ch
        int 21h
CODE    ENDS
        END START

No comments:

Post a Comment

DC motor control with Pulse Width Modulation Part 1

DC Motor intro DC motor is a device which converts electrical energy into kinetic energy. It converts the DC power into movement. The typica...