DIY PROM Do It Yourself PROM chip burning help. No PROM begging. No PROMs for sale. No commercial exchange. Not a referral service.

PSHX vs LDD 0,X

Thread Tools
 
Search this Thread
 
Old 04-10-2005, 01:42 AM
  #1  
Z69
Supreme Member

Thread Starter
 
Z69's Avatar
 
Join Date: Sep 2003
Location: Texas
Posts: 1,409
Likes: 0
Received 1 Like on 1 Post
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.
Old 04-10-2005, 07:11 AM
  #2  
Moderator

iTrader: (1)
 
RBob's Avatar
 
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.
Old 04-10-2005, 07:30 AM
  #3  
Z69
Supreme Member

Thread Starter
 
Z69's Avatar
 
Join Date: Sep 2003
Location: Texas
Posts: 1,409
Likes: 0
Received 1 Like on 1 Post


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.
Old 04-10-2005, 08:12 AM
  #4  
Moderator

iTrader: (1)
 
RBob's Avatar
 
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.
OK on the first one (LDD 0,X). Not OK on the second one (PSHX). The PSHX puts the value that is IN X onto the stack, LSB first.

RBob.
Old 04-10-2005, 11:36 PM
  #5  
Z69
Supreme Member

Thread Starter
 
Z69's Avatar
 
Join Date: Sep 2003
Location: Texas
Posts: 1,409
Likes: 0
Received 1 Like on 1 Post
Plenty of things to trip over in this dark room I insist on exploring.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
jim_in_dorris
DIY PROM
35
12-09-2011 07:18 AM
turbodig
DIY PROM
10
07-27-2011 03:23 AM
junkcltr
DIY PROM
4
08-09-2005 09:39 AM
Doctor J
DFI and ECM
2
11-13-2003 02:47 PM



Quick Reply: PSHX vs LDD 0,X



All times are GMT -5. The time now is 02:20 AM.