home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-2.ZIP / GFUNC / VCHAR.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-05-30  |  4.4 KB  |  195 lines

  1.         page    58,132
  2.  
  3. ; vchar.asm
  4. ; contains: rdvch(),wtvch(),pch(),cpch(),wtvchar(),wttty(),_wcvchr(),border()
  5. ;
  6.  
  7.         include    model.h
  8.         include    prologue.h
  9.         name    vchar
  10.         pseg    rdvch
  11.  
  12. ;==>--    void border(color)
  13. ;
  14. ;;    ARGUMENTS:
  15. ;      (int)        color        -    Color for border (0..15)
  16. ;
  17. ;;    DESCRIPTION:
  18. ;      This function calls the ROM-BIOS to set the value for the border
  19. ;      color.
  20. ;
  21. ;;    AUTHOR:
  22. ;     ""   22-APR-1987  11:05:51.65
  23. ;      Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
  24. ;;;
  25.     cproc    border
  26.     mov    ah,11
  27.     xor    bh,bh            ;I.D. = 0
  28.     mov    bl,parm1_        ;bl=value
  29.     int    10h
  30.     cproce
  31.  
  32. ;==>--    unsigned rdvch(page)
  33. ;
  34. ;;    ARGUMENTS:
  35. ;     (int)    page    -    Video page to read
  36. ;
  37. ;;    DESCRIPTION:
  38. ;      Read attribute and character at current cursor position
  39. ;      via Rom-Bios
  40. ;
  41. ;;    RETURNS:
  42. ;      low byte = character, high byte = attribute
  43. ;
  44. ;;    AUTHOR:
  45. ;      Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
  46. ;;;
  47.     cproc    rdvch,
  48.     mov    bh,parm1_
  49.     mov    ah,8        ; function 8 in AH
  50.     int    10h
  51.     cproce
  52.  
  53. ;==>--    void wtvch(character,attribute,page,count)
  54. ;
  55. ;;    ARGUMENTS:
  56. ;      (char)    character    - character to write
  57. ;      (int)        attribute    - attribute to write
  58. ;      (int)        page        - page to write on
  59. ;      (int)        count        - count of characters to write
  60. ;
  61. ;;    DESCRIPTION:
  62. ;      Write video character(s) and attribute(s) starting at current
  63. ;      cursor position.
  64. ;
  65. ;;    AUTHOR:
  66. ;      Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
  67. ;;;
  68.     cproc    wtvch
  69.     mov    al,parm1_    ;al=character
  70.     mov    bl,parm2_    ;bl=attribute
  71.     mov    bh,parm3_    ;bh=display page
  72.     mov    cx,parm4_    ;cx=count
  73.     mov    ah,9        ;function 9
  74.     int    10h
  75.     cproce
  76.  
  77. ;==>--    void pch(character,attribute,page)
  78. ;
  79. ;;    ARGUMENTS:
  80. ;      (char)    character    -    character to write
  81. ;      (int)        attribute    -    attribute to write
  82. ;      (int)        page        -    video page to write on
  83. ;
  84. ;;    DESCRIPTION:
  85. ;      Put character and attribute on display at current cursor
  86. ;      position.
  87. ;
  88. ;;    AUTHOR:
  89. ;      Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
  90. ;;;
  91.     cproc    pch
  92.     mov    al,parm1_    ;al=character
  93.     mov    bl,parm2_    ;bl=attribute
  94.     mov    bh,parm3_    ;bh=display page
  95.     mov    cx,1        ;cx=count
  96.     mov    ah,9        ;function 9
  97.     int    10h
  98.     cproce
  99.  
  100. ;==>--    void cpch(character,foreground,background,page)
  101. ;
  102. ;;    ARGUMENTS:
  103. ;      (char)    character    -    character to write
  104. ;      (int)        foreground    -    foreground color to write
  105. ;      (int)        background    -    background color to write
  106. ;      (int)        page        -    video page to use
  107. ;
  108. ;;    DESCRIPTION:
  109. ;      Put character/attribute at current cursor, selected video page
  110. ;
  111. ;;    AUTHOR:
  112. ;      Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
  113. ;;;
  114.     cproc    cpch
  115.     mov    bl,parm3_    ;bl=background
  116.     shl    bl,1        ;shift to high order 4 bits
  117.     shl    bl,1
  118.     shl    bl,1
  119.     shl    bl,1
  120.     or    bl,parm2_    ;bl=background/foreground
  121.     mov    bh,parm4_    ;page to BH
  122.     mov    cx,1        ; Count is 1..
  123.     mov    al,parm1_    ;al=the character to write
  124.     mov    ah,9        ; function 9
  125.     int    10h
  126.     cproce
  127.  
  128. ;==>--    void wtvchar(character,page,count)
  129. ;
  130. ;;    ARGUMENTS:
  131. ;      (char)    character    - character to write
  132. ;      (int)        page        - page to write on
  133. ;      (int)        count        - count of characters to write
  134. ;
  135. ;;    DESCRIPTION:
  136. ;      Write video character(s) starting at current cursor position.
  137. ;
  138. ;;    AUTHOR:
  139. ;      Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
  140. ;;;
  141.     cproc    wtvchar
  142.     mov    al,parm1_    ;al=character
  143.     mov    bh,parm2_    ;bh=display page
  144.     mov    cx,parm3_    ;cx=count
  145.     mov    ah,10        ;function to AH
  146.     int    10h        ;rom bios video int.
  147.     cproce
  148.  
  149. ;==>--    void wttty(character,color)
  150. ;
  151. ;;    ARGUMENTS:
  152. ;     (char)        character    -    character to write
  153. ;     (int)        color        -    color to write
  154. ;
  155. ;;    DESCRIPTION:
  156. ;      Write teletype using Rom-Bios interrupt 0x10 function 14 to
  157. ;      current video page.
  158. ;
  159. ;;    AUTHOR:
  160. ;      Copyright (C)1987-1989 Greenleaf Software Inc.
  161. ;;;
  162.     cproc    wttty
  163.     mov    al,parm1_
  164.     mov    bl,parm2_
  165.     mov    ah,14        ;function 14
  166.     int    10h
  167.     cproce
  168.  
  169. ;==>--    void _wcvchr(character,count)
  170. ;
  171. ;;    ARGUMENTS:
  172. ;      (char)    character    - character to write
  173. ;      (int)        count        - count of characters to write
  174. ;
  175. ;;    DESCRIPTION:
  176. ;      Write video character(s) starting at current cursor position.
  177. ;      to active video page.
  178. ;
  179. ;;    AUTHOR:
  180. ;      ""   10-APR-1987  11:39:16.12
  181. ;       Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
  182. ;;;
  183.     cproc    _wcvchr
  184.     push    bp
  185.     mov    ah,15
  186.     int    10h        ;get current active page to BH
  187.     pop    bp
  188.     mov    al,parm1_    ;al=character
  189.     mov    cx,parm2_    ;cx=count
  190.     mov    ah,10        ;function to AH
  191.     int    10h        ;rom bios video int.
  192.     cproce
  193.     endps
  194.     end
  195.