home *** CD-ROM | disk | FTP | other *** search
- ;--------------------------------------------------------------------
- ; Author : Kevin Dahl :
- ; Last Revised : June 7, 1986 :
- ; :
- ; FILENAME - V4.ENH :
- ; :
- ; FILLCOL :
- ; This routine displays a column of the character passed. :
- ; ENTRY :
- ; [bp+6] = Character to be displayed in the column :
- ; [bp+8] = Number of rows to be used for displaying the :
- ; character in the column specified :
- ; [bp+10] = Row the column of the character is to start in :
- ; [bp+12] = Column the character is to be displayed in :
- ; :
- ; EXIT :
- ; Nothing is returned :
- ;--------------------------------------------------------------------
- fillcol proc near
- push ds
- push bp ; save stack
- mov bp,sp
- mov ah,0fh ; get current video mode
- int 10h ; using BIOS services
- xor dx,dx
- mov dl,ah ; save number columns per line
- cmp al,7 ; check for monochrome monitor
- je v10
- cmp al,3 ; check if text modes
- ja v14 ; graphics mode - no write
- mov cx,7 ; set for 40 col text modes
- cmp dl,80 ; check for num of cols
- jb v9 ; 40 cols if jmp
- inc cx ; if get here then 80 cols
- v9:
- xor ax,ax ; zero out ax
- mov al,bh ; active display page for CGA
- shl ax,cl ; calc address for display page
- mov cx,0B800h ; address for CGA
- add ax,cx ; calc starting address
- jmp v11
- v10:
- mov ax,0B000h ; monochrome monitor address
- v11:
- mov es,ax ; video address into es
- mov ax,[bp+10] ; row coordinate
- mov bx,[bp+12] ; col coordinate
- push dx ; save number cols per line
- dec ax ; (row - 1)
- mul dx ; (row - 1) * number of columns
- add ax,bx ; (row - 1) * # cols + col offset
- dec ax ; (row - 1) * # cols + col offset - 1
- shl ax,1 ; ((row-1)* #cols + col offset - 1)*2
- mov di,ax ; offset in display scrn for string
- pop bx ; # cols per screen
- shl bx,1 ; cols on display
- mov cx,[bp+8] ; number of rows to use
- cmp cx,1
- jb v14 ; no characters to display
- mov ah,[bp+6] ; character byte into ah
- mov dx,03DAh ; status port
- cld ; clear direction flag
- cli ; clear interrupts
- v12:
- in al,dx ; get status
- test al,1 ; is it low?
- jnz v12 ; wait until it is
- v13:
- in al,dx ; get status
- test al,1 ; is it high?
- jz v13 ; wait until it is
- mov es:byte ptr[di],ah ; display character byte
- add di,bx ; next row address
- loop v12 ; repeat until column is filled
- sti ; turn interrupts back on
- v14:
- mov sp,bp ; restore stack
- pop bp ; restore base pointer
- pop ds ; restore data segment
- ret 8 ; remove parameters and return
- fillcol endp