1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 01:57:09 +03:00
Commit Graph

4 Commits

Author SHA1 Message Date
Joel Martin
4a445e8493 Basic: QBasic fixes.
- restructure memory dim/initialization to support QBasic which
  requires all DIMs to be earlier in the code than references to the
  DIM'd variables (unlike C64 which just requires the DIMs to be
  called first logically).
- Fix printed header ("C64 QBasic" -> "QBasic")
2016-12-21 13:51:26 -07:00
Joel Martin
7895453b77 Basic: various memory savings.
- simplify DO_CONCAT.
- inline MAL_READ/PRINT.
- comment out memory debug/sanity checks.
- more aggressive space removal.

Saves over 900 bytes.

Increase Z% value memory by 374 to 9216 (8192+1024).
2016-12-21 13:51:26 -07:00
Joel Martin
4202ef7bf1 Basic: miscellaneous memory savings.
- Use variables A1, A2, B2 for Z%(A+1), Z%(A+2), Z%(B+2) respectively.
- Replace Z%(R)=Z%(R)+32 with GOSUB INC_REF_R
- Add functions TYPE_A and TYPE_F for (Z%(A)AND 31) and (Z%(F)AND 31)
  respectively.
- Inline NATIVE_FUNCTION and MAL_FUNCTION.

All together saves over 500 bytes so increase Z% value memory by 250
entries.
2016-11-18 23:51:33 -06:00
Joel Martin
d7a6c2d6c9 Basic: refactor memory layout.
Use a one dimensional array for the Z% value array. This enables
lists, vectors, environments and metadata pointers to all save off
1 word (2 bytes) of space.

Split the memory init and functions into mem.in.bas.

In addition, change type 14 to be metdata rather than any type 16-31.

This change saves about 560 bytes (no second array dimension
subscripts) and reduces Z% value usage by 10%-15%.

Bump the number of Z% words by 200 (to 8591). This enables
self-hosting up to step7 (without step8-stepA functions in core.mal).
2016-11-18 01:26:23 -06:00