| ??? 12/01/03 22:43 Read: times |
#59735 - RE: 6 Decimal Digits Counter Responding to: ???'s previous message |
Hi Hatem,
I simulated the program michael put on and found it to work well. Regards, Charles Bannister ;;********************************************************************* ;; SIX DIGIT UP/DOWN COUNTER COUNTER ;; http://www.8052.com/forum/read.phtml?id=59695 ;; assemble A51 filename.asm ;;********************************************************************* .EQU DIGITS1, 0x14 ;; ram memory LSB .EQU DIGITS2, 0x15 ;; .EQU DIGITS3, 0x16 ;; .EQU DIGITS4, 0x17 ;; .EQU DIGITS5, 0x18 ;; .EQU DIGITS6, 0x19 ;; ram memory MSB .ORG 0H ljmp start .org 100h start: MOV DIGITS1, #00 MOV DIGITS2, #00 MOV DIGITS3, #00 MOV DIGITS4, #00 MOV DIGITS5, #00 MOV DIGITS6, #00 start2: acall cntup mov a, digits6 cjne a, #0x0A, start3 start3: jc start2 ;; < 999999 stop1: sjmp stop1 CNTUP: MOV R0, #DIGITS1 MOV R2, #6 CNTLP: INC @R0 CJNE @R0, #10, CNTCT CNTCT: JC CNTDN MOV @R0, #0 ;; increment 6 digits upward INC R0 DJNZ R2, CNTLP RET CNTDN: RET .END :03000000020100FA :1001000075140075150075160075170075180075C3 :100110001900311DE519B40A0040F780FE78147A01 :0E0120000606B60A004006760008DAF522222E :00000001FF |



