Advertisement
Ae_Mc

Eye of Providence

Dec 27th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. org 256
  2. mov ax, 0x0013
  3. int 0x10
  4. push array ; Matrix data
  5. push 50    ; Matrix x
  6. push 40    ; Matrix y
  7. push 20    ; Matrix width
  8. push 20    ; Matrix height
  9. call print_matr
  10. add sp, 10
  11. while:
  12.     mov ah, 0
  13.     int 0x16
  14.     cmp al, 'q'
  15. jnz while
  16. mov ax, 3
  17. int 0x10
  18. ret
  19.  
  20. array: db 0,   0,   0,   0,   0,   0,   0,   0,   0,   15,  15,  00,  00,  00,  00,  00,  00,  00,  00,  00, \
  21.           00,  00,  00,  00,  00,  00,  00,  00,  15,  00,  00,  15,  00,  00,  00,  00,  00,  00,  00,  00,\
  22.           00,  00,  00,  00,  00,  00,  00,  15,  00,  00,  00,  00,  15,  00,  00,  00,  00,  00,  00,  00,\
  23.           00,  00,  00,  00,  00,  00,  00,  15,  00,  00,  00,  00,  15,  00,  00,  00,  00,  00,  00,  00,\
  24.           00,  00,  00,  00,  00,  00,  15,  00,  00,  15,  15,  00,  00,  15,  00,  00,  00,  00,  00,  00,\
  25.           000, 000, 000, 000, 000, 015, 000, 000, 015, 000, 000, 015, 000, 00,  015, 000, 000, 000, 000, 000,\
  26.           000, 000, 000, 000, 000, 015, 000, 015, 000, 000, 000, 000, 015, 000, 15,  000, 000, 000, 000, 000,\
  27.           000, 000, 000, 000, 015, 000, 015, 000, 000, 015, 015, 000, 000, 015, 000, 015, 000, 000, 000, 000,\
  28.           000, 000, 000, 015, 000, 015, 000, 000, 000, 015, 015, 000, 000, 000, 015, 000, 015, 000, 000, 000,\
  29.           000, 000, 000, 015, 000, 015, 000, 000, 000, 015, 015, 000, 000, 000, 015, 000, 015, 000, 000, 000,\
  30.           0,   0,   015, 0,   0,   015, 000, 0,   0,   15,  15,  00,  00,  00,  15,  00,  00,  15,  00,  00,\
  31.           00,  15,  00,  00,  00,  00,  015, 00,  00,  15,  15,  00,  00,  15,  00,  00,  00,  00,  15,  00,\
  32.           00,  15,  00,  00,  00,  00,  00,  15,  00,  00,  00,  00,  15,  00,  00,  00,  00,  00,  15,  00,\
  33.           15,  00,  00,  00,  00,  00,  00,  00,  15,  00,  00,  15,  00,  00,  00,  00,  00,  00,  00,  15,\
  34.           15,  00,  00,  00,  00,  00,  00,  00,  00,  15,  15,  00,  00,  00,  00,  00,  00,  00,  00,  15,\
  35.           015, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 015,\
  36.           015, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 015,\
  37.           015, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 015,\
  38.           015, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 015,\
  39.           015, 015, 015, 015, 015, 015, 015, 015, 015, 015, 015, 015, 015, 015, 015, 015, 015, 015, 015, 015
  40.  
  41. print_matr:
  42.     push bp
  43.     mov bp, sp
  44.     push ax
  45.     push bx
  46.     push cx
  47.     push dx
  48.     mov ah, 0xC
  49.     mov bx, [bp + 12]  ; Matrix data
  50.     mov dx, [bp + 8]   ; y
  51.     add WORD[bp + 4], dx
  52.     mov cx, WORD[bp + 10]
  53.     add WORD[bp + 6], cx  ; now in [bp + 6] matrix x2 coord
  54.     matr_while1:
  55.         mov cx, [bp + 10] ; x
  56.         matr_while2:
  57.             mov al, [bx]
  58.             int 0x10
  59.             inc bx
  60.             inc cx
  61.             cmp cx, [bp + 6]
  62.         jnz matr_while2
  63.         inc dx
  64.         cmp dx, [bp + 4]
  65.     jnz matr_while1
  66.     pop dx
  67.     pop cx
  68.     pop bx
  69.     pop ax
  70.     pop bp
  71.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement