BUT!!! On the C128, the SYS command was extended to allow ease of passing registers. This is fine if you want to transfer data in 0..255 chunks. But coordinates on the screen are 320x200, so that goes past a byte, and addresses are 0..65535, they definitely go past a byte. And strings are another animal.
On the C128 the statement SYS 4864,1,2,3 will call the routine with .A, .X, .Y registers populated with 1, 2, and 3 respectively. That's fine and dandy, but if you want to do something more, you have to do it another way.
Here comes the new syntax:
SYS 4864 : REM 300, 65535, "Hello C128"
By using the token getter, you can check for colon, REM token, then proceed to parse values and variables as before on C64. (With the exception that I couldn't get expressions like 2+3 to work, maybe something to do with REM. But we can work around that.)
Check out the github repository for program listings including commented assembly for more details, and to grab a copy of the D64 containing the PRG.

No comments:
Post a Comment