In batari Basic, which SpiceWare doesn't use, we have a "256K basic stack" where values and ranges of values can be pushed and pulled.
Is this basic Stack shown on the data map?
Yes, it's somewhere in the Display Data, the first 4K ($0000 - $0FFF) of RAM that's displayed. I took a look in bB11d (I have that on my Mac from when I ported my sound effect driver
to bB) and in keywords.c
I can see where the stack commands are processed:
else if (!strncmp(statement,"push\0",5)) do_push(statement);
else if (!strncmp(statement,"pull\0",5)) do_pull(statement);
else if (!strncmp(statement,"stack\0",6)) do_stack(statement);
: you can see do_push
. the function do_stack
converts the bB stack command to 6507 assembly like this:
void do_stack(char **statement)
printf(" lda #<(STACKbegin+%s)\n",statement);
printf(" STA DF7LOW\n");
printf(" lda #(>(STACKbegin+%s)) & $0F\n",statement);
printf(" STA DF7HI\n");
So somewhere there's a constant defined as STACKbegin
that'll tell you where in Display Data the stack is located. It looks like it's on line 194 of DPCplusbB.h
, but it's defined based on what comes before it:
STACKbegin = BKCOLS + 256
One of the options for DASM is to output a symbol listing. When I compile my projects I do so like this:
dasm draconian.asm -f3 -v0 -sdraconian.sym -ldraconian.lst -odraconian.bin
the -s requests a symbol file, which is named draconian.sym. I believe bB is already requesting the symbol file as I see one for my sfx_demo. If you have the *.sym file you should find the location of STACKbegin
Edited by SpiceWare, Mon Sep 22, 2014 7:44 PM.