Update modifiers to allow for forced-casting? #5

Closed
opened 2026-01-29 14:08:48 +00:00 by claunia · 0 comments
Owner

Originally created by @waltje on GitHub (Apr 25, 2023).

We do have the [b], [d] and [w] modifiers for 'lossless' casting of values to another type.

However, sometimes we want to force this casting (without an AND operator..), so maybe we should add "forced" versions, like "[!b]" and "[!w]", which AND the value as needed ?

In actual code, this would look like:

00055 043E F0 12 45: sum: .word .sum(data, . - data)
00056 0440 0F ED 46: .word ~.sum(data, sum - data)
00057 0442 0F 47: .byte [!b]~.sum(data, sum - data)

where the difference can be clearly seen.

Originally created by @waltje on GitHub (Apr 25, 2023). We do have the [b], [d] and [w] modifiers for 'lossless' casting of values to another type. However, sometimes we want to force this casting (without an AND operator..), so maybe we should add "forced" versions, like "**[!b]**" and "**[!w]**", which AND the value as needed ? In actual code, this would look like: `00055 043E F0 12 45: sum: .word .sum(data, . - data)` `00056 0440 0F ED 46: .word ~.sum(data, sum - data)` `00057 0442 0F 47: .byte [!b]~.sum(data, sum - data)` where the difference can be clearly seen.
claunia added the enhancement label 2026-01-29 14:08:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: VARCem/Vasm#5