CoCo ROM Equivalents

From The Dragon Archive
Jump to: navigation, search

This list is maintained in the Toolshed repository!

Direct link: http://sourceforge.net/p/toolshed/code/ci/default/tree/cocoroms/dragon_equivs.asm


The Lxxxx are Coco addresses, second column is Dragon equivalent address

* Coco	Dragon	Comment
L813C	$84F5	? EXBAS COMMAND INTERPRETATION LOOP
L8168	$89b4  ?? (use SN ERROR for now) EXBAS SECONDARY COMMAND HANDLER
L8311	$b6d4	?? CHECK EXBAS CLOAD HANDLER, then main loop
L8316	$b682	?? DO A CSAVE, then main loop
L836C	$994a   SYNTAX CHECK FOR COMMA - leaves value (2 bytes) on stack
L8748	$9b7e   EVALUATE A STRING EXPRESSION
L880E	$9c3e     Assign8BitB      evaluates octal number -> FP
L8955	$9d46   GET REAL TIME CLOCK - into irq routine
L8C1B	$a04e   (or $a04c ?) GET THE CURRENT INPUT CHARACTER -  DLOAD
L8CC6	$a0ea	wait for keypress - flash cursor
L9539	$a8c7	clear current graphics screen with B
L959A	$a928	Set colours
L95AA	$a938	Select Display mode (text z=1, graphics z=0)
L95AC	$a93a     RESET SAM - reset VDU
L95FB	$a989	Set VDG mode from A
L960F	$a99d	Set VDG offset for graphics mode
L9616	$a9a4	Set VDG colour set from $00c1
L962E	$a9bc	SET START GRAPHIC PAGE, PMODE COMMAND
L9650	$a9de	EVALUATE EXPRESSION - PMODE,x
L9653	$a9e1	Set page to B
L9682	$aa10	Select colour set 0 or 1 from B
L9695	$aa23	Reserve HiRes Graphics RAM, move Basic if necessary
L96CB	$aa66	PUT CORRECT ADDRESSES IN FIRST 2 BYTES OF EACH LINE - PCLEAR
L96EC	$aa87	CONSTANT OFFSET OF $600 - init of EXBAS graphics vars
L975F	$aaf7	VEC22  CHECK FOR @ SIGN - PUT
L9AD7	$ae9a	Play note from A
L9CB6	$b051	Draw token dispatch address
L9FB5	$b350	MULTIPLY (UNSIGNED) TWO 16 BIT NUMBERS TOGETHER
LA027	$b3b4	Reset ISR
LA0B6	$b400	Boot Basic
LA0E2	$b449	WARM START FLAG - go to basic main loop
LA171	$b505	GET A CHARACTER FROM CONSOLE IN
LA176	$b50a	HOOK INTO RAM - console in, GET A CHAR FROM INPUT BUFFER
LA199	$bbb5	Flashes cursor
LA1B1	$b538	GETKEY
LA1C1	$bbe5	%INCH% scans keyboard
LA282	$b54a	%OUTCHR% to DEVNUM
LA30A	$bcab	%OUTCH% to screen
LA323	$bca0	Clear VDU line from cursor
LA35F	$b595	SET PRINT PARAMETERS
LA37C	$b5b2	SAVE THE PRINT PARAMETERS
LA39A	$b5d0	inside routine that gets an input line for basic
LA2BF	$bd1a	Send char A to printer
LA3ED	$b623	VERIFY THAT THE FILE TYPE WAS 'INPUT
LA3FB	$b631	'FILE NOT OPEN' ERROR
LA406	$b63c	MAKE SURE SELECTED FILE IS AN OUTPUT FILE, TEST DEVICE NUMBER
LA426	$b65c	CLOSE ALL FILES on cassette
LA429	$b65f	CLOSE ALL FILES (skip ram vector)
LA42D	$b663     Close file (on devnum)
LA511	$b748	Read binary file from tape
LA469	$b6a5	Write Basic program to cassette
LA545	$b777	...EXEC
LA549	$b77b	GO DO A BREAK CHECK
LA59A	$b7cc	(or $bb97) MOVE (B) BYTES FROM (X) TO (U)
LA5A2	$b7d4	GET DEVICE NUMBER
LA5A5	$b7d7	EVALUATE AN EXPRESSION (# then DEVICE NUMBER)
LA5AE	$b7e0	EVALUATE DEVICE NUMBER
LA5C7	$b7f9	SYNTAX ERROR IF ANY MORE CHARS ON THIS LINE
LA5DA	$b80c	BRANCH BACK TO BASIC'S EOF
LA5E4	$b816	LINK BACK TO BASIC'S EOF STATEMENT
LA603	$b835	get file name (open)
LA616	$b848	BAD FILE MODE ERROR
LA61C	$b84e	'FILE ALREADY OPEN' ERROR
LA61F	$b851	DEVICE NUMBER ERROR
LA681	$b8b3	Find File, search tape for matching filename
LA701	$b933	Read first (filename) block from tape to buffer
LA70B	$b93e	%BLKIN% from tape to buffer
LA749	$bdad	%CBIN% input byte from tape to A
LA755	$bda5	%BITIN% from tape to c
LA77C	$bde7	%CSRDON% read leader
LA7CA	$bdcf	%CASON%
LA7D1	$bdd7	(not 100% compatible) In %CASON% WAIT A WHILE
LA7E5	$b991	Write first block
LA7E9	$bddc	CASOFF TURN OFF THE CASSETTE MOTOR (Graham: LA7EB)
LA7F4	$b999	%BLKOUT% to tape
LA82A	$be12	%CBOUT% output byte to tape
LA88D	$b9df	Set LoRes Pixel
LA8B5	$ba07	Reset LoRes Pixel
LA8D9	$ba28	Calc LoRes Pixel Pos
LA928	$ba77     Clear text screen
LA92A	$ba79	Clear text screen with B
LA951	$baa0     JUMP TO 'SOUND' - DO A BEEP
LA974	$bac3     Audio off
LA976	$bac5     Audio on
LA985	$bad4	Reset DAC
LA987	$bad6	Writes A to DAC
LA99D	$baec	Audio on (B=0)
LA9A2	$bd41     %SNDSEL%
LA9DE	$bd52	%JOYIN%
LAC37	$8335	SEE IF ENOUGH ROOM IN RAM
LAC44	$8342	OM ERROR
LAC46	$8344     System error
LAC60	$835e	JUMP TO BASIC'S ERROR HANDLER
LAC73	$8371     OK prompt
LAC7C	$837a	GO TO BASIC'S MAIN LOOP, IT WILL LOAD PROGRAM
LACEF	$83ed     BasVect2
LAD19	$8417     Erases program
LAD21	$841f     BasVect1
LAD33	$8434     Resets stack
LAD9E	$849f     RUN BASIC
LADC6	$84dc	LOOP THROUGH BASIC'S MAIN INTERPRETATION LOOP
LADD4	$84ed	JUMP TO BASIC'S COMMAND HANDLER
LADEB	$851b	GO DO A BREAK CHECK IF A KEY IS DOWN
LADFB	$852b	wait for key press, return in A
LAE15	$8545	GO 'STOP' THE SYSTEM
LAF9A	$86cd
LAFA4	$86da	BRANCH BACK TO BASIC’S 'LET' COMMAND
LAFB1	$86e7	MOVE IT INTO THE STRING SPACE
LB00C	$9dc9	check for ,"
LB01E	$9de3	?not sure, in INPUT
LB069	$879a
LB143	$8874	NUMBER TYPE CHECK
LB146	$8877	'TM' ERROR IF NUMERIC VARIABLE, Get expression
LB148	$8879	DO A 'TM' CHECK
LB156	$8887	EVALUATE AN EXPRESSION, Get string
LB166	$8897	(eqv ROM but usage?) COMING FROM THE 'LET' COMMAND
LB244	$8975	STRIP PROMPT STRING FROM BASIC AND PUT IT ON THE STRING STACK
LB262	$899f	SYNTAX CHECK FOR '(' AND EVALUATE EXPRESSION
LB267	$89a4	CkClBrak
LB26A	$89a7	CkOpBrak
LB26D	$89aa	CkComa
LB26F	$89ac	CkChar
LB277	$89b4	SYNTAX ERROR
LB2CE	$8a0b	JUMP TO BASIC'S SECONDARY COMMAND HANDLER
LB357	$8a94     %GETVAR%
LB3E6	$8b23	EVALUATE EXPRESSION, RETURN VALUE IN ACCD
LB3E9	$8b29	%GETUSR%
LB44A	$8b8d	FC ERROR
LB4F2	$8c35	Assign16Bit (skips to $8c37)
LB4F3	$8c36     Assign8Bit, LOAD ACCB INTO FPA0
LB50F	$8c52	RESERVE ACCB BYTES IN STRING SPACE
LB516	$8c59	PUT ON TEMPORARY STRING STACK
LB591	$8cd7	Force string space garbage collection
LB654	$8d9a	GET LENGTH AND ADDRESS OF STRING
LB657	$8d9d	PURGE THE STRING PUT ON THE STRING STACK
LB659	$8d9f	%DELVAR%
LB69B	$8de1	SAVE STRING DESCRIPTOR ON STRING STACK
LB6A4	$8dea	FIRST BYTE OF STRING EXPRESSION
LB70B	$8e51	Get8Bit
LB70E	$8e54	EVALUATE NUMERIC EXPRESSION AND RETURN VALUE IN ACCB
LB738	$8e7e	SYNTAX CHECK FOR COMMA, EVALUATE EXPRESSION
LB73D	$8e83     Get16Bit
LB764	$8eaa	LIST token dispatch address
LB958	$90a1     Print CR
LB95C	$90a5	SEND A CR TO THE SCREEN
LB99C	$90e5	STRINOUT
LB99F	$90e8     STRINOUT+3, PRINT STRING TO CONSOLE OUT
LB9A2	$90eb	SEND STRING TO CONSOLE OUT
LB9AC	$90f5	SEND BLANK TO CONSOLE OUT
LB9AF	$90f8	SEND A '?' TO THE SCREEN
LB9C5	$910E	oper_plus_dispatch
LBB91	$933c	oper_div_dispatch, DIVIDE FPA1 BY FPA0
LBC14	$93bf	MOVFM, COPY A PACKED FP NUMBER FROM (X) TO FPA0
LBC33	$93de	PACK FPA0 INTO VARDES
LBC35	$93e0	PACK FPA0 AND STORE IT IN STRING SPACE
LBC5F	$940a	SAVE NUMBER IN FPA1
LBDCC	$957a     Print Number,  Print decimal D to screen
LBDD9	$9587	CONVERT FP NUMBER TO ASCII STRING

* name	Dragon	Coco
STRINOUT	$90e5	LB99C
EVALEXPB	$8e51 	LB70B	Get8Bit, Evaluate argument
SYNCOMMA	$89aa	LB26D	CkComa
XBWMST	$b44f	L80C0
CHROUT	$a002	LA002
PUTCHR	$b54a	LA282
CLS	$ba5f	LA910
INTCNV	$8b2d	LB3ED
GIVABF	$8c37	LB4F4
LIST	$8eaa	LB764
INT	$9499	LBCEE

* hooks for extended basic, just use RTS on Dragon, similar entry located
XVEC3	$b64b	(rts) $b54b	Character output
XVEC4	$b64b	(rts) $b50b	Character input
XVEC8	$b64b	(rts) $b664	Close a single device or file
XVEC9	$b64b	(rts) $84de	?About to deal with first char of new statement /PRINT
XVEC15	$b64b	(rts) $8954	Evaluate an expression
XVEC17	$b64b	(rts) $8347	System error
XVEC18	$b64b	(rts) $85a5	RUN statement