Advertisement
Guest User

Amazing shit

a guest
May 15th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. IDEAL
  2. ; MODEL small
  3. ; STACK 100h
  4. ; DATASEG
  5.  
  6. ; CODESEG
  7.  
  8. ; proc drawpiece
  9. params
  10.     al - color
  11.     cx - starting x coord
  12.     dx - starting y coord
  13.  
  14.     ; push bx
  15.     ; push ax
  16.     ; push di
  17.     ; push dx
  18.     ; push si
  19.     ; push cx
  20.    
  21.     ; mov ah, 0Ch
  22.    
  23.     ; xor si, si
  24.     ; xor di, di
  25.    
  26. ; dpflp: ;draw pieces function loop
  27.     ; int 10h
  28.     ; inc si
  29.     ; add cx, 1
  30.    
  31.     ; cmp si, 13 ;change somehow
  32.     ; jb dpflp
  33.    
  34.     ; pop cx
  35.     ; push cx
  36.     ; add cx, 6
  37.  
  38.     ; xor si, si
  39.    
  40.     ; inc di
  41.     ; inc dx
  42.    
  43.     ; cmp di, 13 ;change somehow
  44.     ; jb dpflp
  45.    
  46.     drawing the mouse after drawing a piece because it doesn't draw stuff under the mouse... somehow...
  47.     ; mov ax, 1
  48.     ; int 33h
  49.    
  50.    
  51.     ; pop cx
  52.     ; pop si
  53.     ; pop dx
  54.     ; pop di
  55.     ; pop ax
  56.     ; pop bx
  57.    
  58.     ; ret
  59. ; endp drawpiece
  60.  
  61. ; proc rect
  62. cx: starting x
  63. dx: starting
  64. al: color
  65. height: bp-2
  66. width: bp
  67.  
  68.  
  69.     ; push bp
  70.     ; mov bp, sp
  71.     ; sub bp, 4
  72.     ; push cx
  73.     ; push dx
  74.     ; push ax
  75.     ; push di
  76.     ; push si
  77.     ; push bx
  78.  
  79.     ; mov bh, 0h
  80.     ; mov ah,0ch
  81.     ; xor di, di
  82.     ; xor si, si
  83.    
  84. ; startloop:
  85.     ; int 10h
  86.    
  87.     ; inc cx
  88.     ; inc di
  89.    
  90.     ; cmp di, [bp-2]
  91.     ; jb startloop
  92.    
  93.     ; xor cx, cx
  94.     ; xor di, di
  95.    
  96.     ; inc dx
  97.     ; inc si
  98.     ; cmp si, [bp]
  99.     ; jb startloop
  100.    
  101.     ; pop bp
  102.     ; pop bx
  103.     ; pop si
  104.     ; pop di
  105.     ; pop ax
  106.     ; pop dx
  107.     ; pop cx
  108.    
  109.     ; ret
  110.    
  111. ; endp rect
  112.  
  113. ; start:
  114.     ; mov ax, @data
  115.     ; mov ds, ax
  116.    
  117.     Let's start coding!
  118.    
  119.     Graphic mode
  120.     ; mov ax, 13h
  121.     ; int 10h
  122.    
  123.    
  124. ; exit:
  125.     ; mov ax, 4c00h
  126.     int 21h
  127. ; END start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement