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:
Bobbi Webber-Manners 2018-05-11 01:05:43 -04:00 committed by GitHub
parent 19e341675e
commit e02674d8da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 288 additions and 306 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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
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
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
c1541 -format eb,00 d64 test.d64

Binary file not shown.

BIN
eightball

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -37,7 +37,7 @@
/* */
/**************************************************************************/
#define VERSIONSTR "0.65"
#define VERSIONSTR "0.66"
void print(char *str);

Binary file not shown.

View File

@ -2,7 +2,7 @@
' Recursive factorial function test
'
pr.dec fact(3); pr.nl
pr.dec fact(5); pr.nl
end
sub fact(word val)

View File

@ -2,12 +2,14 @@
pr.msg "Sieve of Eratosthenes ..."
byte A[30*30] = {}
const sz=30
const arrsz=sz*sz
byte A[sz*sz] = {}
word i = 0
for i = 0 : 30*30-1
for i = 0 : sz*sz-1
A[i] = 1
endfor
call doall(30, A)
call doall(sz, A)
end
sub doall(word nr, byte array[])

BIN
test.d64

Binary file not shown.

BIN
test.dsk

Binary file not shown.

View File

@ -297,6 +297,22 @@ call expect(iw==1)
call gp1()
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()
'------------------