value of RMP0

Software questions and issues with the FV-1

Moderator: frank

Post Reply
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

value of RMP0

Post by Digital Larry »

This is a trick question, I think.

What is the value of the constant RMP0?

If you look it up in the Spin ASM manual, you'll find it shown there as 2. This is for the context of using it in the CHO RDA, CHO RDAL or CHO SOF instructions.

However if you reference the WLDR instruction, the valid values for the first parameter are 0 and 1. Nevertheless, it seems that there are a lot of code examples which include something like:

WLDR RMP0, 16384, 4096

If you replace RMP0 with 2, you'll get an error. So it looks like in the context of the WLDR instruction that RMP0 = 0.

Normally you wouldn't care about this, but I've had to duplicate the syntax of the Spin Assembler to simplify the creation of new functional blocks in SpinCAD Designer.
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

Yes, the value depends on the instruction. For WLDR, since it only works with ramps the values are 0 or 1. Technically for CHO they are 0 and 1 but we also have a "lfo/ramp" flag in the instruction so it could look like 2 and 3 since this flag is 0 for LFOs and 1 for ramps. If you look at some assembled simple instructions you can see how it all maps:

0000 00000014 :cho rda, sin0,sin,0
0001 01000014 :cho rda, sin0,cos,0
0002 00200014 :cho rda, sin1,sin,0
0003 01200014 :cho rda, sin1,cos,0
0004 00400014 :cho rda, rmp0,,0
0005 00600014 :cho rda, rmp1,,0

Confusing? A little if you don't know the physical mapping of the instruction decoder in the FV-1, lots of little details from discussions between Keith and myself, etc.
Frank Thomson
Experimental Noize
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

Thanks Frank.

It may be hard to believe, but I wrote some code that translates raw Spin ASM into Java. I essentially rewrote the assembler syntax from scratch.

The end result of the Java is to convert it all back into Spin ASM ultimately, but while it's Java, you can do lots of things with it that Spin ASM doesn't allow.

One of my criteria for success of my code is to grab every bit of Spin ASM code I could find on this web site and run it through. There are a few things I'm not going to bother to handle.

One is where in the CHO RDA instruction, you can use ,, instead of ,0, - that is really hard to parse because commas demarcate everything. So in that case I force you to add the zero.

The other thing (that I can think of) is that I don't support any math calculations inline. If you need to calculate 1/0.45657 then I force you to do the calculation and just put the end result in.

I am pretty sure I can work around this RMP0 thing - thanks for confirming it.
Post Reply