kevinpt / opbasm

Open PicoBlaze Assembler
http://kevinpt.github.io/opbasm/
MIT License
60 stars 13 forks source link

Add support for negated tests #19

Closed nrother closed 7 years ago

nrother commented 7 years ago

Currently it is not possible to negate a test in a C-style if, so one has to fall back to ugly constructs like this:

if (sA & FC_MEM_RX_FC_FCCS_VALID_BIT) {
} else {
    jump respinv_end
}

It would be nice if there were a not() modifier for the condition (like signed()), or maybe a ~& operator or the like.

(Side note: Sorry for opening so many issue, I just started using optasm for my master thesis, and this are just the things I came across, which I thought might be useful in general :smile: . optasm is awesome!)

kevinpt commented 7 years ago

I have added a ~& operator for if(), while(), and dowhile().

Keep the bug reports coming in. The assembler doesn't get much stress testing.

nrother commented 7 years ago

This works really great! It even saves some instructions :+1: