The disk image we already have in appmake will work fine ("+cpm -subtype=apple2" creates a 16 trk disk image file) but we miss a system specific library.
I looked at the MS GBASIC implementation to learn a little more about HW specific capabilities and I stumbled in this piece of code:
@label=INIT
*04096 LD HL,25744
04099 LD DE,33922
04102 LD BC,21635
04105 LDDR
04107 JP 33235
So, the higher portion of the BASIC interpreter gets shiftetd 8178 bytes high (the block between 4109 (shouldn't it be 4110 ? perhaps it is a sort of protection?) and 25744 is moved to the 12287..33922 range. The entry addresses in the binary file look shifted of 8178 bytes compared to the expected position, exactly 8192 minus the 14 bytes relocator above... I must have misinterpreted the LDDR range.
EDIT: my hack to force a relocation and prepare GBASIC for BASCK
Code: Select all
/*
* Expanding the Apple ][ GBASIC.COM file for an easier analysis
* BASCK needs to be modified (remove the GBASIC hack and force ORG to $100)
*
* $Id: split.c$
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
FILE *fpin, *fpout;
int c;
int i,x;
int len;
int pos;
pos=4096-256+14;
if ( (fpin=fopen(argv[1],"rb") ) == NULL ) {
printf("Can't open input file\n");
exit(1);
}
/*
* Now we try to determine the size of the file
* to be converted
*/
if (fseek(fpin,0,SEEK_END)) {
printf("Couldn't determine size of file\n");
fclose(fpin);
exit(1);
}
len=ftell(fpin);
fseek(fpin,0L,SEEK_SET);
if ( (fpout=fopen(argv[2],"wb") ) == NULL ) {
printf("Can't open output file\n");
exit(1);
}
for (i=0; i<len;i++) {
if (i==pos) {
for (x=0; x<8178;x++)
fputc(0,fpout);
}
c=getc(fpin);
fputc(c,fpout);
}
fclose(fpin);
fclose(fpout);
}
The only reason I can imagine to do so is to avoid using the memory space between 4096 and 12287, probably that 8k window is the graphics memory.