[Coco] More Color Forth

Gene Heskett gheskett at wdtv.com
Sun Jan 25 17:00:11 EST 2015


On Sunday 25 January 2015 14:01:45 Stephen Pereira did opine
And Gene did reply:
> Hello again, all,
> 
> In my continuing Color Forth project, I am attempting to install a
> brute force save of the Color Forth code screens to disk.  When I am
> eventually successful, I hope to at least be able to save and load the
> entire set of Color Forth screens 1-8 to and from disk, so we can be
> free from pre-loading only one set of screens 1-8 as it is now.
> 
> I am hoping to use the SAVEM (and LOADM) command from DECB.
> 
> I am a pretty good programmer in 8080 machine language, but I am an
> outright beginner on the 6809.  Please forgive my non-optimal code for
> now.  I am only hoping to get something going and then look for doing
> it well after I understand it all.
> 
> From my reading of “Disk Basic Unravelled,â€‌ I see that one can load
> the filename at $094C and the file extension at $0954, then put the
> start address, end address and execute address on the stack, and
> finally call SAVEM at $CF7E.  Yes, I know that is not the official
> entry point, I am bypassing the initial code to get the file name and
> addresses from the Basic input buffer.
> 
> Here is the snippet of (brute force) code that I wrote:
> 
> 	PSHS	CC,A,B,DP,X,Y,U	SAVE ALL JUST IN CASE
> 	LDX	#$094C
> 	LDA	#$53	S
> 	STA	,X+
> 	LDA	#$43	C
> 	STA	,X+
> 	LDA	#$52	R
> 	STA	,X+
> 	LDA	#$4E	N
> 	STA	,X+
> 	LDA	#$31	1
> 	STA	,X+
> 	LDA	#$54	T
> 	STA	,X+
> 	LDA	#$4F	O
> 	STA	,X+
> 	LDA	#$38	8
> 	STA	,X
> 	LDX	#$0954
> 	LDA	#$42	B
> 	STA	,X+
> 	LDA	#$49	I
> 	STA	,X+
> 	LDA	#$4E	N
> 	STA	,X
> 	LDD	#$2382	START SCR 1
> 	PSHS	A,B
> 	LDD	#$439F	END   SCR 8
> 	PSHS	A,B
> 	LDD	#$0000	EXEC
> 	PSHS	A,B
> 	JSR	$CF7E	SAVEM
> 	PULS	U,Y,X,DP,B,A,CC	RESTORE ALL
> 
> What I am concerned about is whether or not I am getting the addresses
> onto the stack in the right order, and with the correct byte order.

That is my first impression but I have done so little basic assembly 
programing that my hand is not anywhere near a bible.

And from my os9 programming, I would only save x at the top, and pull it 
before the jsr.  Regs.a/regs.b=regs.d and would I'd think be expected to 
contain throwaway data unless this call expects them to contain something 
relevant.

OTOH, I am not a rsdos programmer and the only thing I ever took apart and 
fixed for later basic roms was Jake Commanders Chrmakey, which was one 
heck of a programmers editor back in the days of the old gray ghosts and 
early coco2's.  Hiding above the basic roms in the all ram mode, it didn't 
work with the coco3's. But it sure was the bees knees for a basic 
programmer.  Shift hotkeys for all the basic keywords, full  screen line 
editing, It would double the productivity of someone doing something in 
basic once the hotkeys were memorized.

I hope it is still downloadable from someplace.  If not, I probably have a 
copy but its at least 3 feet down in the midden heap of coco stuff in the 
basement.  And no clue how long it would take to find it.  But while you 
can find it in an early Rainbow, that copy needs fixed for basic 1.2 else 
its very sluggish. A 2 byte fix. Any copy I could come up with is fixed, 
works with any 64k coco up to the end of the 2b production AFAIK.

> The reason I’m asking is that this code “kind of worksâ€‌ in my
> Color Forth.  I do get a file onto disk called SCRN1TO8.BIN, but it is
> 21 blocks long, instead of 4 blocks, like I expected.
> 
> Finally, while my Drivewire UI shows the disk activity start and end,
> my code does not return to the command line in Color Forth, so I am
> also concerned about that.  I see in the “Disk Basic Unravelledâ€‌
> that the SAVEM command dose end with an RTS, so I did expect my code
> to return.
> 
> Thanks very much, in advance, for any comments or advice you may offer!
> 
> smp
> --
> Stephen M. Pereira
> Bedford, NH  03110
> KB1SXE


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS


More information about the Coco mailing list