[Coco] More Color Forth
Arthur Flexser
flexser at fiu.edu
Sun Jan 25 14:30:55 EST 2015
If the description I gave you earlier, based on some old code of mine that
I unearthed, is right, then what you did isn't quite in accord with it.
You need to push all the registers, after loading them with the start, end,
exec, and address for resuming execution, in a SINGLE pshs operation, which
will ensure the correct order of what is pushed. Then JMP (not JSR) to the
savem routine. I'm not sure your final PULS is reached, unless you set the
resume address to that.
Art
On Sun, Jan 25, 2015 at 2:01 PM, Stephen Pereira <spereira1952 at comcast.net>
wrote:
> 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.
>
> 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
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
More information about the Coco
mailing list