On May 16, 6:53 am, Oliver Seitz <[email protected]> wrote: > > The offending lines in this case are > > Assembler > > rlf bin[0],f > > rlf bin[1],f > > rlf bcd[4],f > > rlf bcd[2],f > > rlf bcd[0],f > > End Assembler > > > How do I do that in Jal? > > Oh, that's easy. > > var byte work > var bit transfer1,transfer2 > var bit work_msb at work:7 > var bit work_lsb at work:0 > > work=bin[0] > transfer1=work_msb > bin[0]=work << 1 > > work=bin[1] > transfer2=work_msb > work=work << 1 > work_lsb=transfer1 > bin[1]=work > > work=bcd[4] > transfer1=work_msb > work=work << 1 > work_lsb=transfer2 > bcd[4]=work > > work=bcd[2] > transfer2=work_msb > work=work << 1 > work_lsb=transfer1 > bcd[2]=work > > work=bcd[0] > work=work << 1 > work_lsb=transfer2 > bcd[0]=work > > I would say (without having compiled), it will use at least 50 code words and > about 2 bytes ram more than the asm version. And the readability can be > argued. > > Greets, > Kiste
That sadly is not an improvement. If there is only a few simple lines of assembler, I think it's preferable in this case in assembler. Maybe JAL needs a "decimal adjust" or BCD function built in as in micro controller application BCD and packed BCD is common. Strings are of course unpacked BCD added or "ored" with ASCII "0" -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
