[A83] Re: Conditional bcall()ing
[Prev][Next][Index][Thread]
[A83] Re: Conditional bcall()ing
> Van: Andrey Gorlin <ag_silver_83p@ameritech.net>
>
> In MirageOS programming, is there a way to make a conditional bcall()?
> (Like "call z,<whatever>", only with bcall().)
I'm not sure if there isn't a 'normal' way to handle it, but you could do
things like:
bcall_z(xxx)
=
jr nz,$+3 ; bcall() = 3 bytes
bcall(xxx)
So always take the opposite of the flag, and jump[-relative] over the
bcall(), a macro would be like this:
#define bcall_z(addr) jr nz,$+3 \ rst 28 \ .dw addr
Henk Poley <><