skp always
Posted: Sun May 10, 2009 8:03 am
Because of the lack of a "skp greater_than_zero" or a "skp not_zero" test condition, I've used a work-around that utilizes "skp run" as a pseudo-branch in a few pieces of code.
Twice now I've had code where the skip was not being taken at runtime after the first pass. It drove me completely nuts until verified that "skp run" as I typed it was not working properly in the hardware. I have not had time to track this bug down to being in the assembler or the FV-1 hardware, but I had no trouble repeating it at the time.
I needed to get my code running with a skip that was always taken, so a little analysis shows the flags (run, neg, zrc, zro, & gez) seem to be ANDed together. For instance, a skip that asked for neg and gez at the same time will never be taken.
In order to construct a skp that will always be taken, simply don't ask for any of the 5 conditions in the instruction.
Twice now I've had code where the skip was not being taken at runtime after the first pass. It drove me completely nuts until verified that "skp run" as I typed it was not working properly in the hardware. I have not had time to track this bug down to being in the assembler or the FV-1 hardware, but I had no trouble repeating it at the time.
I needed to get my code running with a skip that was always taken, so a little analysis shows the flags (run, neg, zrc, zro, & gez) seem to be ANDed together. For instance, a skip that asked for neg and gez at the same time will never be taken.
In order to construct a skp that will always be taken, simply don't ask for any of the 5 conditions in the instruction.
Code: Select all
equ always, 0x00 ; This is our binary zero (no condition flags)
skp always,end_of_skip ; Ask for skip without conditions
;
; code to be skipped
;
end_of_skip: