Bubble Sort in Assembly 8051 | Microcontroller › 8051 › Bubble Sort in Assembly 8051 This topic has 0 replies, 1 voice, and was last updated 8 years, 9 months ago by BRUNO. Viewing 1 post (of 1 total) Author Posts November 23, 2015 at 11:04 pm #4122 BRUNOParticipant Hi ! I need a help to do a bubble sort in assembly 8051, and the number of the elements of vector is located in R0 , and so far I do this code. $MOD51 ORG 0 ORD: MOV A,@R0 MOV R7,A DEC R7 INC R0 MOV B, R0 ROT2: MOV R0,B MOV A, R7 MOV R6,A ROT3: ACALL COMP DJNZ R6,ROT3 DJNZ R7,ROT2 RET COMP: MOV A,@R0 INC R0 CLR C SUBB A,@R0 JC FIM XCH A,@R0 DEC R0 XCH A,R0 INC R0 XCH A,@R0 RET FIM: SJMP FIM END Author Posts Viewing 1 post (of 1 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In