Guest User

Untitled

a guest
Apr 23rd, 2018
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL small
  2. .STACK 100h
  3. .DATA
  4. CR EQU 0DH
  5. LF EQU 0AH
  6. MSG1 DB 'ENTER FIRST NUMBER : $'
  7. Numb1 ?
  8. MSG2 DB CR,LF'ENTER SECOND NUMBER : $'
  9. Numb2 ?
  10. MSG3 DB CR,LF'RESULT IS : '
  11. CHAR db ?,'$'
  12. .CODE
  13. MAIN PROC
  14. mov AX,@DATA
  15. mov DS,AX
  16. ;load DS
  17. LEA DX,MSG1
  18. mov AH,9
  19. INT 21h
  20. ;print first msg
  21. mov AH,1
  22. INT 21h
  23. mov Numb1,AL
  24. ;Move first number to Numb1 var
  25. LEA DX,MSG2
  26. mov AH,9
  27. INT 21h
  28. ;print Second msg
  29. mov AH,1
  30. INT 21h
  31. mov Numb2,AL
  32. ;Move Second number to Numb2 var
  33. add numb2,numb1
  34. mov CHAR,numb2
  35. ;here where i am not sure if i can use add numb2,numb1 since both are memory locations ?
  36. ; another code is
  37. ;mov BL,numb1
  38. ;add numb2,BL
  39. LEA DX,MSG3
  40. mov AH,9
  41. INT 21h
  42. ;here will display the 3rd msg with the result
  43. mov AH,4CH
  44. int 21h
  45. MAIN ENDP
  46. END MAIN
Add Comment
Please, Sign In to add comment