1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-14 14:08:06 +11:00
Commit Graph

24 Commits

Author SHA1 Message Date
Virgil Dupras
6e714875dc zasm: Constants now override labels at all times
Will be important for a mega-commit I'm preparing.
2019-11-14 21:16:36 -05:00
Clanmaster21
cca3157c66 addHL and subHL affect flags, and are smaller (#30)
* addHL and subHL affect flags, and are smaller

Most importantly, addHL and subHL now affect the flags as you would expect from a 16 bit addition/subtraction. This seems like it'd be preferred behaviour, however I realise any code relying on it not affecting flags would break. One byte saved in addHL, and two bytes saved in subHL. Due to the branching nature of the original code, it's difficult to compare speeds, subHL is either 1 or 6 cycles faster depending on branching, and addHL is between -1 and 3 cycles faster. If the chance of a carry is 50%, addHL is expected to be a cycle faster, but for a chance of carry below 25% (so a < 0x40) this will be up to a cycle slower.

* Update core.asm

* Reworked one use of addHL

By essentially inlining both addHL and cpHLDE, 100 cycles are saved, but due to the registers not needing preserving, a byte is saved too.

* Corrected spelling error in comment

* Reworked second use of addHL

43 cycles saved, and no more addHL in critical loops. No bytes saved or used.

* Fixed tabs and spacing, and made a comment clearer.

* Clearer comments

* Adopted push/pop notation
2019-10-17 16:45:27 -04:00
Virgil Dupras
1c6a7caeae recipes/sms/romasm: make zasm's memory usage fit the SMS 2019-07-23 16:50:19 -04:00
Virgil Dupras
1dec33e02a zasm: make symbol registry a bit more straightforward
Instead of strings of variable length driving the iteration of the
registry, we do so through records that keep track of lengths and
counts.
2019-07-23 15:21:42 -04:00
Virgil Dupras
cc7a4bae58 zasm: improve .equ duplicate detection handling
Things are a bit more straightforward now.
2019-07-23 14:00:01 -04:00
Virgil Dupras
9ea72dc1d0 zasm: add separate symbol registry for constants
This will allow me to make the ".org" treatment a bit less murky.
2019-07-23 13:59:55 -04:00
Virgil Dupras
b95f4c8c24 zasm: remove SYM_CTX_PTR 2019-07-22 16:34:40 -04:00
Virgil Dupras
f4f91ebd79 zasm: remove SYM_CTX 2019-07-22 16:13:00 -04:00
Virgil Dupras
311d04e9aa zasm: make symbol registry easily parametrizable
I'm about to split the global registry in two (labels and consts)
and the previous state of registry selection made things murky.
Now it's much better.
2019-07-22 15:13:09 -04:00
Virgil Dupras
fe15bafeca zasm: fix bug with registry selection
During expression parsing, if a local label was parsed, it would
select the local registry and keep that selection, making
subsequent global labels register in the wrong place.
2019-07-20 18:07:52 -04:00
Virgil Dupras
e414e600ea zasm: add ERR_DUPSYM and ERR_OOM error conditions 2019-05-27 17:45:05 -04:00
Virgil Dupras
acddb045a5 zasm: add support for .org directive 2019-05-19 14:40:42 -04:00
Virgil Dupras
3b1ef2b9af zasm: bump global symbol limit to 0x200 2019-05-19 09:54:42 -04:00
Virgil Dupras
98695f9912 zasm: de-index symRegister
Make symRegister's logic pointer-based so we can break through the 0x100
limit.
2019-05-19 09:06:24 -04:00
Virgil Dupras
29f0bcbe23 zasm: can now assemble zasm/symbol.asm! 2019-05-18 18:56:27 -04:00
Virgil Dupras
072aad775a zasm: don't match prefixes in symFind
Only match when full names match.
2019-05-17 13:14:16 -04:00
Virgil Dupras
7083116379 zasm: remove JUMP_ prefixes
They serve no purpose and make the code less flexible.
2019-05-17 09:50:11 -04:00
Virgil Dupras
0ae91e55ec zasm: big local symbols overhaul 2019-05-16 08:26:00 -04:00
Virgil Dupras
a2b5b1efab zasm: add one layer of indirection in symbol registry
We'll need it for an upcoming "local labels" registry.
2019-05-15 14:30:41 -04:00
Virgil Dupras
2de69ee7cd zasm: add support for local labels 2019-05-13 20:23:10 -04:00
Virgil Dupras
17dbee6a49 zasm: deduplicate code 2019-05-13 19:47:34 -04:00
Virgil Dupras
746c86cbf8 zasm: make getSymVal not responsible for calling symFind
With local labels, these two will have to be decoupled.
2019-05-13 16:53:52 -04:00
Virgil Dupras
c000d5cfb1 zasm: support forward label references! 2019-05-10 21:14:46 -04:00
Virgil Dupras
b87feac785 zasm: add support for labels! 2019-05-09 21:21:08 -04:00