;------------------------------------------------------------------------
;LSIO			[COMTAB-10]
;This location contains the address of the SIO routine SpartaDos uses. 
;This is actually a vector, so U may replace this address with your own. 
;The ramdisk patches in here to trap access to the drive it is emulating. 
;Many commands use this vector to run the dos's high speed SIO routine.
LSIO:		equ	10
;------------------------------------------------------------------------
;ECHOFLG		[COMTAB-8]
;This location contains the index into HATABS <table of handler IDs and 
;addresses> of the file SpartaDos is echoing output to. A value of $FF 
;indicates that echoing is inactive. This Location Is Valid Only While 
;Running Under SpartaDos 2.x
ECHOFLG:	equ	8
;------------------------------------------------------------------------
;BATFLG			[COMTAB-6]
;This location contains the index into HATABS <table to handler IDs and 
;addresses> of the file SpartaDos is receiving input from. A value of $FF
;indicates that no batch file is active. This Location Is Valid Only 
;While Running Under SpartaDos 2.x
BATFLG:		equ	6
;------------------------------------------------------------------------
;WRTCMD			[COMTAB-2]
;This location contains the SIO write command. A W is the write with 
;verify command, & P is the write with no verify command. This Location 
;Is Valid Only While Running Under SpartaDos 2.x.
WRTCMD:		equ	2

;------------------------------------------------------------------------
;WARMST			[COMTAB-1]
;This flag, if set, indicates that the command processor is doing a 
;cold start. It is cleared <to 0> whenever the command processor is 
;entered. It is used to trap errors when trying to open STARTUP.BAT
;or AUTORUN.SYS.
WARMST:		equ	1
;------------------------------------------------------------------------
;COMTAB			[COMTAB]
;This location contains a 6502 jump instruction 2 the command processor. 
;BASIC enters here on a dos command.
comtab:		equ	$0a
;------------------------------------------------------------------------
;ZCRNAME		[COMTAB+3]
;This location contains a 6502 jump instruction 2 the filename crunch 
;routine <CRNAME>. This is used by most external dos commands 2 fetch 
;the next filename on the command line. The command line is at LBUF & 
;the crunched filename ends up at COMFNAM. This routine supplies the 
;default drive number if necessary. The zero flag on return is SET 
;if n filename is on the command line. Each call returns the next 
;filename on the command line.
ZCRNAME:	equ	3
;------------------------------------------------------------------------
;ZDIVIO			[COMTAB+6]
;This location contains the address of the divert input/output <redirection
; of I/O> routine. From an assembly language program, U may call the routine
;through an indirect jump to ZDIVIO with the filename at COMFNAM and the 
;Y register equal to 0 if output <PRINT>, or 1 if input <-fname>.
ZDIVIO:		equ	6
;------------------------------------------------------------------------
;ZXDIVIO		[COMTAB+8]
;This location contains the address of the stop divert input/output 
;routine. From an assembly language program, U may call the routine 
;through an indirect jump to ZXDIVIO with the Y register equal to 0 if 
;stopping output <PRINT>, or 1 if stopping input <force end of file>.
ZXDIVIO:	equ	8
;------------------------------------------------------------------------
;BUFOFF			[COMTAB+10]
;This location contains the current offset into the command line. 
;CRNAME uses this pointer to fetch the next parameter on the 
;command line <at LBUF> & move it to COMFNAM.
BUFOFF:		equ	10

