🔊
SpinCAD Designer
  • Welcome to SpinCAD Designer!
  • Tutorials
    • Getting Started
    • The User Interface
    • Creating a patch
  • Menus
    • File
    • Edit
    • Loop
  • Blocks
    • I/O Mix
    • Wave Shaper
    • Dynamics
      • RMS Lim/Exp
    • Controls
      • Introduction to control signals and blocks
      • Two-stage
      • Invert, Power, Two-Stage, and Vee
      • Ratio
      • Scale/Offset
      • Clip and Tremolizer
      • Envelope
      • Slicer and Smoother
      • Tap Tempo
    • Pitch
      • The Pitch Offset Blocks
  • Design Concepts
    • Basic LFOs in SpinCAD Designer
    • Deep dive into the Three-Tap Delay block
      • Deep dive into the ThreeTap Delay, part 1
      • Deep dive into the ThreeTap delay, part 2
      • Deep dive into the ThreeTap Delay, part 3
    • Analyzing the Spin auto-wah peak detector
      • The Spin auto-wah peak detector, part I
      • The Spin auto-wah peak detector, part II
      • The Spin auto-wah peak detector, part III
    • Intro to the "Dattorro" reverb structure
    • Analyzing the Spin Mini Reverb
      • Analyzing the Spin "Mini Reverb" part 1
      • Analyzing the Spin "Mini Reverb" part 2
      • Analyzing the Spin "Mini Reverb" part 3
  • Patches
    • Making a tremolo patch
    • Making a vibrato/chorus patch
    • Making a pitch shifting delay
    • Multi-head "drum/tape" delay
    • 4-phase LFO driven mixer
  • Tips and Tricks
    • Editing tips for fast patch creation
    • Programming the FV-1 EEPROM with your code
    • Optimizing FV-1 assembly code generated by SpinCAD Designer
  • Beneath the Hood
    • How SpinCAD Builder works
    • Analyzing a simple SpinCAD Builder file
Powered by GitBook
On this page
  1. Tips and Tricks

Optimizing FV-1 assembly code generated by SpinCAD Designer

Some of the more seasoned FV-1 effects developers have noticed that SpinCAD Designer allocates registers where they are not needed, chewing up precious instructions (there are only 128 spaces available) and registers (only 32 available). The main reason for this is that registers are used at the output points of blocks to hold values to be passed to the input pins of downstream blocks. In many cases, this is not ultimately needed.

SpinCAD Designer does let you create a patch which over-allocates resources, but the FV-1 will not be able to assemble or load such a patch.

Most of the time this is not a big deal, because many effects can be created without approaching these limits, but if you ABSOLUTELY HAVE TO GET EVERY LAST DROP OF PERFORMANCE out of the chip (yes, I can see that many of you are raising your hands and nodding "uh-huh" in a slightly smug way) then read on!

Let's look at an example:

; ------- Smoother

RDAX 37, 1.0

RDFX 40, 0.0700

WRAX 40, 0.0

; ------- Scale/Offset

RDAX 40, 1.0

SOF 0.2700, 0.7300

WRAX 41, 0.0

It's pretty clear that these adjacent instructions:

WRAX 40, 0.0

RDAX 40, 1.0

can be replaced by:

WRAX 40, 1.0

This saves one instruction. It doesn't save a register yet because register 40 is already used by the RDFX instruction so we can't get rid of it.

So, how do you find these patterns in general, to modify them?

Case 1:

If there is a pair of adjacent instructions of the form:

index n: wrax reg, 0.0

index n+1: rdax reg, 1.0

AND there is no reference to "reg" by any instruction elsewhere in the entire program, then these two instructions can safely be eliminated, and the allocation of reg can also be eliminated.

Saves two instructions and one register

Case 2:

If there is a pair of adjacent instructions of the form:

index n: wrax reg, 0.0

index n+1: rdax reg, 1.0

and THIS TIME there IS a reference to "reg" by an instruction elsewhere in the program, then these two instructions can safely be replaced by:

wrax reg, 1.0

Saves one instruction.

Case 3:

If there is a pair of adjacent instructions of the form:

index n: wrax reg, 0.0

index n+1: rdax reg, inputGain

AND reg is not used elsewhere in the program,

these can be replaced by the following:

sof inputGain, 0.0

Saves one instruction.

inputGain can be either a variable reference or a constant other than 1.0.

PreviousProgramming the FV-1 EEPROM with your codeNextHow SpinCAD Builder works

Last updated 2 years ago