1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-01-09 13:33:26 +00:00
This commit is contained in:
David Schmenk 2022-12-21 14:45:47 -08:00
commit fe86c7e3f1
13 changed files with 62 additions and 26 deletions

Binary file not shown.

View File

@ -76,6 +76,7 @@ ROGUE = rel/ROGUE\#FE1000
ROGUEMAP = rel/ROGUEMAP\#FE1000
ROGUECOMBAT= rel/ROGUECOMBAT\#FE1000
MON = rel/apple/MON\#FE1000
CONIOTST = rel/apple/CONIOTST\#FE1000
TILETEST = rel/apple/TILETEST\#FE1000
HGRTEST = rel/apple/HGRTEST\#FE1000
GRTEST = rel/apple/GRTEST\#FE1000
@ -109,11 +110,11 @@ TXTTYPE = .TXT
#SYSTYPE = \#FF2000
#TXTTYPE = \#040000
apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(PLVMJIT03) $(CMD) $(CMDJIT) $(JIT) $(JIT16) $(JITUNE) $(SOSCMD) $(SOSCMDJIT) $(PLASMAPLASM) $(CODEOPT) $(ZIPCHIP) $(MATCHFILES) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(COPY) $(DEL) $(REN) $(CAT) $(NEWDIR) $(TYPE) $(SOS) $(ROD) $(SIEVE) $(PRIMEGAP) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(SFM) $(SFMSPRT) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRTILE) $(HGRFONT) $(HGRSPRITE) $(HGRLIB) $(TILETEST) $(HGRTEST) $(GRLIB) $(DGRLIB) $(GRTEST) $(DGRTEST) $(HGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(INT32) $(INT32TEST) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(LZ4) $(LZ4CAT) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ)
apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(PLVMJIT03) $(CMD) $(CMDJIT) $(JIT) $(JIT16) $(JITUNE) $(SOSCMD) $(SOSCMDJIT) $(PLASMAPLASM) $(CODEOPT) $(ZIPCHIP) $(MATCHFILES) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(COPY) $(DEL) $(REN) $(CAT) $(NEWDIR) $(TYPE) $(SOS) $(ROD) $(SIEVE) $(PRIMEGAP) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(SFM) $(SFMSPRT) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRTILE) $(HGRFONT) $(HGRSPRITE) $(HGRLIB) $(TILETEST) $(HGRTEST) $(GRLIB) $(DGRLIB) $(GRTEST) $(DGRTEST) $(HGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(INT32) $(INT32TEST) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(LZ4) $(LZ4CAT) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ) $(CONIOTST)
-rm vmsrc/plvmzp.inc
c64: $(PLVMZP_C64) $(PLASM) $(PLVM) $(PLVMC64)
c64: $(PLVMZP_C64) $(PLASM) $(PLVM) $(PLVMC64)
-rm vmsrc/plvmzp.inc
all: apple c64
@ -287,6 +288,11 @@ hello: samplesrc/hello.pla $(PLVM) $(PLASM)
./$(PLASM) -AMOW < samplesrc/hello.pla > samplesrc/hello.a
acme --setpc 4094 -o $(HELLO) samplesrc/hello.a
./$(PLVM) HELLO
$(CONIOTST): samplesrc/coniotst.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW < samplesrc/coniotst.pla > samplesrc/coniotst.a
acme --setpc 4094 -o $(CONIOTST) samplesrc/coniotst.a
$(ROD): samplesrc/rod.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW < samplesrc/rod.pla > samplesrc/rod.a
acme --setpc 4094 -o $(ROD) samplesrc/rod.a
@ -522,5 +528,3 @@ $(JIT16): libsrc/apple/jit16.pla libsrc/jit16core.pla $(PLVMJIT) $(PLASM)
$(JITUNE): utilsrc/apple/jitune.pla $(PLVMJIT) $(PLASM)
./$(PLASM) -AMOW < utilsrc/apple/jitune.pla > utilsrc/apple/jitune.a
acme --setpc 4094 -o $(JITUNE) utilsrc/apple/jitune.a

View File

@ -125,11 +125,12 @@ cp ../sysfiles/ELEMS.CODE#060000 prodos/fpsos/sys/ELEMS.CODE.BIN
rm -rf prodos/demos
mkdir prodos/demos
cp rel/INT32TEST#FE1000 prodos/demos/INT32TEST.REL
cp rel/apple/ROD#FE1000 prodos/demos/ROD.REL
cp rel/RPNCALC#FE1000 prodos/demos/RPNCALC.REL
cp rel/LZ4CAT#FE1000 prodos/demos/LZ4CAT.REL
cp rel/PRIMEGAP#FE1000 prodos/demos/PRIMEGAP.REL
cp rel/INT32TEST#FE1000 prodos/demos/INT32TEST.REL
cp rel/apple/CONIOTST#FE1000 prodos/demos/CONIOTST.REL
cp rel/apple/ROD#FE1000 prodos/demos/ROD.REL
cp rel/RPNCALC#FE1000 prodos/demos/RPNCALC.REL
cp rel/LZ4CAT#FE1000 prodos/demos/LZ4CAT.REL
cp rel/PRIMEGAP#FE1000 prodos/demos/PRIMEGAP.REL
mkdir prodos/demos/rogue
cp rel/ROGUE#FE1000 prodos/demos/rogue/ROGUE.REL
@ -178,6 +179,7 @@ cp rel/CODEOPT#FE1000 prodos/bld/CODEOPT.REL
mkdir prodos/bld/samples
cp samplesrc/hello.pla prodos/bld/samples/HELLO.PLA.TXT
cp samplesrc/int32test.pla prodos/bld/samples/INT32TEST.PLA.TXT
cp samplesrc/coniotst.pla prodos/bld/samples/CONIOTST.PLA.TXT
cp samplesrc/grtest.pla prodos/bld/samples/GRTEST.PLA.TXT
cp samplesrc/dgrtest.pla prodos/bld/samples/DGRTEST.PLA.TXT
cp samplesrc/hgrtest.pla prodos/bld/samples/HGRTEST.PLA.TXT

View File

@ -0,0 +1,31 @@
// text screen
include "inc/cmdsys.plh"
include "inc/conio.plh"
const SCR_PTR = $0400
const SCR_SIZE = 1024
byte[SCR_SIZE] ScrSave
byte I
word Name
// save text screen
memcpy(@ScrSave, SCR_PTR, SCR_SIZE)
conio:home()
for I=0 to 23
conio:gotoxy(I,I)
putc('A'+I)
putc(' ')
puti(I)
next
conio:gotoxy(10, 5)
puts("What is your name")
Name = gets('?'|$80) // $BF
conio:gotoxy(12, 7)
puts("Nice to meet you, ")
puts(Name)
conio:gotoxy(16, 10)
puts("Press any key ...")
getc()
conio:gotoxy(0, 5)
memcpy(SCR_PTR, @ScrSave, SCR_SIZE)
done

View File

@ -145,7 +145,6 @@ int idlocal_add(char *name, int len, int type, int size)
}
int idglobal_add(char *name, int len, int type, int size)
{
//char c;
if (globals > 1024)
{
printf("Global variable count overflow\n");
@ -162,9 +161,6 @@ int idglobal_add(char *name, int len, int type, int size)
return (0);
}
if (len > ID_LEN) len = ID_LEN;
//c = name[len];
//name[len] = '\0';
//name[len] = c;
idglobal_name[globals][0] = len;
while (len--)
idglobal_name[globals][1 + len] = toupper(name[len]);
@ -882,10 +878,10 @@ void emit_caseblock(int casecnt, int *caseof, int *casetag)
if (casecnt < 1 || casecnt > 256)
parse_error("Switch count under/overflow\n");
emit_pending_seq();
printf("\t%s\t$%02lX\t\t\t; CASEBLOCK\n", DB, casecnt & 0xFF);
printf("\t%s\t$%02X\t\t\t; CASEBLOCK\n", DB, casecnt & 0xFF);
for (i = 0; i < casecnt; i++)
{
printf("\t%s\t$%04lX\n", DW, caseof[i] & 0xFFFF);
printf("\t%s\t$%04X\n", DW, caseof[i] & 0xFFFF);
printf("\t%s\t_B%03d-*\n", DW, casetag[i]);
}
}

