A82: Re: Conditional ROM_CALLs


[Prev][Next][Index][Thread]

A82: Re: Conditional ROM_CALLs




It is not possible to make conditional ROM CALLs like that, because if the
call to $8D74 was not taken then you would end up executing the addr. For
some addrs this might not be a problem, and if you used it right it might
even make your program smaller, but for most addrs it wont work. OFr
example:

ROM_CALL(D_ZT_STR) = CALL $8D74 \ JP M,$38
ROM_CALL(M_CHARPUT) = CALL $8D74 \ ADC A,$37

So if you used ROM_CALL_Z(M_CHARPUT) in your program M_CHARPUT would be
called if the zero flag was set, otherwise $37 would be added to A. 

Dines

BTW IN the same as this might save space if used right, you can also use
jr z,$-1 as a easy way of making a rst z,37h (call the interrupt handler).

BTW2 To do a conditional ROM CALL you need to do something like this

#DEFINE ROM_CALL_Z(addr) JR Z,$+5 \ CALL $8D74 \ .DW addr
-----Original Message-----
From: Kouri Rosenberg <kouri@juno.com>
To: assembly-82@lists.ticalc.org <assembly-82@lists.ticalc.org>
Date: 6. august 1998 05:09
Subject: A82: Conditional ROM_CALLs


>
>Hey, is it possible to do conditional ROM_CALLs?
>Let's say that in TI82.H, I added some macros like this:
>
>#DEFINE ROM_CALL_C(addr)  CALL C,  $8D74 \ .DW addr
>#DEFINE ROM_CALL_Z(addr)  CALL Z,  $8D74 \ .DW addr
>#DEFINE ROM_CALL_NC(addr) CALL NC, $8D74 \ .DW addr
>#DEFINE ROM_CALL_NZ(addr) CALL NZ, $8D74 \ .DW addr
>
>Would that work? You would be able to do things like
>ROM_CALL_Z(D_ZT_STR) or ROM_CALL_C(M_CHARPUT)
>And if not, why not? But if it is possible, can anyone
>think of a practical use for them?
>
>_____________________________________________________________________
>You don't need to buy Internet access to use free Internet e-mail.
>Get completely free e-mail from Juno at http://www.juno.com
>Or call Juno at (800) 654-JUNO [654-5866]
>

__________________________________________

Dines Justesen
Email: c958362@student.dtu.dk
WWW  : http://www.student.dtu.dk/~c958362/
__________________________________________