Closed egor-erm closed 1 month ago
as i know my bcd addition functions already works with packed digits as i use daa
to adjust the result of adding two packed decimal digits
but multiplication only works with unpacked digits, because of aam
, as said in fasm manual at section 2.1.4 Decimal arithmetic instructions
https://flatassembler.net/docs.php?article=manual
these guys also explained why aam only works with unpacked numbers
looks like aam
thing is as old as x86 instruction set, and you can find more info about it here
https://www.felixcloutier.com/x86/aam
so you could just unpack numbers before multiplying them and then pack them back...
also idk why would you need bcd to decimal convertors, but i hope anything of these will help you
Thanks, in the end I converted the bcd from packaged to unpacked, multiplied and converted back.
Is it possible to add a multiplication and addition function for packed numbers when 1 byte contains 2 digits at once? In the picture you can see the representation of the number 1234 in this form.![image](https://github.com/mettemfurfur000/fasm-bcd-mul/assets/60964356/29749403-5c67-4c57-8fe4-468ae70537dd)
The code for converting two-digit decimal numbers to packed BCD and back.