;------------------------------------------------------------------------
:ZORIG			[COMTAB+11]
;This location contains the start address of SpartaDos. $600 is the 
;start address of SPEED.DOS, STANDARD.DOS and $700 is the start address 
;of all other vectors.
ZORIG:		equ	11
;------------------------------------------------------------------------
;DATER		[COMTAB+13]
;This location contains the current date in DD/MM/YY format <3 bytes>. 
;This is the date that sparta inserts in the directory whenever a new file 
;or directory is created. To override this, see TDOVER.
dater:		equ	13
;------------------------------------------------------------------------
;TIMER		[COMTAB+16]
;This location contains the current time in HH/MM/SS format <3 bytes, Not 
;in BCD format, therefore it can be read with no conversion from BASIC>. 
;This is the time that sparta inserts in the directory whenever a new file 
;or directory is created. To override this, see TDOVER.
timer:		equ	16
;------------------------------------------------------------------------
;ODATER		[COMTAB+19]
;This location contains the alternate date in DD/MM/YY format <3 bytes>.s 
;Sparta uses this date instead of DATER if the TDOVER flag is set.
odater:		equ	19
;------------------------------------------------------------------------
;OTIMER		[COMTAB+22]
;This location contains the alternate time in HH/MM/SS format <3 bytes>. 
;Sparta uses this time instead of TIMER if the TDOVER flag is set.
otimer:		equ	22
;------------------------------------------------------------------------
;TDOVER		[COMTAB+25]
;This location contains the time/date override flag. It is set to 0 if 
;to use DATER and TIMER when it creates new files, and set to $FF if to 
;use ODATER and OTIMER. This is used by file copy programs <such as 
;SPCOPY/MENU> to insure that the time and date of each file is preserved.
tdover:		equ	22
;------------------------------------------------------------------------
:TRUN		[COMTAB+26]
;This location contains the RUN address of a load file. This location 
;is updated during the internal load operation, so BASIC or any other 
;program may check what the load address was. RUNLOC is updated from this
;location by the command processor only.
TRUN:		equ	26 
;------------------------------------------------------------------------
SBUFF		[COMTAB+28] 
; This is the start address of Sparta DOS sector buffers.
sbuff:		equ	28 
;------------------------------------------------------------------------
;DDENT		[COMTAB+29]
;This location contains the density <sector size> of each drive <4 in 
;all__sparta 1.x only supports 4 drives.> A value of 0 indicates 256 byte
;sectors, and a 128 indicates 128 byte sectors. This Table Is Valid Only 
;For Version 1.x sparta. The DDENT table is inaccessible if U are using 
;sparta 2.x.
DDENT:		equ	29
;------------------------------------------------------------------------
;SMEMLO		[COMTAB+30] 
;This is the top of SpartaDOS low memory. Handlers added since boot take
;up the memory between SMEMLO and MEMLO.
smemlo:		equ	30
;------------------------------------------------------------------------
;INCOMND	[COMTAB+32)
;A -1 here indicates that we are in the command processor (entering 
;commands, etc.). A 0 indicates that we are in BASIC or some cartridge 
;program. This is used by the initialization routine to determine whether 
;to enter the command processor or not. 
incomnd:	equ	32

;------------------------------------------------------------------------
;COMFNAM	[COMTAB+33]
;This is the buffer for the output of the ZCRNAME routine. 
;It is a 28 byte long buffer and ALWAYS begins in the form dn: so if you 
;are only looking for parameters, u may start looking at COMFNAM+3.
COMFNAM:	equ	33
;------------------------------------------------------------------------
;RUNLOC		[COMTAB+61]
;This location contains the run address of a .COM file when it is loaded 
;through the command processor <as a command>. If no address is specified
;after the RUN command, this is the address too be run.
RUNLOC:		equ	61
;------------------------------------------------------------------------
;LBUF			[COMTAB+63]
;This location contains the input buffer. This is where the command line is 
;stored. LBUF is 64 bytes in length.
LBUF:		equ	63	; lbuf offset from comtab
;------------------------------------------------------------------------
;
;	READ THIS BEFORE USING VECTORS
;
;SpartaDOS 3.3 and Real.dos contains many vectors pertaining to the 
;setting, reading, displaying of the time and date, executing command: 
;lines, initializing the system and many more. These vectors 
;are : contained in the RAM under the operating system starting at address.
; $FFCO. They may be accessed by the following Instructions:
;
;		lda $0301 	; PIA 
;		pha 		; save old value of port on stack 
;		and #$FE 	; set bit 0 to OFF 1
;		sta $0301 	; enable RAM under the OS 
;		jsr VGETTO 	; call routing at $FFCO via 
;		sta $0301 	; restore the port (enable OS) 
;
;These functions each contain a jump (JMP) instruction to the appropriate 
;function. If a function is not initially supported (as in TDON), the vector
;will contain a SEC and RTS instruction rather I. than a JMP. The following 
;vectors are currently supported: 
;
;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;VGETTD ($FFCO) 
;This function returns the current time/date at TIMER and DATER 
;(locations at COMTAB-see page 110 of the Sparta DOS manual). 
;On return, the carry is SET if the function failed. When a file is 
;opened for write, Sparta DOS makes a call here to update TIMER/DATER
; so it can move this data into the directory entry. Also the TIME and
; DATE internal commands make calls here to get the current time. TDLlNE
; and ZHAND also use this vector. 
vgettd:		equ	$ffc0

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;VSETTD ($FFC3) 
;This function sets the time/date. On entry, the new time and date are at 
;TIMER and DATER (locations at COMTAB-see page 110 of the SpartaDOS manual). 
;On return, the carry is SET if the function failed. This vector is used by 
;the commands TIME, DATE, and the :a; ZHAND set functions. 
vsettd		equ	$ffc3



