16bit SX-28 BIN2BCD routine
Frasse
Posts: 11
Hi,
Does anybody out there have a working 16bit Binary to BCD routine in SX assembler?
Any help would be much appreciated.
Best regards
Frasse
Does anybody out there have a working 16bit Binary to BCD routine in SX assembler?
Any help would be much appreciated.
Best regards
Frasse
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MRC
Thanks ever so much for your posted routine for conversion - works like a dream!
That is when I'm singlestepping it in the debugger. However I am planning to use it as a subroutine within a SXB program and have not been able to get it working in that environment.
I think I know how to pass the parameters to the subroutine, however I think I'm messing things up when putting the routine in another memory bank.
I equated the start of the subroutine way out of the way of the "basic code" according to the device listing, but trying to singlestep a SXB program I·get totally·lost among all the embedded bank statements.
Do you happen to have any example of how to call the (a) subroutine from within an SXB program? I would be very greatful.
Best regards and many thanks
Hans alias Frasse
I have only used bin2bcd with assembly language. I have not used it with SXB as I only·use SXB to do quick test programs.
I will look into how to make the bin2bcd work as an SXB subroutine using the parameter variables to pass in the 16 bit value. It would be a valuable exercise for me.
It will take me a day or two before I can get to it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MRC
Very kind of you, it will be very much appreciated.
I am eagerly waiting.
Regards
Hans
It is going to be a bit longer than I anticipated, we have had a death in the family. [noparse]:([/noparse]
My father in law, who I loved very much, has passed on.
Later this week, when things settle out some I'll get back to work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MRC
Sorry to hear about your great loss.
Take all the time you need! After all it's only a hobby ours. Some things are more important than others and your family is by far the most important.
Regards
Hans
Things have finally settled down enough that I could get back to this.· I found a better 16 bit to BCD conversion routine, it is much faster and works very well as an SXB subroutine.· The word to be converted is a two byte array, the output is a 5 byte array.· The input is least significant byte first, the output is most significant digit first.· The output is ASCII and is not zero terminated by the subroutine, but that would be trivial to add.· I have tested it with SXSIM to verify it works with the SX28 and the SX52.· It works very nicely and requires no temporary space other than the __PARAM variables used in SXB.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MRC