Commit Graph

190 Commits

Author SHA1 Message Date
Devine Lu Linvega acf79df9d5 (uxnasm) Keep global token for error 2024-03-25 15:20:43 -07:00
Devine Lu Linvega 858b38b967 (uxnasm) Optimizations 2024-03-25 15:09:56 -07:00
Devine Lu Linvega 3777f30281 (uxnasm) Removed writelitbyte 2024-03-25 14:58:45 -07:00
Devine Lu Linvega 0c13a40916 Abstracted isopcode 2024-03-25 14:48:37 -07:00
Devine Lu Linvega 6fdc6e6791 (uxnasm) Improved lambda symbols 2024-03-25 14:21:16 -07:00
Devine Lu Linvega 8cccc5c919 (uxnasm) Print assembly result to stdout 2024-03-07 21:00:42 -08:00
Devine Lu Linvega c39f8f20dd Swapped order of referencing 2024-03-06 08:59:14 -08:00
Devine Lu Linvega 225faa73f0 (uxnasm) Stop after hitting refcount limit 2024-03-06 08:49:16 -08:00
Devine Lu Linvega c3c140b5e9 Added deprecated warning for : rune 2024-03-03 15:31:37 -08:00
Devine Lu Linvega c5d8ba4e3a Mute scope reporting in resolve loop 2024-03-02 08:43:19 -08:00
Devine Lu Linvega d322e787fa (uxnasm) Print scope on error 2024-03-01 17:37:36 -08:00
Devine Lu Linvega a5ff070dd0 (uxnasm) Only display location in internal errors 2024-03-01 17:26:49 -08:00
Devine Lu Linvega 80e2f9cc0c (uxnasm) Print active file in error 2024-03-01 17:24:17 -08:00
Devine Lu Linvega 7fc1b0887f (uxnasm) Fixed crashing but on no-output 2024-02-25 17:37:03 -08:00
Devine Lu Linvega 9f1df5f944 (uxnasm) Disallow runic labels 2024-02-25 17:23:49 -08:00
Devine Lu Linvega 202ca78800 (uxnasm) Added support for partial label jsi 2024-02-25 16:06:54 -08:00
Devine Lu Linvega 0dffbf6c0e (uxnasm)Passing uxntal scope requirements 2024-02-24 08:49:32 -08:00
neauoire 6bdb6ca168 Optimized core 2023-11-09 13:46:10 -08:00
Capital 76732db18a (uxnasm.c) Add check for missing output file 2023-11-04 19:04:08 -07:00
neauoire 85d22bbb90 (uxnasm) Date 2023-10-27 08:43:48 -07:00
Remko Tronçon cff5746e03 (uxnasm.c) Support outputting to stdout using `-` 2023-10-27 08:42:41 -07:00
neauoire a11660f57d (uxnasm.c) Fixed issue with lambda 2023-08-08 16:46:35 -07:00
neauoire d15b2367f3 (uxnasm.c) Added comma after date 2023-08-08 16:39:33 -07:00
neauoire c26de05efa Added version to uxnasm 2023-08-08 16:35:35 -07:00
neauoire 2ddc20b1b6 (uxnasm) Generalized lambdas as common labels 2023-08-02 19:48:48 -07:00
Devine Lu Linvega 3a8cc42e0e Better labels for lambdas 2023-07-29 16:24:39 -07:00
Devine Lu Linvega 32cc690539 (uxnasm) Lambdas support 2023-07-29 16:14:19 -07:00
Devine Lu Linvega fe10cfecef Improved usage standard message 2023-06-08 09:47:18 -07:00
Devine Lu Linvega 00ed056e51 (uxnasm) Added support for label sized pads 2023-04-04 20:02:33 -07:00
Devine Lu Linvega ea0d81a9b1 (uxnasm) Fixed refs limit check 2023-03-01 11:46:44 -08:00
Devine Lu Linvega 85df5f2d36 (uxnasm) Fixed issue with makeref() 2023-02-28 21:47:45 -08:00
Devine Lu Linvega e327373950 Increased refs limit 2023-01-21 18:24:11 -08:00
Devine Lu Linvega cfeeb85712 Catch invalid sublabels 2023-01-14 15:08:40 -08:00
Devine Lu Linvega ffb0a9c9bc (uxnasm.c) Auto-start at 0x100 2023-01-13 10:14:20 -08:00
Devine Lu Linvega a5442ea4fd (uxn.c) Swapped JMI/JCI 2023-01-12 09:44:27 -08:00
Devine Lu Linvega 5e1c896554 (uxnasm) endian-agnostic handling of symbols file writing 2023-01-12 08:40:33 -08:00
Andrew Alderwick f202944566 Make JMI, JCI and JSI relative. 2023-01-12 13:22:21 +00:00
Andrew Alderwick 7490666878 (uxnasm) Simplify handling of references. 2023-01-12 13:15:07 +00:00
Devine Lu Linvega e0c2da0700 (uxnasm) Use correct address in symbol export 2023-01-11 21:01:56 -08:00
Devine Lu Linvega a1bc00ce5f (uxnasm) Fixed buffer overflow in tokenizer 2023-01-07 11:59:00 -08:00
Devine Lu Linvega 0e7137e016 (uxnasm) Experimental implementation of JM/JC/JS runes 2023-01-02 17:45:06 -08:00
Andrew Alderwick c2b0667496 Update Copyright years. 2023-01-02 14:40:23 +00:00
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
Andrew Alderwick d4e033e715 Remove vestigial mention of "include". 2021-11-18 00:14:15 +00:00
Andrew Alderwick c3ac41c41d Change "include" word into ~ rune for includes. 2021-11-17 22:06:00 +00:00
Sigrid Solveig Haflínudóttir 4988b2214e
uxnasm: reset scope to avoid pointing at garbage 2021-11-08 18:51:28 +01:00
Andrew Alderwick 80b4e4f88d Use Keep mode for all LIT opcodes 2021-10-30 00:28:33 +01:00
Devine Lu Linvega 6f872feff5 Use Keep modes for byte and short literals 2021-10-29 16:02:07 -07:00
Devine Lu Linvega 8132a09e21 Test for valid destination in uxnasm 2021-10-29 09:29:23 -07:00
Claude Heiland-Allen 33e77e261c uxnasm errors-out if too many macros 2021-10-26 09:55:57 -07:00
Claude Heiland-Allen a373939544 uxnasm errors-out if too many labels 2021-10-26 09:54:29 -07:00