home *** CD-ROM | disk | FTP | other *** search
- ; Fast Write with attribute By: Miles Levy 8/89
- ; called: MLFWA (X, Y, A, String)
- ; X=Row, Y=Column, A=Attribute
- ; 1..80, 1..25
- ;
- ; Procedure MLFWA (x,y,a : Integer; strng : String);
- ;
- code segment byte public
- assume cs:code,ds:code
- public mlfwa
- ;
- strng equ dword ptr [bp+6]
- attr equ byte ptr [bp+10]
- y equ word ptr [bp+12]
- x equ word ptr [bp+14]
-
- vid equ 0B800H
- ;
- mlfwa proc far
- ;
- start:
- push bp
- mov bp,sp
- push ds
-
- mov ax,vid
- mov es,ax
- cld
- lds si,strng ; DS:SI points to string[0]
- lodsb ; length to Al
- xor ah,ah
- mov cx,ax
- jcxz fini ; exit if empty string
- mov bx,y ; row (line number / 1 relative )
- dec bx ; 0 relative
- shl bx,1
- mov di,word ptr cs:rowvect[bx] ; line pointer
- mov bx,x
- dec bx ; column ( 0 relative )
- shl bx,1
- add di,bx ; di is tgt ptr
- mov ah,attr ; attribute ---> ah
- movelp:
- lodsb ; char ---> al
- stosw ; char/attr ---> video memory
- loop movelp
- ;
- fini:
- pop ds
- pop bp
- ret 8
-
- ; ---------------------------------------------------
-
- rowvect equ $
- ; Generate the row vectors
- adr = 0
- rept 25
- dw adr
- adr = adr+160
- endm
-
- mlfwa endp
-
- copywrt db 'Copyright 1989 Miles Levy'
-
-
- code ends
- end
-
-