[Coco] Assembly .BIN -> .CCC/.ROM = SOLVED!

Chad H chadbh74 at hotmail.com
Wed Sep 3 22:47:36 EDT 2014


Ahh... when I was looking in the Rainbow IDE HELP > 6809 refernce at the
opcode table and saw the DECD, I failed to see the note that '*' represented
a 6309 code...oops.  Anywhoo, I FINALLY got this bugger going perfectly!! :)
Thanks to William Astle, Johann Klasek and Tormod Volden, you guys all made
points that helped me debug this ..umm..bugger.   

Since I only have a CoCo 2 64K, which I believe can only access 16K of
cartridge ROM at a time, I decided to load the maximum size .BIN file I
could find that would still fit into 16K.  I chose FLTSIM.BIN as it is just
over 15K.  The Assembly loader is 33 bytes with the .BIN copied into the
.CCC image just after that.  I wrote a quick and dirty .NET application that
will prompt the user for the source .BIN, destination .CCC/.ROM file, then
write out the 33 bytes and combine in the .BIN file data automatically.  All
you have to do then is load the resulting file in M.E.S.S. as a rom pak and
it loaded the Flight Simulator I instantly :)  I have a few 27128 EPROM's so
I'll be flashing this to one of those to confirm.  I know from examining the
.BIN data for FLTSIM.BIN that it was many segments but it DOES work :)

Anyone can use this to convert a 16k or less .BIN to a ROM Pak Image (32K on
CoCo 3????)  I'll put up the small .NET executable that makes the process
simple if anyone wants it.   Here is the final Assembly listing, thanks
again!!  ....


	*.BIN single/multisegment bootloader for ROM Pak
	
	org	49152		CoCo and compatibles map in ROM Paks here

	* LOADER
BININ	LDX	#BINLOD		INIT XFER DATA ADDRESS OFFSET 
CHKBLK	LDA	,X+		GET BLOCK TYPE BYTE (00 = PREAMBLE,
255=POSTAMBLE)
	BNE	ENDBIN		IF <>0 THEN MUST BE END OF .BIN DATA
(POSTAMBLE)
	LDU	,X++		GET BLOCK LENGTH(U)
	LDY	,X++		GET BLOCK START ADDRESS(Y)
XFER	LDA	,X+		GET SOURCE BYTE(A) FROM X
	STA	,Y+		PUT BYTE(A) AT Y
	LEAU	-1,U		MOVED BLOCK?
	CMPU	#0
	BNE	XFER		NO
	JMP	CHKBLK		CHECK NEXT BLOCK
ENDBIN	LDU	,X++		GET BLOCK LENGTH (0000)
	LDU	,X++		GET EXECUTION ADDRESS(U)
	JMP	[,U]
BINLOD	FCB	255


-----Original Message-----
From: Coco [mailto:coco-bounces at maltedmedia.com] On Behalf Of William Astle
Sent: Wednesday, September 03, 2014 7:21 PM
To: coco at maltedmedia.com
Subject: Re: [Coco] Assembly Help

On 14-09-03 04:18 PM, Chad H wrote:
> DECD was in my 6809 manual and compiled in Rainbow IDE utilizing CCASM
without error.  DECU however failed and wasn't on the 6809 chart...I will
look at using the LEAU  and see what happens.  Thanks guys!

DECD is most definitely NOT a 6809 opcode. (It's not listed in the 6809
datasheet and none of the undefined operation codes has that effect.) It is
a 6309 opcode, though. If I recall correctly, CCASM supports 6309 opcodes so
that would be why it assembled. It won't run as expected on a 6809, though.

Of course, since you were already clobbering D with the use of A in the
loop, it wouldn't work on either processor.





-- 
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco



More information about the Coco mailing list