Commit graph

45 commits

Author SHA1 Message Date
7639263bed Make TRANSFORM return OBJ if it's already TO-TYPE 2025-05-22 13:14:55 +02:00
1307e31268 Better handling of operators, source, and comments in tokenizer
...among other minor changes to accomodate the parser.
2025-05-22 13:14:55 +02:00
8acbf2caec Define more atomic tokens, and add shortcut macro for doing it 2025-05-22 13:14:55 +02:00
ae39a48890 Add PRINT-OBJECT method for TOKEN-NAME 2025-05-22 13:14:55 +02:00
25fd7675d0 Rename TOKEN-NAME's TEXT slot to NAME to match TOKEN-KEYWORD 2025-05-22 13:14:55 +02:00
45a66ce323 Give tokens an INITFORM for SOURCE (to NIL) 2025-05-22 13:14:55 +02:00
5a18cc9864 Make NODE-DOTIMES hold a counter variable 2025-05-22 13:14:55 +02:00
6b74c0247e Move and rename syntax-example.txt 2025-05-22 13:14:55 +02:00
e6e2e94404 Add symbol table 2025-05-16 21:00:57 +02:00
0867e99cc1 Various messes 2025-05-16 21:00:14 +02:00
5d0f4b4767 Move definition of REFERENCE classes to its own file
Dereferencing is still defined in high-level.lisp, this might change
in the future since I'm sort of restructuring a little bit.
2025-05-16 21:00:14 +02:00
449e36e183 Add reference equality test (only implemented for constants so far) 2025-05-16 21:00:14 +02:00
e88e966521 Add mechanism for transforming objects to different types 2025-05-16 21:00:14 +02:00
3211f6d441 Add primitive tokenizer for USC 2025-05-16 12:31:18 +02:00
b9bda5ad68 Add missing RELATIVE-MIXIN 2025-05-16 12:31:18 +02:00
53002f2b8a Slight syntax adjustment
I just couldn't stand "dotimes x 200", and "for x do 200 times" just
feels so much nicer. I also added a space after an opening parenthesis
to ensure that my tokenizer gets to eat this particular type of
unnecessary but permitted whitespace.
2025-05-16 12:31:18 +02:00
bc3e07356e Add a USC test program 2025-05-16 10:39:03 +02:00
3878b57848 Add syntax example 2025-05-16 10:39:03 +02:00
c336e43c19 Add bytesquashing (turning instructions etc. into dead bytes) 2025-05-08 22:18:57 +02:00
010cc5dd87 Make FIX-LABEL-ADDRESSES-IN-INSTRUCTION-LIST add PROGRAM_END label 2025-05-08 22:18:57 +02:00
9d2d0dea6b Fix instruction redefinition and add some opcodes 2025-05-08 22:18:57 +02:00
184d0324c0 Fix broken INSTRUCTION-LENGTH 2025-05-08 22:18:57 +02:00
31bb5f8509 Add offset label class 2025-05-08 22:18:57 +02:00
15a70836ac Add temporary ARGVEC and VARVEC definitions 2025-05-08 22:18:57 +02:00
4a4a7b8485 Add LABELP predicate 2025-05-08 22:18:57 +02:00
379d33d5a1 Move label name + prefix warning to the right place 2025-05-08 22:18:57 +02:00
eec5edc715 Correct instruction length of immediates 2025-05-08 22:18:57 +02:00
d9673915a5 Add public.inc
That revert before? I was kidding, I concede nothing! I win! (i.e. we
talked for a while and both decided that an argument vector was better
after all)
2025-05-08 21:17:09 +02:00
37b2864a7d Add function to compute addresses of labels in instruction list 2025-05-08 19:36:10 +02:00
501da2341e Bind *LABEL-COUNTER* to 0 at the start of compiling 2025-05-08 19:33:31 +02:00
bcc039774b Move *LABEL-COUNTER* to label.lisp 2025-05-08 19:33:13 +02:00
5ca740efa9 Add PRODUCE-COMMENT 2025-05-08 19:32:54 +02:00
8dd78265b4 Nicer instruction printing 2025-05-08 19:32:43 +02:00
41bd413b4c Add LABEL class and replace uses of temporary strings with it 2025-05-08 19:10:38 +02:00
76f1fa0658 Add relative addressing type for branches 2025-05-08 19:10:15 +02:00
37241a1fc3 Replace the text assembly in high-level with instruction objects 2025-05-08 17:11:57 +02:00
0a3675feac Turn the user-side compiler into a proper ASDF system 2025-05-03 12:22:56 +02:00
fd5a8fac4f Add check so zero-page instructions can't use too big operands 2025-05-02 22:38:35 +02:00
19b9feb02d Begin serious work on User-Side Compiler (USC) 2025-05-02 22:26:29 +02:00
6f0b19720d Add method for compiling nodes following the NEXT chain 2025-03-28 11:47:27 +01:00
dc80e6e1e3 Nicer printing of nodes and references
References print shorter and show their contents, call nodes now show
what they're calling and with what arguments. Additionally, generated
code for a node starts with a comment of the node as printed.
2025-03-28 11:46:03 +01:00
dd32f294d0 Correct typo in NODE-DOTIMES definition 2025-03-27 23:39:09 +01:00
4918124361 Clarify comments in GENERATE-CODE for NODE-BRANCH 2025-03-27 23:36:15 +01:00
39cf0b54cb Use real tabs in FORMAT-INST 2025-03-27 23:02:43 +01:00
b22f043523 Proof of concept compiler
Compiles hand-created nodes for subroutine calls, forward branching,
and fixed-length looping into textual 6502 assembly code. Currently
only outputs this code to standard output for inspection.
2025-03-27 22:40:56 +01:00