Commit Graph

98 Commits

Author SHA1 Message Date
Devine Lu Linvega 794ce1bdfd Housekeeping 2023-01-01 13:40:58 -08:00
Sigrid Solveig Haflínudóttir 6317b5cf18 fix uxnasm: missing semicolon 2022-12-11 04:54:58 +01:00
neauoire c97aa87faf (uxnasm)Allow more space for symbols filename, and check for length 2022-12-10 11:07:45 -08:00
neauoire 2f3954d398 Uxnasm should use BE to store addresses 2022-12-09 12:52:34 -08:00
neauoire d4c55e2f48 Uxnasm now outputs a symbols file 2022-12-09 12:30:04 -08:00
neauoire f59b214ac1 Added _rune 2022-11-10 20:54:53 -08:00
neauoire da5e581442 (uxnasm) Fixed issue with = rune 2022-11-09 16:40:07 -08:00
neauoire 261b574671 (uxnasm) Added support for = and - runes 2022-11-09 16:21:07 -08:00
Devine Lu Linvega f348d24606 Removing rawchr run 2022-08-14 12:06:23 -07:00
Devine Lu Linvega ef30fb8f8e Removed JSR JMP2r tail-call optimisations for now 2022-08-06 11:05:16 -07:00
Andrew Alderwick 978713474a (uxnasm) Prevent tail call optimisation when required, fixes asma
Literals do not get squashed across absolute or relative pads and
labels, now the tail call optimisations do not occur under the same
conditions. etc/asma-test.tal was identifying serious errors with
asma.rom, which uses "JSR2 &skip JMP2r" in @asma-macro-body.
2022-06-07 20:03:12 +01:00
Andrew Alderwick 0ff2a3586d Deal with compiler warnings. 2022-06-07 19:39:43 +01:00
Devine Lu Linvega 0fafd652f1 (uxnasm) Better parent label reference counting 2022-06-06 09:42:26 -07:00
Devine Lu Linvega bf81d07113 (uxnasm)Quiet label warnings with sublabels 2022-06-06 07:57:29 -07:00
phoebos a014cd8da9 (uxnasm) only ignore [ or ] if it is a whole token
Currently, tokens beginning with a [ or ] character are completely
ignored, which forbids a macro from beginning with these characters.
Specifically, a macro can be declared eg. as `%[x { ... }` but cannot be
dereferenced as `[x`.
This patch only ignores these tokens if they have a length of 1;
otherwise the switch falls through to the default case.
2022-06-05 16:29:06 -07:00
Devine Lu Linvega 17fd40af43 (uxnasm) Minor cleanup 2022-05-31 14:04:54 -07:00
Devine Lu Linvega 18b73f4861 (uxnasm)Optimize tail-call for subroutines too 2022-05-31 13:55:00 -07:00
Devine Lu Linvega 3c06af41c3 Tiny change to uxnasm 2022-05-31 13:38:21 -07:00
Devine Lu Linvega 5a0e0c56aa Added tail-call optimization 2022-05-26 20:26:21 -07:00
Andrew Alderwick e00e74b9d0 (uxnasm) Raise an error if the output rom would be empty. 2022-05-09 21:13:28 +01:00
Andrew Alderwick d5253086b5 Move stack opcodes. 2022-04-18 09:45:33 +01:00
Andrew Alderwick c2ffe63cc3 (uxnasm) Fix valid macro names being rejected.
Macro names that begin with the name of an opcode were being rejected
incorrectly. “STA” would not be a valid macro name since it is an
opcode, but “STACK” should be fine.
2022-04-14 18:24:48 +01:00
neauoire d49981c4ce Removed runes 2022-04-11 17:27:33 -07:00
neauoire a3c42c23b9 Fixed issue with oprunes 2022-04-11 17:16:05 -07:00
neauoire dcc37fd0d5 Added logic/arithmetic symbols to uxnasm 2022-04-11 16:07:15 -07:00
neauoire 60315ff3dc Raised label limit in uxnasm 2022-04-11 15:34:53 -07:00
Andrew Alderwick 0c819b9f59 clang-format 2022-02-19 01:02:47 +00:00
Andrew Alderwick 550aceee23 (uxnasm) Allow writing the 0xffff byte of RAM. 2022-02-19 00:29:40 +00:00
Andrew Alderwick 8b84813c6e (uxnasm) Raise error when memory is overwritten. 2022-02-19 00:27:28 +00:00
Andrew Alderwick da4f0e70a5 (uxnasm) Allow returning errors from writebyte(). 2022-02-19 00:26:55 +00:00
Andrew Alderwick 0ae6992089 (uxnasm) Fix calculation of usage. 2022-02-18 23:02:42 +00:00
Andrew Alderwick 2a825de2fd Switch void context increments from pre to post 2022-01-04 02:05:32 +00:00
Sigrid Solveig Haflínudóttir 148dae4ebd fix a few "set and not used" warnings 2021-12-29 18:33:23 +01:00
neauoire 385fa44f9d Prefixed globals with uxn_ 2021-12-29 09:11:03 -08:00
~d6 abd6a3a5da Support nested comments in uxnasm.
Previously, code like this would fail with an error
about an unrecognized ) token:

    ( this is a ( nested ) comment )

With this patch, the above code will now work.

Relatedly, it was previously possible to write code
that compiled but was confusing:

    (open parenthesis should have a space )
    ( in this case the ADD2 will be ignored )ADD2
    ( this comment with ( would have been fine )

With this commit, the first example will emit a warning
but continue to work as intended. The second and third
examples will continue searching for a matching ) token,
which due to the new nested coment behavior will probably
mean the rest of the file gets commented out.
2021-12-28 19:28:15 -08:00
Andrew Alderwick 2330320985 (readability) Use preincrements throughout in void context. 2021-12-14 23:17:32 +00:00
neauoire bae2d37fc2 (uxnasm) Only catch hex labels with slen of 2 or 4 2021-12-06 09:01:48 -08:00
Andrew Alderwick 60f04ca053 (uxnasm) Add error for relative references that are too far. 2021-12-01 11:42:44 +00:00
neauoire da797b33c6 (uxnasm) Stop on resolve failure 2021-11-30 10:27:35 -08:00
neauoire 074a049ff2 (uxnasm) Renamed conflicting function 2021-11-29 16:19:47 -08:00
neauoire 25df420607 (uxnasm) Improved errors 2021-11-29 08:48:12 -08:00
Andrew Alderwick 6ba2af5c62 Avoid combining literals across | or $ pads. 2021-11-28 18:07:22 +00:00
neauoire 6c0e39ad6f (uxnasm) Fixed issue with labels 2021-11-27 14:58:37 -08:00
neauoire b4e50165b6 (uxnasm) Warn for refs size limit 2021-11-27 14:44:28 -08:00
neauoire 78853ac5c6 (uxnasm) Removed lit flag for writebyte 2021-11-27 14:20:56 -08:00
neauoire fbbddf50d6 (uxnasm) Cleanup 2021-11-27 14:07:25 -08:00
neauoire 4b6efa6fc6 (uxnasm) Combine byte literals 2021-11-27 13:55:33 -08:00
neauoire 71e8177657 (uxnasm) Rewrite 2021-11-27 11:33:22 -08:00
neauoire b873f04789 Added tal syntax highlight for nano 2021-11-26 08:11:18 -08:00
Devine Lu Linvega 088897c6b4 (uxnasm) Display exact numberof bytes 2021-11-24 17:12:01 -05:00