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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/22/08 01:49
Read: times


 
#156920 - incrementing a large number in assembly
check my work - does the following appear correct?

Here is the setup. I am storing a 8 digit number in a EEPROM.
I am using 8 locations in the EEPROM and each location only uses the first nibble to store a number between 0 and 9.

I read all 8 nibbles in to registers 60H (LSN) through 69H (MSN).

I set a pointer to 5FH

The routine flows as follows. Upon exiting the subroutine registers 60H through 69H are put back into the EEPROM.

#############################

START: increment pointer

does it equal 6AH? if so exit subroutine

if not increment the number in the register the pointer points to

does this number now equal 0AH? if not exit subroutine

if the number does equal 0AH then make it 00H

jump back to START of subroutine

#################################

My goal is to have a counter that will increment by one each time the subroutine is called and be able to store a number from 0 to 99,999,999 in the EEPROM

Anyone see a flaw in the above logic flow?

Why only the lower nibble? Because later I want to be able to add 30H to each nibble and print the big number to a printer in ASCII format.

List of 19 messages in thread
TopicAuthorDate
incrementing a large number in assembly            01/01/70 00:00      
   Wear and tear            01/01/70 00:00      
      The EEPROM is            01/01/70 00:00      
      F-RAM            01/01/70 00:00      
         F-RAM problem            01/01/70 00:00      
            what's the problem?            01/01/70 00:00      
               found a substitute            01/01/70 00:00      
   first do it in C, then            01/01/70 00:00      
      Load/Save in loop            01/01/70 00:00      
   To Answer Your Question ...            01/01/70 00:00      
      Thanks Russ - slow event            01/01/70 00:00      
   A sample code for your task            01/01/70 00:00      
      Sample code irrelevant            01/01/70 00:00      
         Socketed EEPROM?            01/01/70 00:00      
            walking writes are dead simple            01/01/70 00:00      
               Larger EEPROM = simple code            01/01/70 00:00      
            the counter is            01/01/70 00:00      
         good point            01/01/70 00:00      
            Blinkers            01/01/70 00:00      

Back to Subject List