So, after a long period sticking with 3-byte integers, I think it's good to think about some ways to define variables to be 1-, 2- or 3-byte integers, or even floats. As already said, Mateo and Adriweb discussed a method to cast variables and eventually functions, like this:
Code:
for example. This gets A as a 1-byte integer, adds 3 and store it as an 3-byte integer to B. This method works fine, and generates optimized output... however, it is pretty hard to learn and understand, if you are not used to C. That is why I propose an alternative, and that is another function DefineVarType (or something similar), which sets the variable to be a 1-, 2- or 3-byte integer, or a float. This is much easier to work with, and produces almost the same outpupt. If you still want to mask a variable, you could use something like [3] or (3) for a 3-byte integer. For pointers, I could use a simple "*" before the variable, number or function. That requires a bit more parsing, but is easy to remember. Thoughts?
Code:
(1)A+3->(3*B)
for example. This gets A as a 1-byte integer, adds 3 and store it as an 3-byte integer to B. This method works fine, and generates optimized output... however, it is pretty hard to learn and understand, if you are not used to C. That is why I propose an alternative, and that is another function DefineVarType (or something similar), which sets the variable to be a 1-, 2- or 3-byte integer, or a float. This is much easier to work with, and produces almost the same outpupt. If you still want to mask a variable, you could use something like [3] or (3) for a 3-byte integer. For pointers, I could use a simple "*" before the variable, number or function. That requires a bit more parsing, but is easy to remember. Thoughts?