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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/27/11 18:12
Read: times


 
#182743 - simple example
Responding to: ???'s previous message
; sort packed bcd result to seperate memory locations

            mov r0,#30h             ;load r0 with adress of BCD
            mov r1,#40h             ;load r1 with result adress
            mov r2,#03h             ;loop count 4x digits  >04h<
bcd_to_ram: mov a,@r0               ;get BCD
            swap a                  ;low Nibble <-> high Nibble
            xchd a,@r1              ;
            inc r1                  ; 
            swap a                  ;  
            xchd a,@r1              ;   
            inc r0                  ;    1000 in   " "  45
            inc r1                  ;     100 in   " "  44
            djnz r2,bcd_to_ram      ;      10 in   " "  43
            ret                     ;       1 in   " "  42

 



List of 12 messages in thread
TopicAuthorDate
XCHD use            01/01/70 00:00      
   XCHG usage            01/01/70 00:00      
   Search...            01/01/70 00:00      
   Re: XCHD use            01/01/70 00:00      
   not generated            01/01/70 00:00      
      SDCC might add pBCD type of numbers            01/01/70 00:00      
         Not a good idea            01/01/70 00:00      
            Depends            01/01/70 00:00      
               You're right            01/01/70 00:00      
   another possibility ...            01/01/70 00:00      
      both: 8048 legacy + (packed) BCD            01/01/70 00:00      
         simple example            01/01/70 00:00      

Back to Subject List