| ??? 08/15/08 17:34 Modified: 08/15/08 18:16 Read: times |
#157507 - Thank You Responding to: ???'s previous message |
Thank you everyone for the comments. I decided to use Russell's idea combined with Jan's clearing beforehand.
Sorry for waiting so long to reply. I got a little bit side tracked. Here is updated code
; GET DIFFERNCE BETWEEN OLD AND NOW
GETDIFFERENCE: MOV A,R1 ;R1 IS OLD
OldGreaterThanNow: CLR C
SUBB A, R0
JC OLDLESSTHANNOW ;if carry set new > old &jump
JZ FINISH ; JUMP TO END a=0
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
Regards, Steve |
| Topic | Author | Date |
| 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 |



