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 Apr 10, 2005 | 01:42 AM
  #1  
Z69's Avatar
Z69
Thread Starter
Supreme Member
 
Joined: Sep 2003
Posts: 1,409
Likes: 1
From: Texas
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.
Reply
Old Apr 10, 2005 | 07:11 AM
  #2  
RBob's Avatar
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.
Reply
Old Apr 10, 2005 | 07:30 AM
  #3  
Z69's Avatar
Z69
Thread Starter
Supreme Member
 
Joined: Sep 2003
Posts: 1,409
Likes: 1
From: Texas


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.
Reply
Old Apr 10, 2005 | 08:12 AM
  #4  
RBob's Avatar
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.
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.
Reply
Old Apr 10, 2005 | 11:36 PM
  #5  
Z69's Avatar
Z69
Thread Starter
Supreme Member
 
Joined: Sep 2003
Posts: 1,409
Likes: 1
From: Texas
Plenty of things to trip over in this dark room I insist on exploring.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
jim_in_dorris
DIY PROM
35
Dec 9, 2011 07:18 AM
turbodig
DIY PROM
10
Jul 27, 2011 03:23 AM
junkcltr
DIY PROM
4
Aug 9, 2005 09:39 AM
Doctor J
DFI and ECM
2
Nov 13, 2003 02:47 PM




All times are GMT -5. The time now is 02:32 PM.