Page 1 of 1

< > operators

Posted: Tue Dec 07, 2021 4:44 pm
by PierreGTT
Hello,

Some instructions make use of < > operators, I was told they are intended to ease selection of low or high order byte of an expression.

However, I get a " Syntax error in expression" error while assembling with pceas2.exe. Is it that usage of those operators is non standard and not supported by all assemblers?

Thanks a lot in helping me.

Re: < > operators

Posted: Sat Dec 11, 2021 9:51 am
by akuyou
I've never used that assembler, but I've come across this problem before on the 65816 assembler I use!

they are NOT supported by all assemblers, so you may need to come up with an alternative.

Getting the bottom byte can be done with and AND mask like & 255 (also the assembler may just skip the top byte if you try to load a 16 bit value into an 8 bit register)

Getting the top byte can be done by dividing / 256 or bitshifting >>8

You'll need to check the assembler documentation to see what is available, and do some testing!

Re: < > operators

Posted: Thu Dec 16, 2021 4:33 pm
by PierreGTT
OK, thanks for your answer.

As per my understanding, they're not mandatory and can be easily overcome through the use of several alternatives.