home *** CD-ROM | disk | FTP | other *** search
/ Die ASC Mega 2 / ASC-Mega2-CD-ROM.iso / SPIELE / KAISER / BOX.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-06-10  |  1.9 KB  |  109 lines

  1. ; BOX.ASM
  2. ;
  3. ; procedure box(muster,x_start,y_start,x_lng,y_lng,rand_att,mitt_att: byte);
  4.  
  5. data        segment word public
  6.         assume ds:data
  7.  
  8.         extrn    crt_screen: dword
  9.         extrn   box_muster: unknown
  10. lo        db (?)
  11. ho        db (?)
  12. ro        db (?)
  13. ve        db (?)
  14. lu              db (?)
  15. ru              db (?)
  16.  
  17. data        ends
  18.  
  19.  
  20. code        segment word public
  21.         assume cs:code
  22.  
  23. box        proc far
  24.         public box
  25.  
  26. lng        equ 6    ; BP + Rücksprung-AD
  27. mitt_att    equ byte ptr ss:[bp+lng]
  28. rand_att    equ byte ptr ss:[bp+lng+2]
  29. y_lng        equ byte ptr ss:[bp+lng+4]
  30. x_lng        equ byte ptr ss:[bp+lng+6]
  31. y_start        equ byte ptr ss:[bp+lng+8]
  32. x_start        equ byte ptr ss:[bp+lng+10]
  33. muster        equ byte ptr ss:[bp+lng+12]
  34. param_bytes    equ 14
  35.  
  36.     push    bp
  37.     mov    bp,sp
  38.  
  39.     cld
  40.     push    ds
  41.     pop    es
  42.     mov    si,offset(box_muster)
  43.     mov    di,offset(lo)
  44.     mov    al,muster
  45.     xor    ah,ah
  46.     mov    bx,6
  47.     mul    bx
  48.     add    si,ax
  49.     mov    cx,3
  50.     rep    movsw
  51.  
  52.     les    di,crt_screen
  53.         assume    es:nothing
  54.         mov     al,x_start
  55.     xor    ah,ah
  56.         shl     ax,1
  57.     add    di,ax
  58.     mov    al,y_start
  59.     mov    bx,160
  60.     mul    bx
  61.     add    di,ax        ; ES:DI zeigt auf linke untere Ecke der Box
  62.     mov    si,di        ; SI = linker Rand
  63.     mov    bl,x_lng
  64.     xor    bh,bh        ; BX = x_lng
  65.     mov    dh,rand_att    ; DH = rand_att
  66.     mov    ah,dh
  67.  
  68.     mov    al,lo
  69.     stosw            ; linke obere Ecke zeichen
  70.     mov    al,ho
  71.     mov    cx,bx
  72.     rep    stosw        ; oberen waagerechten Balken zeichnen
  73.     mov    al,ro
  74.     stosw            ; rechte obere Ecke zeichnen
  75.  
  76.     mov    dl,y_lng
  77. y_loop:
  78.     add    si,160
  79.     mov    di,si
  80.     mov    ah,dh
  81.     mov    al,ve
  82.     stosw            ; linken Rand zeichnen
  83.     mov    al,' '
  84.     mov    ah,mitt_att
  85.     mov    cx,bx
  86.     rep    stosw        ; Mitte ausfüllen
  87.     mov    al,ve
  88.     mov    ah,dh
  89.     stosw            ; rechten Rand zeichnen
  90.     dec    dl
  91.     jnz    y_loop
  92.     add    si,160
  93.     mov    di,si
  94.  
  95.     mov    al,lu
  96.     stosw            ; linke untere Ecke zeichen
  97.     mov    al,ho
  98.     mov    cx,bx
  99.     rep    stosw        ; unteren waagerechten Balken zeichnen
  100.     mov    al,ru
  101.     stosw            ; rechte untere Ecke zeichnen
  102.  
  103.     pop    bp
  104.     ret    param_bytes
  105.  
  106. box        endp
  107.  
  108. code        ends
  109.         end