Tuesday, 17 September 2013

Program to sort numbers in ascending order

        ORG 000H
        SJMP START
START : MOV R1,#05H  /* R1 declared as a pass counter*/
AGAIN : MOV A,R1
        MOV R2,A
        MOV R0,#30H
        MOV A,@R0
   UP : INC R0
        MOV B,@R0
        CLR C
        SUBB A,B
        JC SKIP
        MOV B,@R0
        DEC R0
        MOV A,@R0
        MOV @R0,B
        INC R0
        MOV @R0,A
 SKIP : DJNZ R2,UP
        DJNZ R1,AGAIN
 STOP : SJMP STOP

1 comment:

  1. How to register on your phone - Dr. Madden
    How to register on your phone · Open the browser on your mobile device · Open the Google Play store on the 서귀포 출장샵 Google Play Store 충청북도 출장안마 · 창원 출장마사지 Tap on the green 서귀포 출장샵 icon at the top 전라북도 출장마사지 left of the screen · Select

    ReplyDelete