;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;VTDON ($FFC6) 
;This function turns the time/date display line on or off. On entry, 
;the Y register contains 0 if to turn the line off, or 1 if to turn the 
;line on. On return, the carry is SET if the function failed. This function 
;is not supported internally by SpartaDOS. The TDLlNE handler patches . 
;into this vector for use by the TD command along with the ZHAND functions 
;38 and 39. (See the TDLlNE command.) 
vtdon:		equ	$ffc6

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;VFMTTD ($FFC9) 
;This function returns the formatted time/date line into ' a user supplied 
;buffer. On entry, the X and Y registers 1 contain the high and low byte of
;the buffer address respectively. On exit, the carry is SET if the function 
;failed. This function is not supported internally by SpartaDOS. 
;The TDLINE handler patches into this vector for use by TDLINE and 
;ZHAND routines. (See the TDLINE command.) 
VFMTTD:		equ	$FFC9 

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;VINITZ ($FFCC) 
;This vector is called after SpartaDOS has finished initializing itself 
;after a RESET occurs. The command AUTOBAT patches into this vector to start
;a batch file right after RESET. (By initialization, we mean as a result of 
;making a call through DOSINI-e.g. JMP (DOSINI). The OS monitor routine 
;calls this vector before it enters a cartridge or DOS.) 
VINITZ:		equ	$FFCC

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;VINITZ2 ($FFCF) 
;This vector is called after SpartaDOS has finished initializing itself 
;after a NON-RESET occurs. Several SpartaDOS commands (such as SPCOPY and 
;UNERASE) will initialize DOS before and after they perform their function. 
;They do this by jumping through the DOSINI vector as does the OS monitor 
;routine after a RESET. 
VINITZ2:	equ	$FFCF 

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;VXCOMLI ($FFD2) 
;This vector calls the command processor to execute a command line given 
;at LBUF. BUFOFF should be 0 on entry. Any errors that may occur as a result
;of executing the command line shall be printed as usual. No prompts are
;printed before or after command execution. This is the method that a future
;DUP.SYS for Sparta DOS could use to perform its functions. 
vxcomli:	equ	$ffd2

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;VCOMND ($FFD5) 
;This vector calls the main command processor program entry point. You may 
;patch into this vector if you wish to supply your own command processor. 
;(The 'I current one simply prints the prompt, inputs a line, : 
;calls VXCOMLI, and jumps back to the beginning.) This is the method DUP.SYS
;uses to gain entry from a DOS command in BASIC.
VCOMND:		equ	$FFD5
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;VPRINT ($FFD8) 
;This vector points to the Sparta DOS general print routine. The calling 
;method is:
;
;I use a similar routein   Jsr printsi
;
;		JSR VPRINT 
;		dc.b "This is a message",$9B,-1
;
;
VPRINT:		equ	$FFD8 

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;VKEYON ($FFDB) 
;This function turns the keyboard buffer on or off. On entry, the Y register
;contains 0 if to turn the buffer off, or 1 if to turn the buffer on. This 
;function is supported internally by SpartaDOS.
;
VKEYON:		equ	$FFDB 