PASM enhancement in Propeller Tool
mirror
Posts: 322
The Propeller encourages the writing of self-modifying code.
A nice shortcut would be if in assembly code I could write something like:
A nice shortcut would be if in assembly code I could write something like:
movi :dest, #or nop :dest and var1, var2 'The and in this line will be replaced with an or -- instead of -- movi :dest, #%011010001 nop :dest and var1, var2
Comments
The problem comes with NR where to override a default WR it would have to be specified as "& ! k_NR"
or specify more complex opcode constants ...
k_OR
k_OR_WC
k_OR_NR
etc
So you would need to define all the instructions plus WR, WZ and WC. Too easy who will be the first to do it?
The reason for my request was that this information is already available to the Propeller Tool - otherwise it wouldn't be able to compile the source!
Thanks for the thoughts and efforts of those who replied - and not only to my post, I learn so much by reading through the other posts on this forum.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
movi [noparse]:o[/noparse]pc , #k_CMP
movi [noparse]:o[/noparse]pc , #k_CMP & k_NR
movi [noparse]:o[/noparse]pc , #k_SUB & k_NR
These are subtracts ...
movi [noparse]:o[/noparse]pc , #k_SUB
movi [noparse]:o[/noparse]pc , #k_SUB | k_WR
movi [noparse]:o[/noparse]pc , #k_CMP | k_WR
I haven't gone through the file a line at a time to check the bit values are right though !