??? 06/21/11 18:12 Read: times |
#182696 - XCHG usage Responding to: ???'s previous message |
In the early days of the 8051 it was thought that there would be quite a bit of packed BCD arithmetic done with the MCU. Packed BCD arithmetic allows for fairly effcient algorithms to be written that can support more than just the 4-5 equivalent digits you get when working with 16-bit binary entities. The XCHG instruction has good use in algorithms that scan through buffers of packed BCD digits in memory.
Once I wrote an application that read data from mag cards using an 8051 type MCU. All the data from the card was able to be stored in 4-bit chunks and to make efficient use of RAM the buffers that held the data were packed two nibbles (the 4-bit chunks) were packed together at two nibbles per byte. I made good use of the XCHG instruction in the low level routines that were used to store and fetch nibbles to/from the storage buffers. Michael Karas |
Topic | Author | Date |
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 |