home *** CD-ROM | disk | FTP | other *** search
- ;--------------------------------------------------------------------
- ; Author : Kevin Dahl :
- ; Last Revised : June 7, 1986 :
- ; :
- ; FILENAME - V6.ENH :
- ; :
- ; FILLROW :
- ; This routine displays one or more copies of a single :
- ; character to the screen. :
- ; ENTRY :
- ; [bp+6] = Character to be displayed :
- ; [bp+8] = Number of times the character is to be displayed :
- ; on the screen. :
- ; [bp+10] = Row the character is to be displayed in. :
- ; [bp+12] = Column the character is to start in. :
- ; :
- ; EXIT :
- ; Nothing is returned :
- ;--------------------------------------------------------------------
- fillrow 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 v22
- cmp al,3 ; check if text modes
- ja v26 ; graphics mode - no write
- mov cx,7 ; set for 40 col text modes
- cmp dl,80 ; check for num of cols
- jb v21 ; 40 cols if jmp
- inc cx ; if get here then 80 cols
- v21:
- 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 v23
- v22:
- mov ax,0B000h ; monochrome monitor address
- v23:
- mov es,ax ; video address into es
- mov ax,[bp+10] ; row coordinate
- mov bx,[bp+12] ; col coordinate
- 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
- mov cx,[bp+8] ; number of times to display character
- cmp cx,1
- jb v26 ; no characters to display
- mov ah,[bp+6] ; character byte into ah
- mov dx,03DAh ; status port
- cld ; clear direction flag
- cli ; clear interrupts
- v24:
- in al,dx ; get status
- test al,1 ; is it low?
- jnz v24 ; wait until it is
- v25:
- in al,dx ; get status
- test al,1 ; is it high?
- jz v25 ; wait until it is
- mov es:byte ptr[di],ah ; display character byte
- add di,2 ; skip to next char position
- loop v24 ; repeat until column is filled
- sti ; turn interrupts back on
- v26:
- mov sp,bp ; restore stack
- pop bp ; restore base pointer
- pop ds ; restore data segment
- ret 8 ; remove parameters and return
- fillrow endp