Advertisement
shawonrog

WRITE A PROGRAM <A-F> HEX INTO DECIMAL LIPU VERSION

Oct 2nd, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. .MODEL SMALL
  2. .STACK 100H
  3. .DATA
  4. A DW "INPUT:ENTER A HEX DIGIT: $"
  5. B DW "OUTPUT:IN DECIMAL IT IS: $"
  6.  
  7. .CODE
  8. MAIN PROC
  9.  
  10. MOV AX,@DATA
  11. MOV DS,AX
  12.  
  13. ;MSG1
  14. LEA DX,A
  15. MOV AH,9
  16. INT 21H
  17.  
  18. ;SCAN
  19. MOV AH,1
  20. INT 21H
  21. MOV BL,AL
  22.  
  23.  
  24.  
  25. ;NEWLINE
  26. MOV AH,2
  27. MOV DL,0DH
  28. INT 21H
  29. MOV DL,0AH
  30. INT 21H
  31.  
  32. ;MSG2
  33. LEA DX,B
  34. MOV AH,9
  35. INT 21H
  36.  
  37.  
  38. MOV AH,2
  39. MOV DL,'1'
  40. INT 21H
  41.  
  42. SUB BL,11H
  43.  
  44. MOV AH,2
  45. MOV DL,BL
  46. INT 21H
  47.  
  48.  
  49. MAIN ENDP
  50. END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement