EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Bubble Sort in Assembly 8051

Bubble Sort in Assembly 8051

|

Microcontroller › 8051 › Bubble Sort in Assembly 8051

  • This topic has 0 replies, 1 voice, and was last updated 9 years, 11 months ago by BRUNO.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • November 23, 2015 at 11:04 pm #4122
    BRUNO
    Participant

     

    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

RSS Recent Posts

  • Manually actuate fuel tank selector solenoid November 8, 2025
  • JLCPBC are using a different shipping company = less $$$$$$$$ November 8, 2025
  • Help please! BLDC driver circuit using the IR2136s and the STP80NF06 MOSFETS November 8, 2025
  • need two ICs November 8, 2025
  • MLT-8530 Buzzer on ESP32: Why Is the Sound Output Lower Than Expected? November 8, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise