home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / CASM1.ZIP / CASM1.LBR / DISPIO.H < prev    next >
Text File  |  1989-03-19  |  2KB  |  46 lines

  1.  
  2. /*                        Listing 4
  3.                     C to Assembly Interface
  4.       Computer Language, Vol. 2, No. 2 (February, 1985), pp. 49-59
  5.                          Include file
  6. */
  7. /* See IBM Personal Computer Reference Manual.
  8.    For August, 1981 edition, pp. 43-45.
  9.    For April, 1983 edition, pp. 45-47. */
  10. #define PAGE 0
  11. #define PAGE_1 1
  12.  /* video modes */
  13. #define s40x25_bw 0
  14. #define s40x25_color 1
  15. #define s80x25_bw 2
  16. #define s80x25_color 3
  17. #define med_color 4
  18. #define med_bw 5
  19. #define high_bw 6
  20. #define mono 7       /*L.P.*/
  21.  /* video functions */
  22. #define set_type 256                  /* AH = 1, AL = 0 */
  23. #define set_cur 512                   /* AH = 2, AL = 0 */
  24. #define read_position 768             /* AH = 3, AL = 0 */
  25. #define read_light_pen_position 1024  /* AH = 4, AL = 0 */
  26. #define select_page 1280              /* AH = 5, AL = 0 */
  27. #define scroll_up 1536                /* AH = 6, AL = 0 */
  28. #define scroll_dn 1792                /* AH = 7, AL = 0 */
  29. #define read_attribute_char 2048      /* AH = 8, AL = 0 */
  30. #define write_attribute_char 2304     /* AH = 9, AL = 0 */
  31. #define write_char 2560               /* AH = 10, AL = 0 */
  32. #define set_palette 2816              /* AH = 11, AL = 0 */
  33. #define write_dot 3072                /* AH = 12, AL = 0 */
  34. #define read_dot 3328                 /* AH = 13, AL = 0 */
  35. #define write_teletype 3584           /* AH = 14, AL = 0 */
  36. #define get_state 3840                /* AH = 15, 1L = 0 */
  37.  /* macros */
  38. #define curpos(row,col) dispio(set_cur,PAGE,(((int)row)<<8)+col)
  39. #define SET_MODE dispio(s80x25_bw)
  40. #define horline(ch,width) dispio(write_char+ch,PAGE,width) 
  41. #define hline(row,col,ch,width) curpos(row,col) ; horline(ch,width)
  42. #define wrtchar(ch) dispio(write_char+ch,PAGE,1)
  43. #define horline_1(ch,width) dispio(write_char+ch,PAGE_1,width) 
  44. #define hline_1(row,col,ch,width) curpos(row,col) ; horline(ch,width)
  45. #define wrtchar_1(ch) dispio(write_char+ch,PAGE_1,1)
  46.