Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LDD and variables

1 view
Skip to first unread message

Cell Wall Rebound

unread,
Nov 8, 2009, 11:34:46 PM11/8/09
to
Lets say i have 2 variables called ball_x and ball_y, can i use LDD
like so:

LDD ball_xball_y
JSR Dot_here

or am i forced to use lda and ldb to position the dot and waste a bit
of space and speed?

Sincerely,

Cell Wall Rebound

parabellum

unread,
Nov 9, 2009, 4:50:05 AM11/9/09
to
I'm not sure what is your real question : is it CPU or BIOS targeted?


1- On the CPU level, if you just wanted to know if calling "LDD addr"
is the same as calling in succession "LDA addr / LDB addr+1" ; then
yes, is exactly the same thing (and as you say, it's both faster an
saves a byte of code).


2- On the BIOS level on the other hand, if you wanted to know if
calling "Dot_here" instead of "Dot_d" would work as well ; then no,
this won't work (unless you have already moved the pen to the good
position).

Setting D before calling "Dot_here" is useless (and a waste of time),
as the A/B registers are trashed by this routine. What you should is
set D (or A and B individually, as you wish - cf. 1) then call "Dot_D"
instead (that will move the beam to the A,B position before carrying
on with the Dot_here code).

HTH,
Franck.

0 new messages