0

I wrote this function to calculate a current and after calculating it needs to print this calculated number. But in the emulator screen i get a random answer such as smiley faces and ¶ this character with decimal number between them. I think I need to change these hexadecimal characters to decimal characters but dont know how to do it. Can you help me?

islem: 

  MOV AX,[SI+14]
  MOV BX,[SI+10]
  MOV CX,[SI+2]
  
  SUB AX,BX
  SUB AX,CX
  
  
  MOV [SI+16],AX
  
  MOV DX,00H
  MOV AX,[SI+16]
  DIV BX
  
  MOV [SI+18],OFFSET IE
  
  MOV [SI+18],BX
  
  CALL NEWLINE
  
  mov dx, offset Ie_msg
  mov ah,9
  int 21h
  
  MOV AH,09H 
  MOV DX,offset IE
  INT 21H 
  


ret
  • To convert a binary number between 0 and 9 to an ASCII digit, simply add "0x30". For binary values > 9, look [here](https://forum.nasm.us/index.php?topic=1103.0) or [here](https://stackoverflow.com/a/53816172/421195) – paulsm4 Jun 01 '21 at 19:51
  • 1
    Look at [Displaying numbers with DOS](https://stackoverflow.com/questions/45904075/displaying-numbers-with-dos) for an in-depth explanation... – Sep Roland Jun 01 '21 at 19:59

0 Answers0