< > operators

PC-Engine AKA TurboGrafx-16 Programming
Post Reply
PierreGTT
Posts: 6
Joined: Sun Dec 05, 2021 11:14 am

< > operators

Post by PierreGTT » Tue Dec 07, 2021 4:44 pm

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.

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: < > operators

Post by akuyou » Sat Dec 11, 2021 9:51 am

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!
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

PierreGTT
Posts: 6
Joined: Sun Dec 05, 2021 11:14 am

Re: < > operators

Post by PierreGTT » Thu Dec 16, 2021 4:33 pm

OK, thanks for your answer.

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

Post Reply

Return to “PC-Engine Assembly Programming”