New vCPU instructions? (poll)

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice.

Which vCPU instruction to add?

Poll ended at 01 Oct 2019, 13:00

CMPW $DD
8
50%
HOP $DD
6
38%
LSRW or LSR
0
No votes
SW02 $DD
2
13%
Other (please comment)
0
No votes
 
Total votes: 16

User avatar
marcelk
Posts: 377
Joined: 13 May 2018, 08:26

Re: New vCPU instructions? (poll)

Post by marcelk » 24 Oct 2019, 09:15

Thanks for testing! I had played with it already, but only as a non-returning JMPI. For some reason it didn't crash, while it should have. So now it also works ok as a call mechanism, as intended. This will make larger programs possible and the chances of this making it into a "ROMv5" are pretty good.

In GCL notation, it will be using the exclamation mark, similar to the notation of calling through a variable:

Code: Select all

$2800!
for

Code: Select all

85 00 28                 CALLI $2800
Or if your have a label:

Code: Select all

{Caller}
   push
   ...
    \Label!
   ...
   pop ret

{Function}
_Label=*
   ...
   ret
(Label notation is still developing. I'm not fully happy with the two namespaces we have.)

This new immediate-call notation conflicts with SYS calls, because those are written as "<cycles>!". Currently the compiler disambiguates on the magnitude: SYS calls have a small operand. But I added a double-exclamation alternative: "<cycles>!!". Once we freeze gcl0x and call it gcl1, I plan to deprecate the older SYS call notation with a warning.

Post Reply