Posted: Wed May 14, 2008 7:22 am
Do you have a SEGMENT X USE16 at the front of this code? If not, NASM will be generating the wrong opcodes.
Other than that, I don't see why the code would crash. Best to singlestep it in bochs, and see. The DIV looks like it should work.
Besides that, your math is wrong. You don't need the DIV in the first place. To convert BCD to decimal this way, you'd need to divide by 16, not 10. Which you can do with SHR and AND.
Other than that, I don't see why the code would crash. Best to singlestep it in bochs, and see. The DIV looks like it should work.
Besides that, your math is wrong. You don't need the DIV in the first place. To convert BCD to decimal this way, you'd need to divide by 16, not 10. Which you can do with SHR and AND.