Computing.Net > Forums > Programming > 8051 assembly

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

8051 assembly

Reply to Message Icon

Name: Riaz
Date: March 21, 2005 at 21:43:07 Pacific
OS: 8051 microcontroller
CPU/Ram: 8051 microcontroller
Comment:

I want to implement " if greater than number then goto " in 8051 assembly.
can any one help me.
Riaz



Sponsored Link
Ads by Google

Response Number 1
Name: yuv
Date: March 22, 2005 at 00:45:34 Pacific
Reply:

r u finding something like this...

http://www.mcselec.com/an_22.htm


----
yuv


0

Response Number 2
Name: elric
Date: March 24, 2005 at 05:09:26 Pacific
Reply:

G'day,
This may not be the best forum for 8051 assembler help. Try a site such as 8052.com; they are using it all the time.
However, to answer your question: you would need to use a conditional jump instruction, the format of which depends on where the compared bytes are.
For instance, the CJNE mnenomic has 4 forms depending on where the bytes are placed. It compares the two bytes and jumps to a new address relative to the programme counter.
It then clears the carry flag if one is greater than the other.
Your routine would then have to test this bit and then implement an absolute jump.
Hope that helps.
Elric


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Program that can find a p... Web / Java : Servlet - d...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: 8051 assembly

How to start with 8051 assembly? www.computing.net/answers/programming/how-to-start-with-8051-assembly/3403.html

Visual Basic MScomm / 8051 assemble www.computing.net/answers/programming/visual-basic-mscomm-8051-assemble/8782.html

Software to convert code in hex fmt www.computing.net/answers/programming/software-to-convert-code-in-hex-fmt/11913.html