home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / asm / PJGRAPH.ZIP / CHAP01.1 next >
Encoding:
Text File  |  1989-09-26  |  19.9 KB  |  541 lines

  1. ; Sample EGA program.
  2. ; Animates four balls bouncing around a playfield by using
  3. ; page flipping. Playfield is panned smoothly both horizontally
  4. ; and vertically.
  5. ; Assembled with MASM 4.0, linked with LINK 3.51.
  6. ; By Michael Abrash, 11/2/86.
  7. ; Updated 6/24/89.
  8. ;
  9. stackseg        segment para stack 'STACK'
  10.         db      512 dup(?)
  11. stackseg        ends
  12. ;
  13. HIRES_VIDEO_MODE        equ     0       ;define for 640x350 video mode
  14.                                         ; comment out for 640x200 
  15. mode
  16. VIDEO_SEGMENT   equ     0a000h          ;display memory segment for
  17.                                         ; true EGA graphics modes
  18. LOGICAL_SCREEN_WIDTH    equ     672/8   ;width in bytes and height in scan
  19. LOGICAL_SCREEN_HEIGHT   equ     384     ; lines of the virtual screen
  20.                                         ; we'll work with
  21. PAGE0           equ     0       ;flag for page 0 when page flipping
  22. PAGE1           equ     1       ;flag for page 1 when page flipping
  23. PAGE0_OFFSET    equ     0       ;start offset of page 0 in EGA memory
  24. PAGE1_OFFSET    equ     LOGICAL_SCREEN_WIDTH * LOGICAL_SCREEN_HEIGHT
  25.                                 ;start offset of page 1 (both pages
  26.                                 ; are 672x384 virtual screens)
  27. BALL_WIDTH      equ     24/8    ;width of ball in display memory bytes
  28. BALL_HEIGHT     equ     24      ;height of ball in scan lines
  29. BLANK_OFFSET    equ     PAGE1_OFFSET * 2        ;start of blank image
  30.                                                 ; in EGA memory
  31. BALL_OFFSET     equ     BLANK_OFFSET + (BALL_WIDTH * BALL_HEIGHT)
  32.                                 ;start offset of ball image in EGA memory
  33. NUM_BALLS       equ     4       ;number of balls to animate
  34. ;
  35. ; EGA register equates.
  36. ;
  37. SC_INDEX        equ     3c4h    ;SC index register
  38. MAP_MASK        equ     2       ;SC map mask register
  39. GC_INDEX        equ     3ceh    ;GC index register
  40. GC_MODE         equ     5       ;GC mode register
  41. CRTC_INDEX      equ     03d4h   ;CRTC index register in color modes
  42. START_ADDRESS_HIGH equ  0ch     ;CRTC start address high byte
  43. START_ADDRESS_LOW equ   0dh     ;CRTC start address low byte
  44. CRTC_OFFSET     equ     13h     ;CRTC offset register
  45. STATUS_REGISTER_1 equ   03dah   ;EGA status register in color modes
  46. VSYNC_MASK      equ     08h     ;vertical sync bit in status register 1
  47. AC_INDEX        equ     03c0h   ;AC index register
  48. HPELPAN         equ     20h OR 13h      ;AC horizontal pel panning
  49.                                         ; register (bit 5 is 1 to keep
  50.                                         ; palette RAM addressing on)
  51. dseg    segment para common 'DATA'
  52. CurrentPage             db      PAGE1           ;page to draw to
  53. CurrentPageOffset       dw      PAGE1_OFFSET
  54. ;
  55. ; Four plane's worth of multicolored ball image.
  56. ;
  57. BallPlane0Image label   byte            ;blue plane (plane 0) image
  58.         db      000h, 03ch, 000h, 001h, 0ffh, 080h
  59.         db      007h, 0ffh, 0e0h, 00fh, 0ffh, 0f0h
  60.         db      4 * 3 dup(000h)
  61.         db      07fh, 0ffh, 0feh, 0ffh, 0ffh, 0ffh
  62.         db      0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
  63.         db      4 * 3 dup(000h)
  64.         db      07fh, 0ffh, 0feh, 03fh, 0ffh, 0fch
  65.         db      03fh, 0ffh, 0fch, 01fh, 0ffh, 0f8h
  66.         db      4 * 3 dup(000h)
  67. BallPlane1Image label   byte            ;green plane (plane 1) image
  68.         db      4 * 3 dup(000h)
  69.         db      01fh, 0ffh, 0f8h, 03fh, 0ffh, 0fch
  70.         db      03fh, 0ffh, 0fch, 07fh, 0ffh, 0feh
  71.         db      07fh, 0ffh, 0feh, 0ffh, 0ffh, 0ffh
  72.         db      0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
  73.         db      8 * 3 dup(000h)
  74.         db      00fh, 0ffh, 0f0h, 007h, 0ffh, 0e0h
  75.         db      001h, 0ffh, 080h, 000h, 03ch, 000h
  76. BallPlane2Image label   byte            ;red plane (plane 2) image
  77.         db      12 * 3 dup(000h)
  78.         db      0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
  79.         db      0ffh, 0ffh, 0ffh, 07fh, 0ffh, 0feh
  80.         db      07fh, 0ffh, 0feh, 03fh, 0ffh, 0fch
  81.         db      03fh, 0ffh, 0fch, 01fh, 0ffh, 0f8h
  82.         db      00fh, 0ffh, 0f0h, 007h, 0ffh, 0e0h
  83.         db      001h, 0ffh, 080h, 000h, 03ch, 000h
  84. BallPlane3Image label   byte            ;intensity on for all planes,
  85.                                         ; to produce high-intensity colors
  86.                                         ; (plane 3)
  87.         db      000h, 03ch, 000h, 001h, 0ffh, 080h
  88.         db      007h, 0ffh, 0e0h, 00fh, 0ffh, 0f0h
  89.         db      01fh, 0ffh, 0f8h, 03fh, 0ffh, 0fch
  90.         db      03fh, 0ffh, 0fch, 07fh, 0ffh, 0feh
  91.         db      07fh, 0ffh, 0feh, 0ffh, 0ffh, 0ffh
  92.         db      0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
  93.         db      0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
  94.         db      0ffh, 0ffh, 0ffh, 07fh, 0ffh, 0feh
  95.         db      07fh, 0ffh, 0feh, 03fh, 0ffh, 0fch
  96.         db      03fh, 0ffh, 0fch, 01fh, 0ffh, 0f8h
  97.         db      00fh, 0ffh, 0f0h, 007h, 0ffh, 0e0h
  98.         db      001h, 0ffh, 080h, 000h, 03ch, 000h
  99. ;
  100. BallX           dw      15, 50, 40, 70          ;array of ball x coords
  101. BallY           dw      40, 200, 110, 300       ;array of ball y coords
  102. LastBallX       dw      15, 50, 40, 70          ;previous ball x coords
  103. LastBallY       dw      40, 100, 160, 30        ;previous ball y coords
  104. BallXInc        dw      1, 1, 1, 1              ;x move factors for ball
  105. BallYInc        dw      8, 8, 8, 8              ;y move factors for ball
  106. BallRep         dw      1, 1, 1, 1              ;# times to keep moving
  107.                                                 ; ball according to
  108.                                                 ; current increments
  109. BallControl     dw      Ball0Control, Ball1Control      ;pointers to cur-
  110.                 dw      Ball2Control, Ball3Control      ; rent locations
  111.                                                         ; in ball control
  112.                                                         ; strings
  113. BallControlString       dw      Ball0Control, Ball1Control ;pointers to
  114.                         dw      Ball2Control, Ball3Control ; start of
  115.                                                            ; ball control
  116.                                                            ; strings
  117. ;
  118. ; Ball control strings.
  119. ;
  120. Ball0Control    label   word
  121.         dw      10, 1, 4, 10, -1, 4, 10, -1, -4, 10, 1, -4, 0
  122. Ball1Control    label   word
  123.         dw      12, -1, 1, 28, -1, -1, 12, 1, -1, 28, 1, 1, 0
  124. Ball2Control    label   word
  125.         dw      20, 0, -1, 40, 0, 1, 20, 0, -1, 0
  126. Ball3Control    label   word
  127.         dw      8, 1, 0, 52, -1, 0, 44, 1, 0, 0
  128. ;
  129. ; Panning control string.
  130. ;
  131. ifdef HIRES_VIDEO_MODE
  132. PanningControlString    dw      32, 1, 0, 34, 0, 1, 32, -1, 0, 34, 0,
  133.                                         -1, 0
  134. else
  135. PanningControlString    dw      32, 1, 0, 184, 0, 1, 32, -1, 0, 184,
  136.                                         0, -1, 0
  137. endif
  138. PanningControl  dw      PanningControlString    ;pointer to current
  139.                                                 ; location in panning
  140.                                                 ; control string
  141. PanningRep      dw      1       ;# times to pan according to current
  142.                                 ; panning increments
  143. PanningXInc     dw      1       ;x panning factor
  144. PanningYInc     dw      0       ;y panning factor
  145. HPan            db      0       ;horizontal pel panning setting
  146. PanningStartOffset dw   0       ;start offset adjustment to produce
  147.                                 ; vertical panning & coarse
  148.                                 ; horizontal panning
  149. dseg    ends
  150. ;
  151. ; Macro to set indexed register P2 of chip with index register
  152. ; at P1 to AL.
  153. ;
  154. SETREG  macro   P1, P2
  155.         mov     dx,P1
  156.         mov     ah,al
  157.         mov     al,P2
  158.         out     dx,ax
  159.         endm
  160. ;
  161. cseg    segment para public 'CODE'
  162.         assume  cs:cseg, ds:dseg
  163. start   proc    near
  164.         mov     ax,dseg
  165.         mov     ds,ax
  166. ;
  167. ; Select graphics mode.
  168. ;
  169. ifdef HIRES_VIDEO_MODE
  170.         mov     ax,010h
  171. else
  172.         mov     ax,0eh
  173. endif
  174.         int     10h
  175. ;
  176. ; ES always points to EGA memory.
  177. ;
  178.         mov     ax,VIDEO_SEGMENT
  179.         mov     es,ax
  180. ;
  181. ; Draw border around playfield in both pages.
  182. ;
  183.         mov     di,PAGE0_OFFSET
  184.         call    DrawBorder      ;page 0 border
  185.         mov     di,PAGE1_OFFSET
  186.         call    DrawBorder      ;page 1 border
  187. ;
  188. ; Draw all four plane's worth of the ball to undisplayed EGA memory.
  189. ;
  190.         mov     al,01h          ;enable plane 0
  191.         SETREG  SC_INDEX, MAP_MASK
  192.         mov     si,offset BallPlane0Image
  193.         mov     di,BALL_OFFSET
  194.         mov     cx,BALL_WIDTH * BALL_HEIGHT
  195.         rep movsb
  196.         mov     al,02h          ;enable plane 1
  197.         SETREG  SC_INDEX, MAP_MASK
  198.         mov     si,offset BallPlane1Image
  199.         mov     di,BALL_OFFSET
  200.         mov     cx,BALL_WIDTH * BALL_HEIGHT
  201.         rep movsb
  202.         mov     al,04h          ;enable plane 2
  203.         SETREG  SC_INDEX, MAP_MASK
  204.         mov     si,offset BallPlane2Image
  205.         mov     di,BALL_OFFSET
  206.         mov     cx,BALL_WIDTH * BALL_HEIGHT
  207.         rep movsb
  208.         mov     al,08h          ;enable plane 3
  209.         SETREG  SC_INDEX, MAP_MASK
  210.         mov     si,offset BallPlane3Image
  211.         mov     di,BALL_OFFSET
  212.         mov     cx,BALL_WIDTH * BALL_HEIGHT
  213.         rep movsb
  214. ;
  215. ; Draw a blank image the size of the ball to undisplayed EGA memory.
  216. ;
  217.         mov     al,0fh                  ;enable all memory planes,
  218.         SETREG  SC_INDEX, MAP_MASK      ; since the blank has to
  219.         mov     di,BLANK_OFFSET         ; erase all planes
  220.         mov     cx,BALL_WIDTH * BALL_HEIGHT
  221.         sub     al,al
  222.         rep stosb
  223. ;
  224. ; Set EGA to write mode 1, for block copying ball and blank images.
  225. ;
  226.         mov     al,1
  227.         SETREG  GC_INDEX, GC_MODE
  228. ;
  229. ; Set EGA offset register in words to define logical screen width.
  230. ;
  231.         mov     al,LOGICAL_SCREEN_WIDTH / 2
  232.         SETREG  CRTC_INDEX, CRTC_OFFSET
  233. ;
  234. ; Move the balls by erasing each ball, moving it, and
  235. ; redrawing it, then switching pages when they're all moved.
  236. ;
  237. BallAnimationLoop:
  238.         mov     bx,( NUM_BALLS * 2 ) - 2
  239. EachBallLoop:
  240. ;
  241. ; Erase old image of ball in this page (at location from one more
  242. ; earlier).
  243. ;
  244.         mov     si,BLANK_OFFSET ;point to blank image
  245.         mov     cx,[LastBallX+bx]
  246.         mov     dx,[LastBallY+bx]
  247.         call    DrawBall
  248. ;
  249. ; Set new last ball location.
  250. ;
  251.         mov     ax,[BallX+bx]
  252.         mov     [LastballX+bx],ax
  253.         mov     ax,[BallY+bx]
  254.         mov     [LastballY+bx],ax
  255. ;
  256. ; Change the ball movement values if it's time to do so.
  257. ;
  258.         dec     [BallRep+bx]            ;has current repeat factor
  259.                                         ; run out?
  260.         jnz     MoveBall
  261.         mov     si,[BallControl+bx]     ;it's time to change movement
  262.                                         ; values
  263.         lodsw                           ;get new repeat factor from
  264.                                         ; control string
  265.         and     ax,ax                   ;at end of control string?
  266.         jnz     SetNewMove
  267.         mov     si,[BallControlString+bx]       ;reset control string
  268.         lodsw                           ;get new repeat factor
  269. SetNewMove:
  270.         mov     [BallRep+bx],ax         ;set new movement repeat factor
  271.         lodsw                           ;set new x movement increment
  272.         mov     [BallXInc+bx],ax
  273.         lodsw                           ;set new y movement increment
  274.         mov     [BallYInc+bx],ax
  275.         mov     [BallControl+bx],si     ;save new control string pointer
  276. ;
  277. ; Move the ball.
  278. ;
  279. MoveBall:
  280.         mov     ax,[BallXInc+bx]
  281.         add     [BallX+bx],ax           ;move in x direction
  282.         mov     ax,[BallYInc+bx]
  283.         add     [BallY+bx],ax           ;move in y direction
  284. ;
  285. ; Draw ball at new location.
  286. ;
  287.         mov     si,BALL_OFFSET  ;point to ball's image
  288.         mov     cx,[BallX+bx]
  289.         mov     dx,[BallY+bx]
  290.         call    DrawBall
  291. ;
  292.         dec     bx
  293.         dec     bx
  294.         jns     EachBallLoop
  295. ;
  296. ; Pan and flip displayed page to the one we've been working on, as soon
  297. ; as leading edge of vertical sync comes around.
  298. ;
  299.         call    WaitVSync
  300. ;
  301. ; Perform whatever panning's in effect.
  302. ;
  303.         call    AdjustPanning
  304. ;
  305. ; Flip to new page by changing start address.
  306. ;
  307.         mov     ax,[CurrentPageOffset]
  308.         add     ax,[PanningStartOffset]
  309.         push    ax
  310.         SETREG  CRTC_INDEX, START_ADDRESS_LOW
  311.         pop     ax
  312.         mov     al,ah
  313.         SETREG  CRTC_INDEX, START_ADDRESS_HIGH
  314. ;
  315. ; Wait for sync again so the new start address has a chance
  316. ; to take effect.
  317. ;
  318.         call    WaitVSync
  319. ;
  320. ; Set horizontal panning now, just as new start address takes effect.
  321. ;
  322.         mov     al,[HPan]
  323.         mov     dx,STATUS_REGISTER_1
  324.         in      al,dx                   ;reset AC addressing to index reg
  325.         mov     dx,AC_INDEX             ;note from 1989: word OUTs to the
  326.         mov     al,HPELPAN              ; AC index and data registers
  327.         out     dx,al                   ; don't work properly on VGAs,
  328.         mov     al,[HPan]               ; so two byte OUTs are used here
  329.         out     dx,al
  330. ;
  331. ; Flip the page to draw to the undisplayed page.
  332. ;
  333.         xor     [CurrentPage],1
  334.         jnz     IsPage1
  335.         mov     [CurrentPageOffset],PAGE0_OFFSET
  336.         jmp     short EndFlipPage
  337. IsPage1:
  338.         mov     [CurrentPageOffset],PAGE1_OFFSET
  339. EndFlipPage:
  340. ;
  341. ; Exit if a key's been hit.
  342. ;
  343.         mov     ah,1
  344.         int     16h
  345.         jnz     Done
  346.         jmp     BallAnimationLoop
  347. ;
  348. ; Finished, clear key, reset screen mode and exit.
  349. ;
  350. Done:
  351.         mov     ah,0    ;clear key
  352.         int     16h
  353. ;
  354.         mov     ax,3    ;reset to text mode
  355.         int     10h
  356. ;
  357.         mov     ah,4ch  ;exit to DOS
  358.         int     21h
  359. ;
  360. start   endp
  361. ;
  362. ; Routine to draw a ball-sized image to all planes, copying from
  363. ; offset SI in EGA memory to offset CX,DX (x,y) in EGA memory in
  364. ; the current page.
  365. ;
  366. DrawBall        proc    near
  367.         mov     ax,LOGICAL_SCREEN_WIDTH
  368.         mul     dx      ;offset of start of top image scan line
  369.         add     ax,cx   ;offset of upper left of image
  370.         add     ax,[CurrentPageOffset]  ;offset of start of page
  371.         mov     di,ax
  372.         mov     bp,BALL_HEIGHT
  373.         push    ds
  374.         push    es
  375.         pop     ds      ;move from EGA memory to EGA memory
  376. DrawBallLoop:
  377.         push    di
  378.         mov     cx,BALL_WIDTH
  379.         rep movsb       ;draw a scan line of image
  380.         pop     di
  381.         add     di,LOGICAL_SCREEN_WIDTH ;point to next destination
  382.                                         ; scan line
  383.         dec     bp
  384.         jnz     DrawBallLoop
  385.         pop     ds
  386.         ret
  387. DrawBall        endp
  388. ;
  389. ; Wait for the leading edge of vertical sync pulse.
  390. ;
  391. WaitVSync       proc    near
  392.         mov     dx,STATUS_REGISTER_1
  393. WaitNotVSyncLoop:
  394.         in      al,dx
  395.         and     al,VSYNC_MASK
  396.         jnz     WaitNotVSyncLoop
  397. WaitVSyncLoop:
  398.         in      al,dx
  399.         and     al,VSYNC_MASK
  400.         jz      WaitVSyncLoop
  401.         ret
  402. WaitVSync       endp
  403. ;
  404. ; Perform horizontal/vertical panning.
  405. ;
  406. AdjustPanning   proc    near
  407.         dec     [PanningRep]    ;time to get new panning values?
  408.         jnz     DoPan
  409.         mov     si,[PanningControl]     ;point to current location in
  410.                                         ; panning control string
  411.         lodsw                           ;get panning repeat factor
  412.         and     ax,ax                   ;at end of panning control string?
  413.         jnz     SetnewPanValues
  414.         mov     si,offset PanningControlString  ;reset to start of string
  415.         lodsw                           ;get panning repeat factor
  416. SetNewPanValues:
  417.         mov     [PanningRep],ax         ;set new panning repeat value
  418.         lodsw
  419.         mov     [PanningXInc],ax        ;horizontal panning value
  420.         lodsw
  421.         mov     [PanningYInc],ax        ;vertical panning value
  422.         mov     [PanningControl],si     ;save current location in panning
  423.                                         ; control string
  424. ;
  425. ; Pan according to panning values.
  426. ;
  427. DoPan:
  428.         mov     ax,[PanningXInc]        ;horizontal panning
  429.         and     ax,ax
  430.         js      PanLeft                 ;negative means pan left
  431.         jz      CheckVerticalPan
  432.         mov     al,[HPan]
  433.         inc     al                      ;pan right; if pel pan reaches
  434.         cmp     al,8                    ; 8, it's time to move to the
  435.         jb      SetHPan                 ; next byte with a pel pan of 0
  436.         sub     al,al                   ; and a start offset that's one
  437.         inc     [PanningStartOffset]    ; higher
  438.         jmp     short SetHPan
  439. PanLeft:
  440.         mov     al,[HPan]
  441.         dec     al                      ;pan left; if pel pan reaches -1,
  442.         jns     SetHPan                 ; it's time to move to the next
  443.         mov     al,7                    ; byte with a pel pan of 7 and a
  444.         dec     [PanningStartOffset]    ; start offset that's one lower
  445. SetHPan:
  446.         mov     [HPan],al               ;save new pel pan value
  447. CheckVerticalPan:
  448.         mov     ax,[PanningYInc]        ;vertical panning
  449.         and     ax,ax
  450.         js      PanUp                   ;negative means pan up
  451.         jz      EndPan
  452.         add     [PanningStartOffset],LOGICAL_SCREEN_WIDTH
  453.                                         ;pan down by advancing the start
  454.                                         ; address by a scan line
  455.         jmp     short EndPan
  456. PanUp:
  457.         sub     [PanningStartOffset],LOGICAL_SCREEN_WIDTH
  458.                                         ;pan up by retarding the start
  459.                                         ; address by a scan line
  460. EndPan:
  461.         ret
  462. ;
  463. ; Draw textured border around playfield that starts at DI.
  464. ;
  465. DrawBorder      proc    near
  466. ;
  467. ; Draw the left border.
  468. ;
  469.         push    di
  470.         mov     cx,LOGICAL_SCREEN_HEIGHT / 16
  471. DrawLeftBorderLoop:
  472.         mov     al,0ch          ;select red color for block
  473.         call    DrawBorderBlock
  474.         add     di,LOGICAL_SCREEN_WIDTH * 8
  475.         mov     al,0eh          ;select yellow color for block
  476.         call    DrawBorderBlock
  477.         add     di,LOGICAL_SCREEN_WIDTH * 8
  478.         loop    DrawLeftBorderLoop
  479.         pop     di
  480. ;
  481. ; Draw the left border.
  482. ;
  483.         push    di
  484.         add     di,LOGICAL_SCREEN_WIDTH - 1
  485.         mov     cx,LOGICAL_SCREEN_HEIGHT / 16
  486. DrawRightBorderLoop:
  487.         mov     al,0eh          ;select yellow color for block
  488.         call    DrawBorderBlock
  489.         add     di,LOGICAL_SCREEN_WIDTH * 8
  490.         mov     al,0ch          ;select red color for block
  491.         call    DrawBorderBlock
  492.         add     di,LOGICAL_SCREEN_WIDTH * 8
  493.         loop    DrawRightBorderLoop
  494.         pop     di
  495. ;
  496. ; Draw the top border.
  497. ;
  498.         push    di
  499.         mov     cx,(LOGICAL_SCREEN_WIDTH - 2) / 2
  500. DrawTopBorderLoop:
  501.         inc     di
  502.         mov     al,0eh          ;select yellow color for block
  503.         call    DrawBorderBlock
  504.         inc     di
  505.         mov     al,0ch          ;select red color for block
  506.         call    DrawBorderBlock
  507.         loop    DrawTopBorderLoop
  508.         pop     di
  509. ;
  510. ; Draw the bottom border.
  511. ;
  512.         add     di,(LOGICAL_SCREEN_HEIGHT - 8) * LOGICAL_SCREEN_WIDTH
  513.         mov     cx,(LOGICAL_SCREEN_WIDTH - 2) / 2
  514. DrawBottomBorderLoop:
  515.         inc     di
  516.         mov     al,0ch          ;select red color for block
  517.         call    DrawBorderBlock
  518.         inc     di
  519.         mov     al,0eh          ;select yellow color for block
  520.         call    DrawBorderBlock
  521.         loop    DrawBottomBorderLoop
  522.         ret
  523. DrawBorder      endp
  524. ;
  525. ; Draws an 8x8 border block in color in AL at location DI.
  526. ; DI preserved.
  527. ;
  528. DrawBorderBlock proc    near
  529.         push    di
  530.         SETREG  SC_INDEX, MAP_MASK
  531.         mov     al,0ffh
  532.         rept 8
  533.         stosb
  534.         add     di,LOGICAL_SCREEN_WIDTH - 1
  535.         endm
  536.         pop     di
  537.         ret
  538. DrawBorderBlock endp
  539. AdjustPanning   endp
  540. cseg    ends
  541.         end     start