It is currently Mon Dec 11, 2017 11:45 pm

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: spc help
PostPosted: Sun Sep 11, 2005 2:49 pm 
Offline
User avatar

Joined: Tue Sep 21, 2004 12:11 am
Posts: 377
Location: Karlshamn (Sweden)
I'm trying to get this to work in wla-spc700:

Code:
   mov $F2, #$F5
   movw ya, $F3
   jmp   [!ya]


what it does is recive a 16bit adress from the IO port 2+3 ($F5 and $F6)
then I set the 16bit ya register to this adress I recived. and now I try to jmp to it. but wla gives me:

Code:
ERROR: Unknown symbol "jmp".


which basicly in wla language means "you wrote it in a way I don't understand"... ;)

so I looked up the spc-700 opcode list for wla and found
Code:
x = 8bit
? = 16bit

$1f "JMP [!?+X]"


and thats as far as I get exactly as I've writen (with the exception of the + X part):
Code:
jmp   [!ya]


edit:

got it to assemble by doing this ugly hack:
Code:
   mov $F2, #$F5
   movw ya, $F3
   movw $0000, ya
   mov x, #0
   jmp   [!$0000+x]


but I think that it should be a better looking way to do this... =/

_________________
Sorry for misspellings, I'm from Sweden ^^


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 11, 2005 8:03 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
I also had significant trouble figuring out WLA while coding for the SPC-700. The main thing was that you had to add a ! (just that) before absolute addresses. I don't have my code in front of me, but I think jump was just

jmp !label


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 12, 2005 12:07 am 
Offline
User avatar

Joined: Tue Sep 21, 2004 12:11 am
Posts: 377
Location: Karlshamn (Sweden)
yeah I understand that part.. but I wanted to store a adress in the 16bit YA register and then do a jmp using that register as the adress:
jmp [!ya] (or what ever it would look like)

_________________
Sorry for misspellings, I'm from Sweden ^^


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 12, 2005 8:45 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7312
Location: Chexbres, VD, Switzerland
The SPC instuction set definitely lacks decent doccumentation.
Your MOVW YA, $f3 would load A with $f3 and Y with $f4, which is pretty crazy because A will load from the DPS register $f5 (scince adress is 7 bits, it will be $75) so channel 7 attack/decay register, and load Y with the main CPU transfer register #0. Is that really what you want ?

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 12, 2005 11:40 am 
Offline
User avatar

Joined: Tue Sep 21, 2004 12:11 am
Posts: 377
Location: Karlshamn (Sweden)
edit:
nevermind my old post.. most have been drunk when I wrote that :P

now when I've actually though little of what I had used written I realised that it was totally wrong.. it should have been something more like:
Code:
   movw ya, $F5


to get the adress to ya :oops:

_________________
Sorry for misspellings, I'm from Sweden ^^


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 31, 2005 5:40 pm 
Offline
User avatar

Joined: Tue Sep 21, 2004 12:11 am
Posts: 377
Location: Karlshamn (Sweden)
I thought I continued on this one instead of makeing a new thread ;)

I got this problem..
I want to load a 16bit adress (a label) into the YA register

this is how I think it should be:

movw ya, #data
... lots of code ...

data:
... lots of data ....

but wla-dx don't wont to assemble it :(
all I get is the standard error that wla-dx seems to allways say when something is wrong:
Quote:
STACK_CALCULATE: Syntax error. Invalid use of modulo.
ERROR: Couldn't parse "movw".


can anyone help me?

edit:
nevermind.. by reading the mnemonics of the spc700 it seems like the movw can't do 16bit numbers...?! then what is the w in movw for if not word?
Quote:
x = 8bit
"MOVW x,YA" $da
"MOVW YA,x" $ba


now I feel really lost...

edit2:
so I guess inorder to do what I want I have
to do something like

mov y, data <- high 8bit part of adress
mov a, data <- low 8bit part of adress

but how do I do this in wla-dx? I have seen other assemblers use things like:
HI(data), LOW(data)
or
>data, <data

but I can't find anything similar for wla-dx (maybe I have to look harder?)


edit3:
after lots of trial and error I have discoverd that wla-dx use the <data and >data... so now my code works. yay!! :D

_________________
Sorry for misspellings, I'm from Sweden ^^


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: whicker and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group