home *** CD-ROM | disk | FTP | other *** search
- page 58,132
-
- ; vchar.asm
- ; contains: rdvch(),wtvch(),pch(),cpch(),wtvchar(),wttty(),_wcvchr(),border()
- ;
-
- include model.h
- include prologue.h
- name vchar
- pseg rdvch
-
- ;==>-- void border(color)
- ;
- ;; ARGUMENTS:
- ; (int) color - Color for border (0..15)
- ;
- ;; DESCRIPTION:
- ; This function calls the ROM-BIOS to set the value for the border
- ; color.
- ;
- ;; AUTHOR:
- ; "" 22-APR-1987 11:05:51.65
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc border
- mov ah,11
- xor bh,bh ;I.D. = 0
- mov bl,parm1_ ;bl=value
- int 10h
- cproce
-
- ;==>-- unsigned rdvch(page)
- ;
- ;; ARGUMENTS:
- ; (int) page - Video page to read
- ;
- ;; DESCRIPTION:
- ; Read attribute and character at current cursor position
- ; via Rom-Bios
- ;
- ;; RETURNS:
- ; low byte = character, high byte = attribute
- ;
- ;; AUTHOR:
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc rdvch,
- mov bh,parm1_
- mov ah,8 ; function 8 in AH
- int 10h
- cproce
-
- ;==>-- void wtvch(character,attribute,page,count)
- ;
- ;; ARGUMENTS:
- ; (char) character - character to write
- ; (int) attribute - attribute to write
- ; (int) page - page to write on
- ; (int) count - count of characters to write
- ;
- ;; DESCRIPTION:
- ; Write video character(s) and attribute(s) starting at current
- ; cursor position.
- ;
- ;; AUTHOR:
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc wtvch
- mov al,parm1_ ;al=character
- mov bl,parm2_ ;bl=attribute
- mov bh,parm3_ ;bh=display page
- mov cx,parm4_ ;cx=count
- mov ah,9 ;function 9
- int 10h
- cproce
-
- ;==>-- void pch(character,attribute,page)
- ;
- ;; ARGUMENTS:
- ; (char) character - character to write
- ; (int) attribute - attribute to write
- ; (int) page - video page to write on
- ;
- ;; DESCRIPTION:
- ; Put character and attribute on display at current cursor
- ; position.
- ;
- ;; AUTHOR:
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc pch
- mov al,parm1_ ;al=character
- mov bl,parm2_ ;bl=attribute
- mov bh,parm3_ ;bh=display page
- mov cx,1 ;cx=count
- mov ah,9 ;function 9
- int 10h
- cproce
-
- ;==>-- void cpch(character,foreground,background,page)
- ;
- ;; ARGUMENTS:
- ; (char) character - character to write
- ; (int) foreground - foreground color to write
- ; (int) background - background color to write
- ; (int) page - video page to use
- ;
- ;; DESCRIPTION:
- ; Put character/attribute at current cursor, selected video page
- ;
- ;; AUTHOR:
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc cpch
- mov bl,parm3_ ;bl=background
- shl bl,1 ;shift to high order 4 bits
- shl bl,1
- shl bl,1
- shl bl,1
- or bl,parm2_ ;bl=background/foreground
- mov bh,parm4_ ;page to BH
- mov cx,1 ; Count is 1..
- mov al,parm1_ ;al=the character to write
- mov ah,9 ; function 9
- int 10h
- cproce
-
- ;==>-- void wtvchar(character,page,count)
- ;
- ;; ARGUMENTS:
- ; (char) character - character to write
- ; (int) page - page to write on
- ; (int) count - count of characters to write
- ;
- ;; DESCRIPTION:
- ; Write video character(s) starting at current cursor position.
- ;
- ;; AUTHOR:
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc wtvchar
- mov al,parm1_ ;al=character
- mov bh,parm2_ ;bh=display page
- mov cx,parm3_ ;cx=count
- mov ah,10 ;function to AH
- int 10h ;rom bios video int.
- cproce
-
- ;==>-- void wttty(character,color)
- ;
- ;; ARGUMENTS:
- ; (char) character - character to write
- ; (int) color - color to write
- ;
- ;; DESCRIPTION:
- ; Write teletype using Rom-Bios interrupt 0x10 function 14 to
- ; current video page.
- ;
- ;; AUTHOR:
- ; Copyright (C)1987-1989 Greenleaf Software Inc.
- ;;;
- cproc wttty
- mov al,parm1_
- mov bl,parm2_
- mov ah,14 ;function 14
- int 10h
- cproce
-
- ;==>-- void _wcvchr(character,count)
- ;
- ;; ARGUMENTS:
- ; (char) character - character to write
- ; (int) count - count of characters to write
- ;
- ;; DESCRIPTION:
- ; Write video character(s) starting at current cursor position.
- ; to active video page.
- ;
- ;; AUTHOR:
- ; "" 10-APR-1987 11:39:16.12
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc _wcvchr
- push bp
- mov ah,15
- int 10h ;get current active page to BH
- pop bp
- mov al,parm1_ ;al=character
- mov cx,parm2_ ;cx=count
- mov ah,10 ;function to AH
- int 10h ;rom bios video int.
- cproce
- endps
- end
-