Advertisement
chavis54

I cant code in assembly and BY GOD I WANT TO LEARN

Jan 21st, 2021
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. ;Constants
  2. xIni equ 0
  3. yIni equ 0
  4.  
  5. xFin equ 90
  6. yFin equ 90
  7.  
  8. ;Data Segment
  9. datos segment
  10. cadena1 db "Aqui es la posicion Inicial $"
  11. cadena2 db "Aqui es la posicion Final $"
  12. datos ends
  13. ;Stack Segment
  14. Pila segment stack
  15.  
  16. db 128 dup(0)
  17.  
  18. Pila ends
  19.  
  20. ;Code Segment
  21. Codigo segment
  22. practica19 proc far
  23. assume cs:Codigo, ds:datos, ss:Pila
  24. push ds
  25. mov ax, 0
  26. push ax
  27.  
  28. mov ah, 0
  29. mov al, 03h
  30. int 10h
  31.  
  32. mov ax, 0h
  33.  
  34. mov dh, [yIni]
  35. mov dl, [xIni]
  36. mov bh, 0
  37. call posicion
  38.  
  39.  
  40. mov dx, offset [ds:cadena1]
  41. call escribir
  42.  
  43.  
  44. mov dh, [yFin]
  45. mov dl, [xFin]
  46. mov bh, 0
  47. call posicion
  48.  
  49. mov dx, offset [cadena2]
  50. call escribir
  51.  
  52. ret
  53. practica19 endp
  54.  
  55. posicion proc
  56.  
  57. push ax
  58. push bx
  59. push cx
  60. push dx
  61.  
  62. mov ah, 02h
  63. mov bh, 0
  64. int 10h
  65.  
  66. pop dx
  67. pop cx
  68. pop bx
  69. pop ax
  70. ret
  71. posicion endp
  72.  
  73. escribir proc
  74. push ax
  75. push bx
  76. push cx
  77. push dx
  78.  
  79. mov ah, 09h
  80. int 21h
  81.  
  82. pop dx
  83. pop cx
  84. pop bx
  85. pop ax
  86. ret
  87. escribir endp
  88.  
  89. Codigo ends
  90.  
  91. end
  92.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement