home *** CD-ROM | disk | FTP | other *** search
/ PC World 1999 October / PCWorld_1999-10_cd1.bin / Novinky / expert / INTRO256 / JEANSY.ZIP / invi2f99.asm < prev    next >
Assembly Source File  |  1999-08-23  |  2KB  |  135 lines

  1. ;Invitro to Fiasko'99
  2. .386
  3. crs segment use16
  4. assume es:crs,cs:crs,ss:crs,ds:crs
  5. org 100h
  6. all:
  7.  
  8.  mov  al,13h
  9.  int  10h
  10.  push 0A000h
  11.  pop  es
  12.  mov  dx,03C8h
  13.  mov  cl,3Fh
  14. @paletu:
  15.  mov  al,cl
  16.  out  dx,al
  17.  inc  dx
  18.  shr  al,2
  19.  out  dx,al
  20.  mov  al,cl
  21.  shr  al,1
  22.  out  dx,al
  23.  shl  al,1
  24.  out  dx,al
  25.  dec  dx
  26.  loop @paletu
  27.  mov  si,offset tabulka
  28.  mov  bx,0210h
  29. @cykl:
  30.  lodsw
  31.  inc  ax
  32.  jz   @ven
  33.  mov  di,ax
  34.  lodsw
  35.  mov  dx,ax
  36.  mov  al,bl
  37.  call @Quad
  38.  jmp  @cykl
  39. @ven:
  40.  xor  bl,bl
  41.  dec  bh
  42.  jnz  @cykl
  43. @cast2:
  44.  xor  di,di
  45.  mov  si,318
  46.  mov  cl,30h
  47. @adding:
  48.  cmp  cx,20h
  49.  ja   @adding0
  50.  mov  si,321
  51. @adding0:
  52.  push cx
  53.  xor  cx,cx
  54. @adding1:
  55.  inc  di
  56.  in   al,40h
  57.  test al,1
  58.  jz   @adding2
  59.  add  di,si
  60. @adding2:
  61.  cmp  byte ptr es:[di],63
  62.  jae  @adding3
  63.  inc  byte ptr es:[di]
  64. @adding3:
  65.  loop @adding1
  66.  pop  cx
  67.  in   al,60h
  68.  dec  al
  69.  jz   @end
  70.  loop @adding
  71. @end:
  72.  mov  ax,1200h
  73.  mov  bl,33h
  74.  int  10h
  75.  xor  ah,ah
  76.  int  16h
  77.  retn
  78.  
  79. ;{procedura, ktera nakresli vyplneny obdelnik
  80. ; al-barva, di-nastavena pozice (y*320+x), dh-sirka, dl-vyska}
  81. @Quad:
  82.  push bx
  83.  
  84.  xor  bh,bh
  85.  mov  bl,dh
  86.  xor  ch,ch
  87.  mov  cl,dl
  88. @Quad1:
  89.  push cx
  90.  
  91.  mov  cl,dh
  92.  rep  stosb
  93.  add  di,320
  94.  sub  di,bx
  95.  
  96.  pop  cx
  97.  
  98.  loop @Quad1
  99.  pop  bx
  100.  retn
  101.  
  102. origcx    dw    ?
  103.  
  104. ;parametry pro kresleni obdelniku:
  105. ;první word - offset, druhy word - sírka shl 8+vyska
  106. ;0FFFFh znamena ukonceni
  107. tabulka    dw    10+    20 *320,    17  shl 8+    100
  108.            dw    26+     20 *320,    28  shl 8+    5
  109.            dw    26+     42 *320,    26  shl 8+    7
  110.            dw    62+     20 *320,    13  shl 8+    100
  111.            dw    84+     20 *320,    7   shl 8+    100
  112.            dw    84+     20 *320,    48  shl 8+    5
  113.            dw    117+    25 *320,    15  shl 8+    98
  114.            dw    94+     42 *320,    23  shl 8+    7
  115.            dw    139+    20 *320,    49  shl 8+    100
  116.            dw    197+    20 *320,    17  shl 8+    100
  117.            dw    214+    42 *320,    36  shl 8+    5
  118.            dw    231+    20 *320,    7   shl 8+    24
  119.            dw    238+    42 *320,    12  shl 8+    85
  120.            dw    258+    20 *320,    51  shl 8+    100
  121.            dw    120+    133*320,    5   shl 8+    9
  122.            dw    131+    135*320,    29  shl 8+    43
  123.            dw    168+    135*320,    29  shl 8+    43
  124.            dw    0FFFFh
  125.            dw    139+    48 *320,    32  shl 8+    66
  126.            dw    153+    25 *320,    35  shl 8+    17
  127.            dw    272+    25 *320,    22  shl 8+    90
  128.            dw    139+    138*320,    13  shl 8+    9
  129.            dw    176+    138*320,    13  shl 8+    9
  130.            dw    131+    152*320,    21  shl 8+    23
  131.            dw    168+    152*320,    21  shl 8+    23
  132.     dw    0FFFFh
  133.  
  134. crs ends
  135. end all