immortalvm / ivm-implementations

iVM contemporary implementations
5 stars 0 forks source link

expressions for read_char and read_byte #38

Open elnv opened 1 year ago

elnv commented 1 year ago

We would like to request that reading instructions read_char and the requested read_byte could be used inside parenthesized expressions, like other operators that push a result.

For example store8!! (read_char) &2

This make easier using these instructions in C embedded assembly, without thinking in stack adjustments.

ivar-rummelhoff commented 1 year ago

Expressions are assumed to be without side effects so that subexpressions can be reordered or even eliminated. However,

store8!! (* 0 (read_char)) &2

is not the same as:

store8!! 0 &2

Consequently, this feature would require changes that are too large for the current project; and I am not even sure it is a good idea.