PSHX vs LDD 0,X
#1
Supreme Member
Thread Starter
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.
#2
Moderator
iTrader: (1)
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,406
Likes: 0
Received 216 Likes
on
202 Posts
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.
#3
Supreme Member
Thread Starter
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; 04-10-2005 at 07:51 AM.
#4
Moderator
iTrader: (1)
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,406
Likes: 0
Received 216 Likes
on
202 Posts
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