Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/02/03 07:36
Read: times


 
#55914 - RE: SUBB
Responding to: ???'s previous message
Hi,
Basically there is no "sub" instruction in the MCS-51 instruction set,
okay,
so you have to make sure the carry isnt set, to avoid inadvertant accounting of borrow value
No. Assembler is cool tool, you know:
MOV A,#2
ADD A,#-2 
JNC, Label_1 
SJMP Label_2

The idea is that for immediate values you always can replace substract with addition of negative value. As result you may not pay attention on carry flag state before command and delete CLR Ñ as well. This trick gives same result as substract with only one thing you should note: with it, the carry flag is set vice versa.
Good days!


List of 6 messages in thread
TopicAuthorDate
SUBB            01/01/70 00:00      
   RE: SUBB            01/01/70 00:00      
   RE: SUBB            01/01/70 00:00      
   Read all about it!            01/01/70 00:00      
   RE: SUBB            01/01/70 00:00      
      RE: SUBB            01/01/70 00:00      

Back to Subject List