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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/15/08 01:05
Read: times


 
#157495 - Looking at the code...
Responding to: ???'s previous message
Your code does a cjne to test for equality etc which is effectively a substraction which you do next anyway. Kill two birds with one stone.

; GET DIFFERNCE BETWEEN OLD AND NOW
GETDIFFERENCE: MOV A,R1 ;R1 IS OLD
CJNE A, R0, CheckLess ;SEE IF SAME ERROR IS HERE
JMP MAIN ;OLD & NEW ARE SAME
CheckLess: JC OldLessThanNow ;R0 is less than R1
****** this is doing much the same save the cjne above******
OldGreaterThanNow: MOV A,R1
SUBB A, R0
******* put test in here ***************
MOV R5,A ;R5 = # OF TIMES TO RUN LOOP
MOV A,R0 ;R0 = NOW
MOV R1,A ;R1 = OLD

;NOW SET DI BIT AND RUN LOOP FOR A# OF TIMES
SETB DI
DJNZ R5,LOOP
JMP MAIN

OldLessThanNow: MOV A,R0
SUBB A, R1
MOV R5,A ; R5 = # OF TIMES TO RUN LOOP
MOV A,R0 ;R0 = NOW
MOV R1,A ;R1 = OLD

;NOW SET DI BIT AND GO TO LOOP FOR A# OF TIMES
CLR DI
DJNZ R5,LOOP
JMP MAIN




List of 8 messages in thread
TopicAuthorDate
cjne w/ 2 registers?            01/01/70 00:00      
   think i found it            01/01/70 00:00      
      cjne            01/01/70 00:00      
         there is nothing particularly weird about 805x            01/01/70 00:00      
            I ran this through the simulator ...            01/01/70 00:00      
   Looking at the code...            01/01/70 00:00      
      SUBB and carry            01/01/70 00:00      
   Thank You            01/01/70 00:00      

Back to Subject List