home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 January (DVD) / VPR980100.ISO / DRIVER / IBM / VW200 / VW200_2.EXE / VWSAMPLE / VW200DEF.INC < prev    next >
Text File  |  1995-11-01  |  10KB  |  207 lines

  1. ifndef  VW200DEF_INC
  2. define  VW200DEF_INC
  3.  
  4. ;
  5. ; Work area
  6. ;
  7. define  StartSRAM       0f000h                  ; local memory start
  8. define  EndSRAM         0f100h                  ; local memory end(+1)
  9. define  StartERAM       100000h                 ; extend memory start
  10. define  EndERAM         (StartERAM+20000h)      ; extend memory end(+1)
  11.  
  12. define  UserSERAM       (StartERAM+210h)        ; user vector start
  13. define  UserEERAM       (StartERAM+300h)        ; user vector end(+1)
  14.  
  15. define  SysWork         StartSRAM               ; system work start
  16. define  HardConf        0ff00h                  ; I/O memory start
  17.  
  18. define  UserApp1        UserSERAM               ; User application vector 1
  19. define  UserApp2        (UserApp1+4)            ;            "            2
  20. define  UserApp3        (UserApp2+4)            ;            "            3
  21. define  UserApp4        (UserApp3+4)            ;            "            4
  22.  
  23. define  UserInt1        (UserSERAM+10h)         ; User interrupt vector 1
  24. define  UserInt2        (UserInt1+4)            ;           "           2
  25. define  UserInt3        (UserInt2+4)            ;           "           3
  26. define  UserInt4        (UserInt3+4)            ;           "           4
  27.  
  28.                                                 ; User application information 1
  29. define  UserName1       (UserSERAM+20h)         ;       program name
  30. define  UserCSize1      (UserName1+8)           ;       program code size
  31. define  UserWAddr1      (UserCSize1+4)          ;       work data address
  32. define  UserWSize1      (UserWAddr1+4)          ;       work data size
  33. define  UserAAddr1      (UserWSize1+4)          ;       actual data address
  34. define  UserASize1      (UserAAddr1+4)          ;       actual data size
  35. define  UserReserved1   (UserASize1+4)          ;       reserved
  36.  
  37.                                                 ; User application information 2
  38. define  UserName2       (UserSERAM+40h)         ;       program name
  39. define  UserCSize2      (UserName2+8)           ;       program code size
  40. define  UserWAddr2      (UserCSize2+4)          ;       work data address
  41. define  UserWSize2      (UserWAddr2+4)          ;       work data size
  42. define  UserAAddr2      (UserWSize2+4)          ;       actual data address
  43. define  UserASize2      (UserAAddr2+4)          ;       actual data size
  44. define  UserReserved2   (UserASize2+4)          ;       reserved
  45.  
  46.                                                 ; User application information 3
  47. define  UserName3       (UserSERAM+60h)         ;       program name
  48. define  UserCSize3      (UserName3+8)           ;       program code size
  49. define  UserWAddr3      (UserCSize3+4)          ;       work data address
  50. define  UserWSize3      (UserWAddr3+4)          ;       work data size
  51. define  UserAAddr3      (UserWSize3+4)          ;       actual data address
  52. define  UserASize3      (UserAAddr3+4)          ;       actual data size
  53. define  UserReserved3   (UserASize3+4)          ;       reserved
  54.  
  55.                                                 ; User application information 4
  56. define  UserName4       (UserSERAM+80h)         ;       program name
  57. define  UserCSize4      (UserName4+8)           ;       program code size
  58. define  UserWAddr4      (UserCSize4+4)          ;       work data address
  59. define  UserWSize4      (UserWAddr4+4)          ;       work data size
  60. define  UserAAddr4      (UserWSize4+4)          ;       actual data address
  61. define  UserASize4      (UserAAddr4+4)          ;       actual data size
  62. define  UserReserved4   (UserASize4+4)          ;       reserved
  63.  
  64. define  UserEnh1        (UserSERAM+0a0h)        ; User enhance vector 1
  65. define  UserEnh2        (UserEnh1+4)            ;          "          2
  66. define  UserEnh3        (UserEnh2+4)            ;          "          3
  67. define  UserEnh4        (UserEnh3+4)            ;          "          4
  68.  
  69.                                                 ; screen work(TC-100 compatible mode)
  70. define  TC_Buffer       (StartERAM+300h)        ; initial display area
  71. define  TC_XSize        12                      ; screen width
  72. define  TC_MaxXSize     24                      ; virtual-screen width
  73. define  TC_YSize        3                       ; screen column
  74. define  TC_MaxYSize     5                       ; virtual-screen column
  75. define  TC_CharWidth    6                       ; character width
  76.  
  77.                                                 ; screen work(VW-200 mode)
  78. define  VW_Buffer       (EndERAM-0c00h)         ; virtual-screen buffer area
  79. define  VW_Attribute    (VW_Buffer+200h)        ; virtual-screen attribute area
  80. define  VW_V_XSize      24                      ; screen width(vertical/no line space)
  81. define  VW_V_YSize      20                      ; screen column(vertical/no line space)
  82. define  VW_VL_YSize     17                      ; screen column(vertical/line space)
  83. define  VW_H_XSize      40                      ; screen width(horizontal/no line space)
  84. define  VW_H_YSize      12                      ; screen column(horizontal/no line space)
  85. define  VW_HL_YSize     10                      ; screen column(horizontal/line space)
  86. define  VW_CharWidth    8                       ; character width(SBCS)
  87. define  VW_KanjiWidth   16                      ; character width(DBCS)
  88. define  VW_CharColumn   16                      ; character column(SBCS/DBCS no line-space)
  89. define  VW_CharColumnL  18                      ; character column(SBCS/DBCS line-space)
  90.  
  91. ;
  92. ; SC Bit assign
  93. ;
  94. define  zero            01h                     ; zero
  95. define  carry           02h                     ; carry
  96. define  overflow        04h                     ; overflow
  97. define  negative        08h                     ; negative
  98. define  decimal         10h                     ; decimal
  99. define  unpack          20h                     ; unpack
  100. define  intlevel0       00h                     ; I0,1  level0
  101. define  intlevel1       40h                     ;       level1
  102. define  intlevel2       80h                     ;       level2
  103. define  intlevel3       0c0h                    ;       level3(NMI only)
  104.  
  105. ;
  106. ; System mode
  107. ;
  108. define  SYS_POWER       80h                     ; power         1=ON            0=OFF
  109. define  SYS_SAVE        40h                     ; power save    1=POWER SAVE    0=NORMAL
  110. define  SYS_LCDSTOP     20h                     ; LCD update    1=NO REFRESH    0=NORMAL
  111. define  SYS_LCDSTOPU    10h                     ;  " for user   1=NO REFRESH    0=NORMAL
  112. define  SYS_SAVELOCK    0fh                     ; power save lock(nesting level 15)
  113.  
  114. ;
  115. ; I/O mode
  116. ;
  117. define  IOM_DBLWID      80h                     ; wide screen   1=24x5          0=12x3
  118. define  IOM_CSRSTP      80h                     ; cursor stop   1=STOP          0=NORMAL
  119. define  IOM_CSRUSE      40h                     ; cursor        1=ON            0=OFF
  120. define  IOM_CSRREV      20h                     ; cursor mode   1=REVERSE       0=NORMAL
  121.  
  122. define  IOM_REPEAT      02h                     ; repeat mode   1=REPEAT        0=SINGLE
  123. define  IOM_INSERT      01h                     ; insert mode   1=INSERT        0=NORMAL
  124.  
  125. define  IOM_TC100       00h                     ; TC-100 compatible screen (default)
  126. define  IOM_VW200       10h                     ; VW-200 mode    -+
  127. define  IOM_VW200V      00h                     ; vertical        |
  128. define  IOM_VW200H      08h                     ; horizontal      +- or selection
  129. define  IOM_VW200B      00h                     ; no line space   |
  130. define  IOM_VW200L      04h                     ; line space     -+
  131.  
  132. ;
  133. ; LCD hardware define
  134. ;
  135. define  LCDRAM1         080000h                 ; VRAM1 address 1
  136. define  LCDRAM2         080100h                 ; VRAM2 address 2
  137. define  LCDPage1        0a0000h                 ; Page register 1
  138. define  LCDPage2        0a0001h                 ; Page register 2
  139. define  LCDDirPort      0a0002h                 ; LCD direction control
  140.  
  141. define  LCDDirBit       80h                     ; LCD direction flag
  142. define  LCDPowerPort    (HardConf+76h)          ; LCD power control port (R37)
  143. define  LCDPowerBit     80h                     ; LCD power control bit  (R37)
  144.  
  145. ;
  146. ; key hardware define
  147. ;
  148. define  KeyData         (HardConf+54h)          ; port key-data
  149. define  KeyStrobe       (HardConf+75h)          ; port key-strobe
  150. define  KeyLStrobe      20h                     ;   key-strobe  (low 8key:R25)
  151. define  KeyMStrobe      40h                     ;       "       (middle 8key:R26)
  152. define  KeyHStrobe      80h                     ;       "       (high 8key:R27)
  153.  
  154. ;
  155. ; clock define
  156. ;
  157. define  CLK_SETUP       40h                     ; time ready flag
  158. define  CLK_12H         80h                     ; 12/24 select  (ON=12hour)
  159.  
  160. ;
  161. ; System mode (for VW-200)
  162. ;
  163. define  VSM_SILENT      80h                     ; silent mode   ON=SILENT       OFF=NORMAL
  164. define  VSM_CLICK       01h                     ; key click     ON=CLICK USE    OFF=NO CLICK
  165.  
  166. ;
  167. ; Alarm flag
  168. ;
  169. define  ALM_USE         80h                     ; alarm use     ON=VALID        OFF=INVALID
  170. define  ALM_OVER        40h                     ; alarm over    ON=OVER         OFF=NORMAL
  171. define  ALM_SET         01h                     ; alarm set     ON=SET          OFF=RESET
  172.  
  173. ;
  174. ; macro define
  175. ;
  176. EOI     macro   add,flg                         ; EOI   End Of Interrupt
  177.         ld      br,#high HardConf
  178.         ld      [br:low add],flg
  179.         endm
  180.  
  181. DI      macro                                   ; DI    Disable Interrupt
  182.         push    sc
  183.         or      sc,#intlevel3
  184.         endm
  185.  
  186. EI      macro                                   ; EI    Enable Interrupt
  187.         pop     sc
  188.         endm
  189.  
  190. CarryOn macro                                   ; carry-flag set
  191.         or      sc,#carry
  192.         endm
  193.  
  194. CarryOff        macro                           ; carry-flag reset
  195.         and     sc,#~carry
  196.         endm
  197.  
  198. Zero    macro                                   ; zero-flag set
  199.         or      sc,#zero
  200.         endm
  201.  
  202. NoneZero        macro                           ; zero-flag reset
  203.         and     sc,#~zero
  204.         endm
  205.  
  206. endif   ;VW200DEF_INC
  207.