Language error for combining skip conditions?
Posted: Wed Apr 09, 2025 2:31 am
I'm having an issue with combining skip conditions. Setting the condition "NEG|GEZ" should result in a skip regardless of the value loaded into ACC. Similarly setting the condition "RUN" should yield the same result for every program cycle after the initial. I have a white noise generator that requires such an unconditional skip. These solutions should be interchangeable but the "NEG|GEZ" variant seems to not always produce the skip!
According to the manual (I'm ignoring the typo where "N" is used in case og "NEG"):
What's going on here? Is this a language error or is there a problem with my ASCII input or something? 
According to the manual (I'm ignoring the typo where "N" is used in case og "NEG"):
My codes. Note that the noise gen codes. Note that the noise gen initialization process is placed after the noise gen to effectively "annul" the initial noise gen code cycle.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.
Code: Select all
ldax LFSR ; Read LFSR reg
AND 0x000001 ; Get LSB of noise reg
skp ZRO, shiftzero ; if not zero : additionaly toggle mask bits
clr ; clr acc (non-zero acc)
rdax LFSR, 0.5 ; Get LFSR, shift right 1 place
AND 0x7FFFFF ; Clear MSB
XOR 0xD80000 ; Toggle MASK bits
skp RUN, nwrite ; uncond. skp to storage
shiftzero: ; if Zero :
rdax LFSR, 0.5 ; Get LFSR, shift right 1 place
AND 0x7FFFFF ; Clear MSB
nwrite: ; storage flag
wrax LFSR, 0 ; store, clr
skp RUN, start ; Noise gen init
sof 0, 0.95 ; 0.95
wrax LFSR, 0 ; ignite noise gen
start:
ldax LFSR
mulx POT0
wrax DACL, 0Code: Select all
ldax LFSR ; Read LFSR reg
AND 0x000001 ; Get LSB of noise reg
skp ZRO, shiftzero ; if not zero : additionaly toggle mask bits
clr ; clr acc (non-zero acc)
rdax LFSR, 0.5 ; Get LFSR, shift right 1 place
AND 0x7FFFFF ; Clear MSB
XOR 0xD80000 ; Toggle MASK bits
skp GEZ|NEG, nwrite ; uncond. skp to storage
shiftzero: ; if Zero :
rdax LFSR, 0.5 ; Get LFSR, shift right 1 place
AND 0x7FFFFF ; Clear MSB
nwrite: ; storage flag
wrax LFSR, 0 ; store, clr
skp RUN, start ; Noise gen init
sof 0, 0.95 ; 0.95
wrax LFSR, 0 ; ignite noise gen
start:
ldax LFSR
mulx POT0
wrax DACL, 0