PSHX vs LDD 0,X
PSHX vs LDD 0,X
I was working a patch and noticed these two similar cmds strings.
I was doing this and needed the result in D.
Fdiv ; result in X
So I tried
LDD 0,x. Which take the same cycle time as below.
But it didn't work. Not sure why.
PSHX
PULA
PULB
Did work,
Any help would be appreciated.
I was doing this and needed the result in D.
Fdiv ; result in X
So I tried
LDD 0,x. Which take the same cycle time as below.
But it didn't work. Not sure why.
PSHX
PULA
PULB
Did work,
Any help would be appreciated.
Moderator
iTrader: (1)
Joined: Mar 2002
Posts: 18,432
Likes: 233
From: Chasing Electrons
Car: check
Engine: check
Transmission: check
The LDD 0,X is using the value in X as the address to retrieve the data from. X is being used as an index register which has the 0 portion of the arguments added to it for the final address.
RBob.
RBob.
I'll chalk that up to lack of sleep.....
honest..
edit:
ok
So LDD 0,x is
LoaD accD (which is acc A & B combined) with the value stored at the location pointed to by Address register X with "0" offset added to the address.
PSHX is put data at the location pointed to by Address register X
on the stack pointer LSB first.
PULA is pull data from stack pointer into accA. (MSB)
PULB is pull data from stack pointer into accB. (LSB)
Got so used to doing the math on a calculator and ignoring the ADDRESS part that it tripped me up when I had to think that way.
Last edited by Z69; Apr 10, 2005 at 07:51 AM.
Moderator
iTrader: (1)
Joined: Mar 2002
Posts: 18,432
Likes: 233
From: Chasing Electrons
Car: check
Engine: check
Transmission: check
Originally posted by Z69
I'll chalk that up to lack of sleep.....
honest..
edit:
ok
So LDD 0,x is
LoaD accD (which is acc A & B combined) with the value stored at the location pointed to by Address register X with "0" offset added to the address.
PSHX is put data at the location pointed to by Address register X
on the stack pointer LSB first.
PULA is pull data from stack pointer into accA. (MSB)
PULB is pull data from stack pointer into accB. (LSB)
Got so used to doing the math on a calculator and ignoring the ADDRESS part that it tripped me up when I had to think that way.
I'll chalk that up to lack of sleep.....
honest..
edit:
ok
So LDD 0,x is
LoaD accD (which is acc A & B combined) with the value stored at the location pointed to by Address register X with "0" offset added to the address.
PSHX is put data at the location pointed to by Address register X
on the stack pointer LSB first.
PULA is pull data from stack pointer into accA. (MSB)
PULB is pull data from stack pointer into accB. (LSB)
Got so used to doing the math on a calculator and ignoring the ADDRESS part that it tripped me up when I had to think that way.
RBob.
Thread
Thread Starter
Forum
Replies
Last Post





