Friday, 27 September 2013

Assume that characters are available and stored at memory location as a,b,p,c,z,d,s,e store them at same location without using any buffer as a,z,b,p,c

org 00h
mov r2,#05h         ;give 5 values
up1:mov r3,#04h
mov r0,#30h
up:mov a,@r0
inc r0
subb a,@r0
jnc xchange
sjmp down
xchange:mov a,@r0
dec r0
xch a,@r0
inc r0
mov @r0,a
down: djnz r3,up
 djnz r2,up1
 mov r0,#30h
mov r1,#34h
mov r3,#02h
l2:inc r0
mov a,@r0
xch a,@r1
mov @r0,a
djnz r3,l2
end

No comments:

Post a Comment