This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

5 Byte number to be converted into decimal string

Hallo

it would be fine if somebody could help me on the following problem: I have to send the decimal digits of a 5 Byte Hex value, that is currently stored in an array, via the serial interface. It is no problem to get the digits of a 4 Byte number but Keil or the controller do not allow double integer!

any solution????

Parents
  • Thanks for the link. I use some similar C code to get by for now. Occasionally I toy with writing proper assembler subroutines to do the math, but I haven't so far.

    (One question that comes up: The DPTR can be incremented, but not decremented. So, when you're adding U64s in xdata, it would be very natural if they were little-endian. You'd just have a movx addc inc dptr loop. Keil is of course big-endian, but you can't do the same thing and "dec dptr" quite as easily. So, are there any neat 8051 assembler tricks for doing big integer math that's not all done in registers/data space? I'm not much of an assembler wizard.)

Reply
  • Thanks for the link. I use some similar C code to get by for now. Occasionally I toy with writing proper assembler subroutines to do the math, but I haven't so far.

    (One question that comes up: The DPTR can be incremented, but not decremented. So, when you're adding U64s in xdata, it would be very natural if they were little-endian. You'd just have a movx addc inc dptr loop. Keil is of course big-endian, but you can't do the same thing and "dec dptr" quite as easily. So, are there any neat 8051 assembler tricks for doing big integer math that's not all done in registers/data space? I'm not much of an assembler wizard.)

Children
  • Of course, if you're making up your own 64-bit data type, you don't have to stick with Keil's big-endianism...

    I s'pose it depends on your application and whether 64-bit efficiency on its own is more important than the efficiency of "interfacing" to Keil's standard types?