Commit Graph

14 Commits

Author SHA1 Message Date
Kitty-Cricket Piapiac f25f1b8176 as:absorb`libu',fix,fmt,switch from table to BST
this mostly switches from using a resizeable hash table to store macros
and whatnot to using a binary search tree (i was having some heisenbugs
with the hash table that i didn't really feel like debugging it).
a BST has a simpler implementation and uses a bit less memory, however
it is potentially slower (O(log n) vs O(1)) & less cache performant

however, currently i care more about ease of implementation so i can
muck about with my impl without running into bugs. when i care more
about performance i will probably revert this change (or rewrite a
working hash table), but not without benchmarks
2023-04-13 14:32:50 -07:00
Kitty-Cricket Piapiac 4486db6b53 as:no need to write to file if no data specified
ie -org #0000 -org #2000 doesn't automatically set the rom filesize
to #2000 anymore unless something is written after -org #2000
2023-04-05 22:52:28 -07:00
Kitty-Cricket Piapiac 62453d6377 kmm32(isa):keep flag
as:$ keep flag

keep flag, whether to decrement the stack pointers for
the arguments used in the instruction
e.g. (a--n) --> (a--a n)

this is useful in situations where we want to keep the
arguments on the stack to do something else with, e.g.
a lot of the times we'll do `du fb` or something. now
we can save bytes and just do `$fb`. yippee!
2023-04-04 01:21:07 -07:00
Kitty-Cricket Piapiac 4a2f26ac46 as:add relative addresses (^ literal)
{d/kmm32-as,s/vim}:{document,highlight} ^ literal

this allows us to create relative addresses easily
eg. `pr ^l ju :l ;` & `pw @l ju :l ;` are equivelant

this also enables us to easily make pascal-style (?)
length-prefixed strings, given the string size is <127:
`:str ^l "meow" :l ; ;`
2023-04-03 01:16:56 -07:00
Kitty-Cricket Piapiac 7d8fc24c8f kmm32(isa):add pr instruction
`pr x` (where x is a byte) puts ip+(int8)x onto the stack
eg. `pr #04 ju xx yy zz` skips bytes xx&yy and jumps to zz
         0  1  2  3  4
         ^
         +- relative to

this allows us to cut down by a full 3 bytes when referring
to labels that are closer than 128 bytes away, and allows
us to relocate less labels
(if we ever have relocatable binaries or something)
2023-03-31 21:05:22 -07:00
Kitty-Cricket Piapiac 48a9197068 as:fix -inc bug&fmt 2023-03-29 13:40:32 -07:00
Kitty-Cricket Piapiac 58ccad23c0 as:first -org sets output origin
should be #0100 for ROMs
2023-03-28 10:04:14 -07:00
Kitty-Cricket Piapiac 897e9c20c0 kmm32:put sw before du and ov 2023-03-26 15:13:08 -07:00
Kitty-Cricket Piapiac 29cbf8e082 kmm32:add F flag,mr+md-->ss
as:~-->F flag
x:update examples
d:update documentation for kmm32
2023-03-26 15:02:27 -07:00
Kitty-Cricket Piapiac 69d31978ad as:add namespaced labels 2023-03-23 02:34:54 -07:00
Kitty-Cricket Piapiac f4b062cfc6 as:dont cd,add -inc 2023-03-21 14:07:29 -07:00
Kitty-Cricket Piapiac 9b85fb2c56 liba:xcd 2023-03-21 13:46:10 -07:00
Kitty-Cricket Piapiac ba5bc4cc2e as:add -emb,kip-io:actually add disk 2023-03-21 13:29:33 -07:00
Kitty-Cricket Piapiac d3df23a43d restructure 2023-03-17 14:25:20 -07:00
Renamed from t/kmm32-as.c (Browse further)