2018-08-07 01:55:07 +00:00
# COMMON
2018-08-07 11:03:21 +00:00
2018-08-07 11:15:24 +00:00
Advances some ideas using Steve Wozniak’ s 6502 SWEET16 interpreted byte-code language as inspiration. While the goal of SWEET16 was brevity, the goal of COMMON is functionality. The intent is to make a platform suitable for many commercial, scientific, and engineering applications.
2018-08-07 02:02:52 +00:00
2018-08-07 10:38:40 +00:00
For example:
2018-08-07 02:11:51 +00:00
2018-08-15 12:02:31 +00:00
* native type is equivalent to fixed-point decimal ±######.###
2018-08-07 10:38:40 +00:00
* easier support for banked memory
* easier support for higher language compilers
* arithmetic operations add, subtract, multiply, divide, and modulus
* inherent overflow/underflow detection
2018-08-07 10:48:12 +00:00
* all control branching is 16-bit relative, for easier relocatable code
2018-08-07 12:06:28 +00:00
* support for custom system/user functions, akin to INT in x86
2018-08-07 02:10:00 +00:00
2018-08-07 10:38:40 +00:00
Why 6502 and not, for example, x86?
* 6502 assembler is very easy and has a large archive of existing functions
2018-08-07 11:15:24 +00:00
* existing 6502 SWEET16 already has the “hard work” done
2018-08-23 23:43:33 +00:00
* interesting to see it run in newer faster versions of 6502 processors
2018-08-07 10:38:40 +00:00
* how do you think Bender does what he does? (or the Terminator!)
In progress:
2018-09-18 00:39:49 +00:00
* added all the instructions (see `common/common.h` for the list)
In progress:
* a unit test suite to ensure each instruction is correct
* a proof-of-concept application
2018-08-07 10:38:40 +00:00
The meat of the project:
* `common/common.h` : details of instructions
2018-08-07 11:07:36 +00:00
* `common/common.asm` : assembler code for the instructions
* `common/macros.h` : macros used to define the interpreted byte-code
2018-08-07 10:38:40 +00:00
* `common/page6.src` : sample source file using the macros
Auxiliary:
2018-08-07 11:15:24 +00:00
* `emulator/*` : 6502 emulator (borrowed Mike Chambers’ Fake6502 CPU emulator v1.1 ©2011)
2018-08-23 23:43:33 +00:00
* `xa-pre-process/*` : my utility `xapp` to convert 32-bit fixed decimal quantities so that `xa` can use them
2018-08-07 10:38:40 +00:00
2018-08-07 11:11:15 +00:00
Right now, for testing purposes, the code builds everything into one file `system.obj` and runs the code in the last block loaded, in this case, the code corresponding to `page6.src` . Eventually will support decoupling of system and application files. Application files will be inherently relocatable.
2018-08-07 10:38:40 +00:00
2018-08-07 11:03:21 +00:00
To build and run:
2018-08-07 10:38:40 +00:00
2018-08-15 12:02:31 +00:00
make all
2018-08-07 10:38:40 +00:00
make run
2018-09-08 15:00:19 +00:00
The makefiles use `re2c` , `flex` , `bison` , `gcc` , `cpp` , `xa` , `grep` , and `sed` . Will eventually provide a `./configure` .