0

Without experience or even a lecture whatsoever in assembly language our professor told us to add & subtract 16bit decimal numbers in Dosbox Debug, we only know handful of syntax that can work in debug. After a week of trying i only manage to this line of codes to convert my hexa inputs to decimal output but only a 4bit number.

mov al,9  
mov bl,8  
add al,bl  
daa  
int 21  
int 20  
Michael
  • 57,169
  • 9
  • 80
  • 125
legodude
  • 1
  • 1
  • By far the easiest thing is to use 16-bit registers like AX and BX. But if you need to convert from and back to decimal, see [NASM Assembly convert input to integer?](https://stackoverflow.com/q/19309749) and [Displaying numbers with DOS](https://stackoverflow.com/q/45904075). You're going to want to set AH before `int 21h`, as that determines which DOS function aka system call get invoked. http://spike.scu.edu.au/~barry/interrupts.html – Peter Cordes Oct 03 '22 at 21:40
  • If you're using `daa` you can use the same algorithm used to convert hex to ascii. https://stackoverflow.com/questions/1922134/printing-out-a-number-in-assembly-language/22897576#22897576 – puppydrum64 Dec 22 '22 at 17:32

0 Answers0