title box.asm ; basically exercises solid_box procedure from prog085.asm ; uses graphics mode 12h .model small if1 include ..\..\mac\basic.mac endif .data xx0 dw 160 yy0 dw 100 xx1 dw 220 yy1 dw 130 ccolor dw 2 xxx0 dw 180 yyy0 dw 115 xxx1 dw 240 yyy1 dw 145 cccolor dw 4 .code main proc initdata ; macro ; mov ah,0 ; set screen mode mov al,12h ; mode 12h int 10h ; save call _solid_box restore save call _solid_box restore pause "terminate?" ; restore mode mov ah,0 mov al,3 int 10h ; exitdos main endp ;************************************************************************ ; solid_box(x0,y0,x1,y1,color) fill a rectangle defined by * ; upper-left 'x0,y0', and lower-right 'x1,y1' * ; with the specified color 'Color'. * ; Each pixel on the display corresponds to one bit in memory. * ; Thus one byte represents 8 different pixles. * ; A rectangle, in general, will consist of three vertical * ; strips. The midle strip will be composed entirely from pixels * ; forming a complete byte. The left strip has pixels only in * ; last few bits of a byte, and right strip only in first few bits * ; This routine will draw each strip in a separate loop. * ;************************************************************************ x0 EQU [BP+4] y0 EQU [BP+6] x1 EQU [BP+8] y1 EQU [BP+10] Color EQU [BP+12] ; PUBLIC _Solid_Box _Solid_Box PROC NEAR PUSH BP MOV BP,SP PUSH DI ;Preserve segment registers PUSH SI PUSH DS PUSH ES ;--- Rearrange corners so that x0