Operators in pasm
grahamreitz
Posts: 56
This is not legitimate pasm code, correct?
Although it does compile with the prop tool.
This is legitimate, correct?
If pasm operators can only perform compile time operations, what is the value?
Why not do this? Since the answer to 123mod10 is fairly obvious.
One use comes to mind for large pasm files where one constant, that gets operated on, is used often and as a constant variable it can be changed in one place.
If a runtime modulus operation is needed we need to create our own code to do it?
mov result, temp // #10
Although it does compile with the prop tool.
This is legitimate, correct?
mov result, #123 // #10
If pasm operators can only perform compile time operations, what is the value?
Why not do this? Since the answer to 123mod10 is fairly obvious.
mov result, #3
One use comes to mind for large pasm files where one constant, that gets operated on, is used often and as a constant variable it can be changed in one place.
If a runtime modulus operation is needed we need to create our own code to do it?
Comments
Although all integer constant expressions could be considered "obvious", you keep them separate to show the heritage of the numbers in order to create self documenting code.
-Phil
I was under the impression that pasm operators only worked on constants during compile time.
If I understand now, operators will work on data in cog memory at run-time?
I think what Phil is saying is that they both store the address divided by 10, but the second also sets the immediate bit. This would be done at runtime.
-Phil