Author: Ashbad
Posted: 19 Nov 2012 03:23:53 pm (GMT -5)
Just keep in mind that JR can only jump a limited distance forward/backward (128 bytes backward, 127 bytes forward) and doesn't have all the conditional flag modifiers that JP has (but it should be used when possible because it's more optimal on size and space.)
As for a random function, I don't know of any rand BCALL offhand, but you might want to use the ion routine provided in Ion/Mirage/DCS or check this out: http://wikiti.brandonw.net/index.php?title=Routines:Math:Random
(That's exactly what the BCALLZ macro does; it jumps over the RST 28h instruction if the z flag is zero.)
_________________
-Ashbad
Posted: 19 Nov 2012 03:23:53 pm (GMT -5)
LuxenD wrote: |
Mimas has something called JQ, which is replaced by the proper jp or jr on compilation. and i asked about the bcall Random. |
Just keep in mind that JR can only jump a limited distance forward/backward (128 bytes backward, 127 bytes forward) and doesn't have all the conditional flag modifiers that JP has (but it should be used when possible because it's more optimal on size and space.)
As for a random function, I don't know of any rand BCALL offhand, but you might want to use the ion routine provided in Ion/Mirage/DCS or check this out: http://wikiti.brandonw.net/index.php?title=Routines:Math:Random
chickendude wrote: |
What bcall? You mean bcallz(XXX)? When would you ever use that? If you want you can just jump over the bcall |
(That's exactly what the BCALLZ macro does; it jumps over the RST 28h instruction if the z flag is zero.)
_________________
-Ashbad