unconditional SKP

Algorithm development and general DSP issues

Moderator: frank

Post Reply
igorp
Posts: 21
Joined: Tue May 19, 2015 6:10 am
Location: RU

unconditional SKP

Post by igorp » Mon Mar 12, 2018 2:04 pm

For example, program made calculations and need to go to next part,
I am trying "SKP run|gez|neg|zro|zrc , label" for unconditional jump, but program continued.

Why?

I used "SKP run|gez , label" and it woiked fine for this subrotinue, but i want to understand what was wrong.

frank
Posts: 991
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank » Tue Mar 13, 2018 8:50 am

Most likely the combination of flags makes no sense to the logic in the instruction decoder. "SKP neg|gez" is illogical to a hardware decoder since we are using the sign bit to decide. "SKP neg|gez" is saying "skip if negative and continue if positive or skip if positive and continue if negative" so which do we do? Do we skip or continue as both states are satisfied? Seems the way I designed it we default to continue.
Frank Thomson
Experimental Noize

igorp
Posts: 21
Joined: Tue May 19, 2015 6:10 am
Location: RU

Post by igorp » Tue Mar 13, 2018 2:43 pm

Hm , in classic C "|" mean logical OR , so

"skp run|gez|neg" is interpreted as
"skip if run or skip if gez or skip if neg"

and "SKP neg|gez" mean "skip if negative or positive" , so it must be unconditional skip?

frank
Posts: 991
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank » Tue Mar 13, 2018 5:16 pm

Yes but we are talking assembly here which is far closer to the hardware than C, a simple logical OR in C may map to multiple assembly instructions not just one.

One thing to consider is if you really need to test for both, when I've needed an unconditional SKP I could usually take advantage of knowing in advance that the value in the ACC was going to be positive or negative then use that as the skip flag. Other times the first thing I did at the label point was clear the acc so i just moved that clearing to just before the skp and did a skp zro or skp gez.
Frank Thomson
Experimental Noize

igorp
Posts: 21
Joined: Tue May 19, 2015 6:10 am
Location: RU

Post by igorp » Wed Mar 14, 2018 11:09 am

Oh, i do simple analysis like "wrax temp, 0 : skp zro , label" , but thought skp has more common way to make unconditional jump.

Thank you

Post Reply