View File

@ -558,7 +558,7 @@ t_opseq *parse_value(t_opseq *codeseq, int rvalue, int *stackdepth)
parse_error("Using BYTE value as a pointer");
else
deref++;
type = (type & PTR_TYPE) | (scantoken == PTRB_TOKEN) ? BYTE_TYPE : WORD_TYPE; // Type override
type = (type & PTR_TYPE) | ((scantoken == PTRB_TOKEN) ? BYTE_TYPE : WORD_TYPE); // Type override
if (!parse_const(&const_offset))
{
/*

View File

@ -138,10 +138,13 @@ def parse_constval
is ID_TKN
size = 2
idptr = lookup_id(tknptr, tknlen)
type = idptr=>idtype
if not idptr; exit_err(ERR_INVAL|ERR_CONST); fin
type = idptr=>idtype
if type & (FUNC_TYPE|ADDR_TYPE)
if mod <> 8; exit_err(ERR_INVAL|ERR_CONST); fin
type = CONSTADDR_TYPE
elsif type <> CONST_TYPE
exit_err(ERR_INVAL|ERR_CONST)
fin
value = idptr=>idval
break
@ -1064,8 +1067,8 @@ def parse_struc#0
scan
end
def parse_vars(type)
byte idlen, size, cfnparms, cfnvals
word value, idptr
byte idlen, cfnparms, cfnvals
word size, value, idptr
when token
is SYSFLAGS_TKN

View File

@ -5,6 +5,7 @@ include "inc/longjmp.plh"
//
// Tokens
//
const ID_LEN = 32
const ID_TKN = $D6 // V
const CHR_TKN = $C3 // C
const INT_TKN = $C9 // I
@ -292,7 +293,6 @@ word lineno
//
// Parser variables
//
const ID_LEN = 32 // Significant ID characters
const LVALUE = 0
const RVALUE = 1
const LAMBDANUM = 16
@ -508,7 +508,7 @@ include "toolsrc/parse.pla"
//
// Look at command line arguments and compile module
//
puts("PLASMA Compiler, Version 2.0 ALPHA1\n")
puts("PLASMA Compiler, Version 2.0 ALPHA2\n")
arg = argNext(argFirst)
if ^arg and ^(arg + 1) == '-'
opt = arg + 2

View File

@ -52,7 +52,7 @@ byte perr, refauto
// String pool.
//
byte autorun[] = "AUTORUN"
byte verstr[] = "\nPLASMA ALPHA1"
byte verstr[] = "\nPLASMA ALPHA2"
byte freestr[] = "MEM FREE:$"
byte errorstr[] = "ERR:$"
byte prompt[] = "PLASMA"

View File

@ -1377,7 +1377,7 @@ heap = @lastdef
//
// Print PLASMA version
//
prstr("PLASMA 2.0 ALPHA1 64K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
prstr("PLASMA 2.0 ALPHA2 64K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
//
// Init symbol table.
//

View File

@ -1454,7 +1454,7 @@ heap = @lastdef
//
// Print PLASMA version
//
prstr("PLASMA 2.0 ALPHA1 128K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
prstr("PLASMA 2.0 ALPHA2 128K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
//
// Init symbol table.
//

View File

@ -1263,7 +1263,7 @@ cmdlnptr = @cmdln
// Print PLASMA version
//
init_cons
prstr("PLASMA 2.0 ALPHA1\n")//; putb(version.1); putc('.'); putb(version.0); putln
prstr("PLASMA 2.0 ALPHA2\n")//; putb(version.1); putc('.'); putb(version.0); putln
prstr("MEM:$"); prword(availheap); crout
//
// Exec command line parser

View File

@ -1286,7 +1286,7 @@ cmdlnptr = @cmdln
// Print PLASMA version
//
init_cons
prstr("PLASMA 2.0 ALPHA1 JITC\n")//; putb(version.1); putc('.'); putb(version.0); putln
prstr("PLASMA 2.0 ALPHA2 JITC\n")//; putb(version.1); putc('.'); putb(version.0); putln
prstr("MEM:$"); prword(availheap); crout
//
// Exec command line parser