mirror of
https://github.com/bobbimanners/EightBall.git
synced 2024-10-19 23:23:49 +00:00
v0.66: Refactoring, added const support
- New keyword `const` - `const` values are supported as array dimensions and variable.array initializers - Refactored code and saved several 100 bytes - Compiler generates better VM code for array allocation
This commit is contained in:
parent
19e341675e
commit
e02674d8da
BIN
8ball20.prg
BIN
8ball20.prg
Binary file not shown.
BIN
8ball64.prg
BIN
8ball64.prg
Binary file not shown.
BIN
8ballvm20.prg
BIN
8ballvm20.prg
Binary file not shown.
BIN
8ballvm64.prg
BIN
8ballvm64.prg
Binary file not shown.
4
Makefile
4
Makefile
@ -90,10 +90,10 @@ ebvm.system: eightballvm_a2e.o eightballutils_a2e.o
|
|||||||
$(CC65BINDIR)/ld65 -m 8ballvma2e.map -o ebvm.system -C apple2enh-system.cfg eightballvm_a2e.o eightballutils_a2e.o apple2enh-iobuf-0800.o $(CC65LIBDIR)/apple2enh.lib
|
$(CC65BINDIR)/ld65 -m 8ballvma2e.map -o ebvm.system -C apple2enh-system.cfg eightballvm_a2e.o eightballutils_a2e.o apple2enh-iobuf-0800.o $(CC65LIBDIR)/apple2enh.lib
|
||||||
|
|
||||||
unittest.8bp: unittest.8b
|
unittest.8bp: unittest.8b
|
||||||
tr \\100-\\132 \\300-\\332 <unittest.8b | tr \\140-\\172 \\100-\\132 > unittest.8bp # ASCII -> PETSCII
|
tr {} [] <unittest.8b | \\100-\\132 \\300-\\332 | tr \\140-\\172 \\100-\\132 > unittest.8bp # ASCII -> PETSCII
|
||||||
|
|
||||||
sieve4.8bp: sieve4.8b
|
sieve4.8bp: sieve4.8b
|
||||||
tr \\100-\\132 \\300-\\332 <sieve4.8b | tr \\140-\\172 \\100-\\132 > sieve4.8bp # ASCII -> PETSCII
|
tr {} [] <sieve4.8b | tr \\100-\\132 \\300-\\332 | tr \\140-\\172 \\100-\\132 > sieve4.8bp # ASCII -> PETSCII
|
||||||
|
|
||||||
test.d64: 8ball20.prg 8ballvm20.prg 8ball64.prg 8ballvm64.prg unittest.8bp sieve4.8bp
|
test.d64: 8ball20.prg 8ballvm20.prg 8ball64.prg 8ballvm64.prg unittest.8bp sieve4.8bp
|
||||||
c1541 -format eb,00 d64 test.d64
|
c1541 -format eb,00 d64 test.d64
|
||||||
|
BIN
ebvm.system
BIN
ebvm.system
Binary file not shown.
562
eightball.c
562
eightball.c
File diff suppressed because it is too large
Load Diff
BIN
eightball.system
BIN
eightball.system
Binary file not shown.
@ -37,7 +37,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
#define VERSIONSTR "0.65"
|
#define VERSIONSTR "0.66"
|
||||||
|
|
||||||
void print(char *str);
|
void print(char *str);
|
||||||
|
|
||||||
|
BIN
eightballvm
BIN
eightballvm
Binary file not shown.
2
fact.8b
2
fact.8b
@ -2,7 +2,7 @@
|
|||||||
' Recursive factorial function test
|
' Recursive factorial function test
|
||||||
'
|
'
|
||||||
|
|
||||||
pr.dec fact(3); pr.nl
|
pr.dec fact(5); pr.nl
|
||||||
end
|
end
|
||||||
|
|
||||||
sub fact(word val)
|
sub fact(word val)
|
||||||
|
@ -2,12 +2,14 @@
|
|||||||
|
|
||||||
pr.msg "Sieve of Eratosthenes ..."
|
pr.msg "Sieve of Eratosthenes ..."
|
||||||
|
|
||||||
byte A[30*30] = {}
|
const sz=30
|
||||||
|
const arrsz=sz*sz
|
||||||
|
byte A[sz*sz] = {}
|
||||||
word i = 0
|
word i = 0
|
||||||
for i = 0 : 30*30-1
|
for i = 0 : sz*sz-1
|
||||||
A[i] = 1
|
A[i] = 1
|
||||||
endfor
|
endfor
|
||||||
call doall(30, A)
|
call doall(sz, A)
|
||||||
end
|
end
|
||||||
|
|
||||||
sub doall(word nr, byte array[])
|
sub doall(word nr, byte array[])
|
||||||
|
16
unittest.8b
16
unittest.8b
@ -297,6 +297,22 @@ call expect(iw==1)
|
|||||||
call gp1()
|
call gp1()
|
||||||
call expect(iw==1)
|
call expect(iw==1)
|
||||||
|
|
||||||
|
'------------------
|
||||||
|
' Consts
|
||||||
|
'------------------
|
||||||
|
pr.msg "Consts:"; pr.nl
|
||||||
|
const cstsz=10
|
||||||
|
word AAA[cstsz]={}
|
||||||
|
byte iii=0
|
||||||
|
word summ=0
|
||||||
|
for iii=0:cstsz-1
|
||||||
|
AAA[iii]=10
|
||||||
|
endfor
|
||||||
|
for iii=0:cstsz-1
|
||||||
|
summ=summ+AAA[iii]
|
||||||
|
endfor
|
||||||
|
call expect(summ==cstsz*10)
|
||||||
|
|
||||||
'------------------
|
'------------------
|
||||||
call done()
|
call done()
|
||||||
'------------------
|
'------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user