Advertisement
Mehrin_97

lab 1 assembly

Sep 22nd, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1.  
  2. ; You may customize this and other start-up templates;
  3. ; The location of this template is c:\emu8086\inc\0_com_template.txt
  4.  
  5. org 100h
  6.  
  7. ; add your code here
  8.  
  9. .DATA
  10.  
  11. INPUT DB "Enter a value $"
  12. OUTPUT DB "OUTPUT IS $"
  13. Var DW ?
  14.  
  15.  
  16. .Code
  17.  
  18. ;PRINT STRING
  19. MOV AX, @DATA; initialize DS
  20. MOV DS,AX
  21. LEA DX,INPUT; load & display the STRING_1
  22. MOV AH,09
  23. INT 21H
  24.  
  25. ;MOV AH,01
  26. ;Int 21H
  27.  
  28.  
  29. ;Take Input
  30. MOV AH,01
  31. INT 21H
  32. MOV BL,AL
  33.  
  34. ;NEW LINE
  35.  
  36. MOV AH,02
  37. MOV DL, 0DH; carriage return
  38. INT 21H
  39. MOV DL,0AH; linefeed
  40. INT 21H
  41.  
  42. ;Print String
  43. MOV AX, @DATA; initialize DS
  44. MOV DS,AX
  45. LEA DX,OUTPUT; load display the String_1
  46. MOV AH,09
  47. INT 21H
  48.  
  49. ;Shift input in DL
  50. MOV DL,BL
  51.  
  52. ;Display input
  53. MOV AH,02
  54. INT 21H
  55.  
  56.  
  57.  
  58. ;MOV DL,AL
  59. ;MOV AH,02
  60. ;INT 21H
  61.  
  62. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement