home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / misc / equates.inc < prev    next >
Text File  |  1990-04-17  |  14KB  |  342 lines

  1.     .Xlist
  2.     Page    58,132
  3.     Subttl    EQUATES.INC    Apple Emulator (65C02 Processor)
  4. ;******************************************************************************
  5. ;
  6. ;   Name:    EQUATES     Apple Emulator (65C02 Processor)
  7. ;
  8. ;   Group:    Emulator
  9. ;
  10. ;   Revision:    1.00
  11. ;
  12. ;   Date:    January 30, 1988
  13. ;
  14. ;   Author:    Randy W. Spurlock
  15. ;
  16. ;******************************************************************************
  17. ;
  18. ;  Module Functional Description:
  19. ;
  20. ;        This module contains all the equates needed by the
  21. ;    Apple emulator. This module can be included with any needed
  22. ;    source files to define the Apple emulator equates.
  23. ;
  24. ;******************************************************************************
  25. ;
  26. ;  Changes:
  27. ;
  28. ;    DATE     REVISION                DESCRIPTION
  29. ;  --------   --------    -------------------------------------------------------
  30. ;   1/30/88    1.00    Original
  31. ;
  32. ;******************************************************************************
  33. STACK_SIZE    Equ    1000h            ; Define the emulator stack size
  34. RAM_SIZE    Equ    1000h            ; Apple RAM space size (64k)
  35. CGA_SEGMENT    Equ    0B800h            ; CGA Video RAM segment value
  36. EGA_SEGMENT    Equ    0A000h            ; EGA Video RAM segment value
  37. STACK_TOP    Equ    01FFh            ; Default 65C02 stack top
  38. FILLER        Equ    00h            ; Filler byte value
  39. SLOT_MAX    Equ    08h            ; Number of expansion slots
  40. HARDWARE_PAGE    Equ    0C0h            ; Hardware page number
  41. PAGE_SIZE    Equ    0100h            ; 65C02 memory page size (Bytes)
  42. BIOS        Equ    0040h            ; ROM BIOS data segment
  43. ;******************************************************************************
  44. ;
  45. ;    Define the 65C02 Interrupt Vector Addresses
  46. ;
  47. ;******************************************************************************
  48. IRQ_VECTOR    Equ    0FFFEh            ; IRQ interrupt vector address
  49. BRK_VECTOR    Equ    0FFFEh            ; BRK interrupt vector address
  50. RST_VECTOR    Equ    0FFFCh            ; RESET interrupt vector address
  51. NMI_VECTOR    Equ    0FFFAh            ; NMI interrupt vector address
  52. ABT_VECTOR    Equ    0FFF8h            ; ABORT interrupt vector address
  53. ;******************************************************************************
  54. ;
  55. ;    Define the BIOS equates needed
  56. ;
  57. ;******************************************************************************
  58. VIDEO        Equ    10h            ; BIOS video interrupt number
  59. SET_MODE    Equ    00h            ; Video set mode function code
  60. CURSOR_TYPE    Equ    01h            ; Video set cursor type code
  61. WRITE_CURSOR    Equ    02h            ; Video set cursor position code
  62. READ_CURSOR    Equ    03h            ; Video get cursor function code
  63. SET_PALETTE    Equ    10h            ; Video set pal. function code
  64. SET_ALL     Equ    02h            ; Program all sub-function
  65. PROGRAM_BLINK    Equ    03h            ; Program blink sub-function
  66. INTENSITY    Equ    00h            ; Blink off value (Intensity)
  67. BLINK        Equ    01h            ; Blink on value (Blink)
  68. ALT_SELECT    Equ    12h            ; Alt. select function code
  69. EGA_INFO    Equ    10h            ; Return EGA info. sub-function
  70. KEYBOARD    Equ    16h            ; BIOS keyboard int. number
  71. CHECK_KEY    Equ    01h            ; Check key status function code
  72. SHIFT_STATUS    Equ    02h            ; Get shift status function code
  73. ;******************************************************************************
  74. ;
  75. ;    Define the MS-DOS equates needed
  76. ;
  77. ;******************************************************************************
  78. DOS        Equ    21h            ; MS-DOS interrupt number
  79. SET_DTA     Equ    1Ah            ; Set DTA function code
  80. SET_VECTOR    Equ    25h            ; Set interrupt vector code
  81. GET_VECTOR    Equ    35h            ; Get interrupt vector code
  82. OPEN_FILE    Equ    3Dh            ; Open file function code
  83. READ_ONLY    Equ    00h            ; Read only access code
  84. WRITE_ONLY    Equ    01h            ; Write only access code
  85. READ_WRITE    Equ    02h            ; Read/write access code
  86. CLOSE_FILE    Equ    3Eh            ; Close file function code
  87. READ_FILE    Equ    3Fh            ; Read file function code
  88. WRITE_FILE    Equ    40h            ; Write file function code
  89. SEEK_FILE    Equ    42h            ; Seek file function code
  90. ABSOLUTE    Equ    00h            ; Absolute file seek code
  91. RELATIVE    Equ    01h            ; Relative file seek code
  92. ALLOCATE_MEMORY Equ    48h            ; Allocate memory function code
  93. FREE_MEMORY    Equ    49h            ; Free memory function code
  94. TERMINATE    Equ    4Ch            ; Terminate function code
  95. FIND_FIRST    Equ    4Eh            ; Find first function code
  96. FIND_NEXT    Equ    4Fh            ; Find next function code
  97. ;******************************************************************************
  98. ;
  99. ;    Define the Standard MS-DOS File Handles
  100. ;
  101. ;******************************************************************************
  102. STD_INPUT    Equ    00h            ; Standard input handle
  103. STD_OUTPUT    Equ    01h            ; Standard output handle
  104. STD_ERROR    Equ    02h            ; Standard error handle
  105. STD_AUX     Equ    03h            ; Standard auxiliary handle
  106. STD_PRINT    Equ    04h            ; Standard print handle
  107. ;******************************************************************************
  108. ;
  109. ;    Define the 65C02 CPU flag byte
  110. ;
  111. ;    -----------------
  112. ;    |7|6|5|4|3|2|1|0|
  113. ;    -----------------
  114. ;     | | | | | | | |
  115. ;     | | | | | | | -------> Carry flag (0 = No carry, 1 = Carry)
  116. ;     | | | | | | ---------> Mode flag (0 = Binary, 1 = Decimal [BCD])
  117. ;     | | | | | -----------> Interrupt flag (0 = Not masked, 1 = Masked)
  118. ;     | | | | -------------> Overflow flag (0 = No overflow, 1 = Overflow)
  119. ;     | | | ---------------> Break flag (0 = Hardware, 1 = Software)
  120. ;     | | -----------------> Reserved flag (Used for emulator break)
  121. ;     | -------------------> Zero flag (0 = Non-zero, 1 = Zero)
  122. ;     ---------------------> Negative flag (0 = Positive, 1 = Negative)
  123. ;
  124. ;******************************************************************************
  125. CPU_C        Equ    01h            ; CPU carry flag
  126. CPU_M        Equ    02h            ; CPU mode flag
  127. CPU_I        Equ    04h            ; CPU interrupt disable flag
  128. CPU_V        Equ    08h            ; CPU overflow flag
  129. CPU_B        Equ    10h            ; CPU break flag
  130. CPU_R        Equ    20h            ; CPU reserved flag (Break)
  131. CPU_Z        Equ    40h            ; CPU zero flag
  132. CPU_N        Equ    80h            ; CPU negative flag
  133. ;******************************************************************************
  134. ;
  135. ;    Define the Apple system flag byte
  136. ;
  137. ;    -----------------
  138. ;    |7|6|5|4|3|2|1|0|
  139. ;    -----------------
  140. ;     | | | | | | | |
  141. ;     | | | | | | | -------> Video type (0 = CGA, 1 = EGA)
  142. ;     | | | | | | ---------> Display type (0 = CGA, 1 = EGA)
  143. ;     | | | | | -----------> Interrupt status (0 = Normal, 1 = Patched)
  144. ;     | | | | -------------> Video status (0 = Normal, 1 = Initialized)
  145. ;     | | | ---------------> Keyboard status (0 = Normal, 1 = Input)
  146. ;     | | -----------------> ***** Reserved *****
  147. ;     | -------------------> ***** Reserved *****
  148. ;     ---------------------> ***** Reserved *****
  149. ;
  150. ;******************************************************************************
  151. EGA_TYPE    Equ    01h            ; EGA type system video
  152. EGA_DISPLAY    Equ    02h            ; EGA type display attached
  153. PATCHED     Equ    04h            ; Interrupts have been patched
  154. INITIALIZED    Equ    08h            ; Video has been initialized
  155. INPUT        Equ    10h            ; Keyboard is in input mode
  156. ;******************************************************************************
  157. ;
  158. ;    Define the Video system flag byte
  159. ;
  160. ;    -----------------
  161. ;    |7|6|5|4|3|2|1|0|
  162. ;    -----------------
  163. ;     | | | | | | | |
  164. ;     | | | | | | | -------> Video Mode    (0 = Text,   1 = Graphics)
  165. ;     | | | | | | ---------> Page Number    (0 = Page 1, 1 = Page 2)
  166. ;     | | | | | -----------> Resolution    (0 = Low,    1 = High)
  167. ;     | | | | -------------> Mixed Mode    (0 = Normal, 1 = Mixed)
  168. ;     | | | ---------------> Video Mode    (1 = Text,   0 = Graphics)
  169. ;     | | -----------------> Page Number    (1 = Page 1, 0 = Page 2)
  170. ;     | -------------------> Resolution    (1 = Low,    0 = High)
  171. ;     ---------------------> Mixed Mode    (1 = Normal, 0 = Mixed)
  172. ;
  173. ;******************************************************************************
  174. VIDEO_MODE    Equ    01h        ; Video mode test bit flag
  175. PAGE_NUMBER    Equ    02h        ; Page number test bit flag
  176. RESOLUTION    Equ    04h        ; Resolution test bit flag
  177. MIXED_MODE    Equ    08h        ; Mixed mode test bit flag
  178. VIDEO_INV    Equ    10h        ; Video mode inverted bit flag
  179. PAGE_INV    Equ    20h        ; Page number inverted bit flag
  180. RES_INV     Equ    40h        ; Resolution inverted bit flag
  181. MIXED_INV    Equ    80h        ; Mixed mode inverted bit flag
  182. ;******************************************************************************
  183. ;
  184. ;    Define the Emulator system flag byte
  185. ;
  186. ;    -----------------
  187. ;    |7|6|5|4|3|2|1|0|
  188. ;    -----------------
  189. ;     | | | | | | | |
  190. ;     | | | | | | | -------> System Request Interrupt has Occurred
  191. ;     | | | | | | ---------> System Reset Interrupt has Occurred
  192. ;     | | | | | -----------> ***** Reserved ***** (Dummy interrupt)
  193. ;     | | | | -------------> ***** Reserved ***** (Dummy interrupt)
  194. ;     | | | ---------------> ***** Reserved ***** (Dummy interrupt)
  195. ;     | | -----------------> ***** Reserved ***** (Dummy interrupt)
  196. ;     | -------------------> ***** Reserved ***** (Dummy interrupt)
  197. ;     ---------------------> ***** Reserved ***** (Dummy interrupt)
  198. ;
  199. ;******************************************************************************
  200. SYS_REQUEST    Equ    01h        ; System request interrupt
  201. SYS_RESET    Equ    02h        ; System reset interrupt
  202. INT_REQUEST    Equ    0FFh        ; Any interrupt occurred test value
  203. ;******************************************************************************
  204. ;
  205. ;    Define the Language card flag byte
  206. ;
  207. ;    -----------------
  208. ;    |7|6|5|4|3|2|1|0|
  209. ;    -----------------
  210. ;     | | | | | | | |
  211. ;     | | | | | | | -------> Write enable
  212. ;     | | | | | | ---------> ***** Reserved *****
  213. ;     | | | | | -----------> ***** Reserved *****
  214. ;     | | | | -------------> ***** Reserved *****
  215. ;     | | | ---------------> ***** Reserved *****
  216. ;     | | -----------------> ***** Reserved *****
  217. ;     | -------------------> ***** Reserved *****
  218. ;     ---------------------> Read enable (Language RAM)
  219. ;
  220. ;******************************************************************************
  221. WRITE_ENABLE    Equ    01h        ; Language card write enable flag
  222. READ_ENABLE    Equ    80h        ; Language card read enable flag
  223. ;******************************************************************************
  224. ;
  225. ;    Define the Disk Drive flag byte
  226. ;
  227. ;    -----------------
  228. ;    |7|6|5|4|3|2|1|0|
  229. ;    -----------------
  230. ;     | | | | | | | |
  231. ;     | | | | | | | -------> Disk type (0 = 16, 1 = 13)
  232. ;     | | | | | | ---------> Write protect (0 = Writable, 1 = Write protect)
  233. ;     | | | | | -----------> Disk present (0 = No disk, 1 = Disk present)
  234. ;     | | | | -------------> Motor status (0 = Off, 1 = On)
  235. ;     | | | ---------------> Controller mode (0 = Input, 1 = Output)
  236. ;     | | -----------------> Track modified (0 = Un-modified, 1 = Modified)
  237. ;     | -------------------> Buffer valid (0 = Invalid, 1 = Valid)
  238. ;     ---------------------> ***** Reserved *****
  239. ;
  240. ;******************************************************************************
  241. OLD_STYLE    Equ    01h        ; Old style disk type (13 Sectors/track)
  242. WRITE_PROTECT    Equ    02h        ; Disk write protect flag
  243. DISK_PRESENT    Equ    04h        ; Disk present flag
  244. MOTOR_ON    Equ    08h        ; Disk drive motor on flag
  245. OUTPUT_MODE    Equ    10h        ; Disk controller mode flag
  246. TRACK_MODIFIED    Equ    20h        ; Disk track modified flag
  247. BUFFER_VALID    Equ    40h        ; Disk track buffer valid flag
  248. ;******************************************************************************
  249. ;
  250. ;    Define the keyboard status byte
  251. ;
  252. ;    -----------------
  253. ;    |7|6|5|4|3|2|1|0|
  254. ;    -----------------
  255. ;     | | | | | | | |
  256. ;     | | | | | | | -------> Shift key status (0 = Up, 1 = Down)
  257. ;     | | | | | | ---------> Ctrl key status  (0 = Up, 1 = Down)
  258. ;     | | | | | -----------> Alt key status (0 = Up, 1 = Down)
  259. ;     | | | | -------------> ***** Reserved *****
  260. ;     | | | ---------------> ***** Reserved *****
  261. ;     | | -----------------> Scroll lock key status (1 = Locked)
  262. ;     | -------------------> Num lock key status (1 = Locked)
  263. ;     ---------------------> Caps lock key status (1 = Locked)
  264. ;
  265. ;******************************************************************************
  266. SCROLL_LOCKED    Equ    20h        ; Scroll locked (Special update mode)
  267. TYPE_SPECIAL    Equ    SCROLL_LOCKED    ; Special update mode in effect
  268. NUM_LOCKED    Equ    40h        ; Num locked (Joystick mode)
  269. JOY_MODE    Equ    NUM_LOCKED    ; Joystick mode in effect
  270. CAPS_LOCKED    Equ    80h        ; Caps locked (All caps)
  271. SHIFTED     Equ    01h        ; Shift key is being held down
  272. CTRLED        Equ    02h        ; Ctrl key is being held down
  273. ALTED        Equ    04h        ; Alt key is being held down
  274. AFFECTED    Equ    CAPS_LOCKED    ; Affected by CAPS lock status
  275. NOT_AFFECTED    Equ    00h        ; Not affected by CAPS lock status
  276. ;******************************************************************************
  277. ;
  278. ;    Define the CGA color set equates
  279. ;
  280. ;    Color Number        Color Name
  281. ;    ------------        ----------
  282. ;
  283. ;         0            Black
  284. ;         1            Blue
  285. ;         2            Green
  286. ;         3            Cyan
  287. ;         4            Red
  288. ;         5            Magenta
  289. ;         6            Brown
  290. ;         7            White
  291. ;         8            Gray
  292. ;         9            Light Blue
  293. ;         A            Light Green
  294. ;         B            Light Cyan
  295. ;         C            Light Red
  296. ;         D            Light Magenta
  297. ;         E            Yellow
  298. ;         F            Intense White
  299. ;
  300. ;******************************************************************************
  301. BLACK        Equ    00h        ; Color 00h - Black
  302. BLUE        Equ    01h        ; Color 01h - Blue
  303. GREEN        Equ    02h        ; Color 02h - Green
  304. CYAN        Equ    03h        ; Color 03h - Cyan
  305. RED        Equ    04h        ; Color 04h - Red
  306. MAGENTA     Equ    05h        ; Color 05h - Magneta
  307. BROWN        Equ    06h        ; Color 06h - Brown
  308. WHITE        Equ    07h        ; Color 07h - White
  309. GRAY        Equ    08h        ; Color 08h - Gray
  310. LIGHT_BLUE    Equ    09h        ; Color 09h - Light Blue
  311. LIGHT_GREEN    Equ    0Ah        ; Color 0Ah - Light Green
  312. LIGHT_CYAN    Equ    0Bh        ; Color 0Bh - Light Cyan
  313. LIGHT_RED    Equ    0Ch        ; Color 0Ch - Light Red
  314. LIGHT_MAGENTA    Equ    0Dh        ; Color 0Dh - Light Magenta
  315. YELLOW        Equ    0Eh        ; Color 0Eh - Yellow
  316. INTENSE_WHITE    Equ    0Fh        ; Color 0Fh - Intense White
  317. ;******************************************************************************
  318. ;
  319. ;    Define the ASCII Character Equate Values
  320. ;
  321. ;******************************************************************************
  322. NULL        Equ    00h            ; ASCII code for null
  323. BELL        Equ    07h            ; ASCII code for bell
  324. BS        Equ    08h            ; ASCII code for backspace
  325. HT        Equ    09h            ; ASCII code for horizontal tab
  326. LF        Equ    0Ah            ; ASCII code for line feed
  327. VT        Equ    0Bh            ; ASCII code for vertical tab
  328. FF        Equ    0Ch            ; ASCII code for form feed
  329. CR        Equ    0Dh            ; ASCII code for carriage return
  330. SPACE        Equ    " "                     ; Space character
  331. COMMA        Equ    ","                     ; Comma character
  332. SEMI_COLON    Equ    ";"                     ; Semi-colon character
  333. PLUS        Equ    "+"                     ; Plus sign character
  334. MINUS        Equ    "-"                     ; Minus sign character
  335. EQUAL        Equ    "="                     ; Equal sign character
  336. ASTERISK    Equ    "*"                     ; Asterisk character
  337. POINT        Equ    "."                     ; Decimal point character
  338. PERIOD        Equ    "."                     ; Period character
  339. SLASH        Equ    "/"                     ; Slash character
  340. BACK_SLASH    Equ    "\"                     ; Back-slash character
  341.     .List
  342.