Main Page and SpinAsm SKP: Difference between pages

From PedalPCB Wiki
(Difference between pages)
Jump to navigation Jump to search
Tag: Reverted
 
(Created page with "==SKP== {| class="wikitable" |+ !Mnemonic !Operation !Instruction coding |- |SKP |CMASK  N |CCCCCNNNNNN000000000000000010001 |} ======Description====== The SKP instruction allows conditional program execution. The FV­1 features five condition flags that can be used to conditionally skip the next N instructions. The selection of which condition flag(s) must be asserted in order to skip the next N instructions is made by the five bit condition mask “CMASK”. Only if...")
 
Line 1: Line 1:
This is the testing area for the '''PedalPCB Wiki'''.  The information listed here is for experimental purposes only.
==SKP==
{| class="wikitable"
|+
!Mnemonic
!Operation
!Instruction coding
|-
|SKP
|CMASK  N
|CCCCCNNNNNN000000000000000010001
|}


== Component References ==
======Description======
* [[Potentiometers]]
The SKP instruction allows conditional program execution. The FV­1 features five condition flags that can be used to conditionally skip the next N instructions. The selection of which condition flag(s) must be asserted in order to skip the next N instructions is made by the five bit condition mask “CMASK”. Only if all condition flags that correspond to a logic "1" within CMASK are asserted are the following N instructions skipped. The individual bits within CMASK correspond to the FV­1 condition flags as follows: 
* [[LEDs]]
{| class="wikitable"
* [[Jacks]]
|+
* [[Switches]]
!CMASK
** [[Momentary vs Latching]]
!Flag
** [[Normally Open vs Normally Closed]]
!Description
** [[Make before Break vs Break before Make]]
|-
** [[ON/ON]]
|b4
** [[ON/OFF/ON]]
|RUN
** [[ON/ON/ON]]
|The RUN flag is cleared after the program has executed for the first time after it was loaded into the internal program memory. The purpose of the RUN flag is to allow the program to initialize registers and LFOs during the first sample iteration then to skip those initializations from then on.
** [[SPST]]
|-
** [[SPDT]]
|b3
** [[DPDT]]
|ZRC
** [[3PDT]]
|The ZRC flag is asserted if the sign of ACC and PACC is different, a condition that indicates a Zero Crossing.
** [[4PDT]]
|-
** [[Rotary Switches]]
|b2
* [[SMD Component Lookup]]
|ZRO
* [[EIA-96 SMD Resistor Codes]]
|Z is asserted if ACC = 0
* [[Op Amp Slew Rates]]
|-
* [[Resistor Color Code Chart]]
|b1
|GEZ
|GEZ is asserted if ACC >= 0
|-
|b0
|NEG
|N is asserted if ACC is negative
|}


== Wiring Diagrams ==
====== Parameters ======
* [[Standard True-Bypass Wiring]]
{| class="wikitable"
* [[2-in-1 Pedal Wiring]]
|+
* [[2-in-1 Pedal Wiring (Single Footswitch)]]
!Name
* [[2-in-1 Pedal Wiring (AB)]]
!Width
* [[3PDT Order Switch Wiring]]
!Entry formats, range
* [[Expression Control Wiring]]
|-
* [[DPDT ON/ON/ON as 3-way Switch]]
|CMASK
|5 Bit
|Binary
Hex ($00 ­ $1F)
Symbolic
|-
|N
|6 Bit
|Decimal (1 – 63)
Label
|}
Maybe the most efficient way to define the condition mask is using it's symbolic representation. In order to simplify the SKP syntax, SPINAsm has a predefined set of symbols which correspond to the name of the individual condition flags. (RUN,ZRC,ZRO,GEZ,NEG). Although most of the condition flags are mutually exclusive, SPINAsm allows you to specify more than one condition flag to become evaluated simply by separating multiple predefined symbols by the "|" character. Accordingly "skp ZRC|N, 6" would skip the following six instructions in case of a zero crossing to a negative value.


== To Do ==
======Syntax======
* Basic Electronics Theory
SKP CMASK,N
* Resistors
* Capacitors
* Diodes
* Transistors
* Integrated Circuits
* Enclosures
* Switches
* [[PCB list by SKU]]
* [[JFET chart]]


== SpinAsm Reference ==
======Coding Example======
* [[SpinAsm SOF]]
<syntaxhighlight line="1">
* [[SpinAsm AND]]
; A bridge rectifier        ;
* [[SpinAsm OR]]
                            ;
* [[SpinAsm XOR]]
sof  0,0                    ; Clear ACC
* [[SpinAsm LOG]]
rdax ADCL,1.0              ; Read from left ADC channel
* [[SpinAsm EXP]]
skp  GEZ,pos                ; Skip next instruction if ACC >= 0
sof  -1.0,0                ; Make ACC positive
pos: wrax DACL,0            ; Result to DACL, clear ACC
rdax ADCL,1.0              ; Read from left ADC channel
skp  N,neg                  ; Skip next instruction if ACC < 0
sof  -1.0,0                ; Make ACC negative
pos: wrax 0,DACR            ; Result to DACR, clear ACC
</syntaxhighlight>

Revision as of 20:52, 6 January 2023

SKP

Mnemonic Operation Instruction coding
SKP CMASK  N CCCCCNNNNNN000000000000000010001
Description

The SKP instruction allows conditional program execution. The FV­1 features five condition flags that can be used to conditionally skip the next N instructions. The selection of which condition flag(s) must be asserted in order to skip the next N instructions is made by the five bit condition mask “CMASK”. Only if all condition flags that correspond to a logic "1" within CMASK are asserted are the following N instructions skipped. The individual bits within CMASK correspond to the FV­1 condition flags as follows:

CMASK Flag Description
b4 RUN The RUN flag is cleared after the program has executed for the first time after it was loaded into the internal program memory. The purpose of the RUN flag is to allow the program to initialize registers and LFOs during the first sample iteration then to skip those initializations from then on.
b3 ZRC The ZRC flag is asserted if the sign of ACC and PACC is different, a condition that indicates a Zero Crossing.
b2 ZRO Z is asserted if ACC = 0
b1 GEZ GEZ is asserted if ACC >= 0
b0 NEG N is asserted if ACC is negative
Parameters
Name Width Entry formats, range
CMASK 5 Bit Binary

Hex ($00 ­ $1F) Symbolic

N 6 Bit Decimal (1 – 63)

Label

Maybe the most efficient way to define the condition mask is using it's symbolic representation. In order to simplify the SKP syntax, SPINAsm has a predefined set of symbols which correspond to the name of the individual condition flags. (RUN,ZRC,ZRO,GEZ,NEG). Although most of the condition flags are mutually exclusive, SPINAsm allows you to specify more than one condition flag to become evaluated simply by separating multiple predefined symbols by the "|" character. Accordingly "skp ZRC|N, 6" would skip the following six instructions in case of a zero crossing to a negative value.

Syntax

SKP CMASK,N

Coding Example
; A bridge rectifier        ; 
                            ; 
sof  0,0                    ; Clear ACC 
rdax ADCL,1.0               ; Read from left ADC channel
skp  GEZ,pos                ; Skip next instruction if ACC >= 0 
sof  -1.0,0                 ; Make ACC positive 
pos: wrax DACL,0            ; Result to DACL, clear ACC 
rdax ADCL,1.0               ; Read from left ADC channel
skp  N,neg                  ; Skip next instruction if ACC < 0
sof  -1.0,0                 ; Make ACC negative 
pos: wrax 0,DACR            ; Result to DACR, clear ACC