Drop the PRINT instruction on ZX80
Drop the PRINT instruction on ZX80
I have a question concerning MC on ZX80. Suppose, I have poked a RET ($C9) at address 30000. The command PRINT USR(30000) will come back with 30000. But I want to surpress the printing. How can I drop the PRINT instruction from the stack?
Is there good textbook for MC programming on ZX80?
Is there good textbook for MC programming on ZX80?
Re: Drop the PRINT instruction on ZX80
LET A=USR 30000
or
PRINT “” AND USR 30000;
or
PRINT “” AND USR 30000;
- 1024MAK
- Posts: 5145
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: Drop the PRINT instruction on ZX80
Mastering Machine Code on Your ZX81 by Toni Baker which also covers the ZX80 (where it’s often referred to as the ‘old ROM’, in the context of the book, ‘new ROM’ means the ZX81 ROM).
Mark
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
Re: Drop the PRINT instruction on ZX80
This doesn't solve my problem really. First point is that ( "" AND USR 30000) is not an admissible expression. The first term is a string, the second a number, and AND is expecting numbers. But I want to go more in the details:
The command under discussion should be used to call a USB driver for the ZX80. The structure of the command is as follows:
PRINT USR(MC-address), "X" <CR>
where X is some letter which is read by the MC program first and is used for branching inside of the MC program. The problem is a right jump at the end of the MC back to BASIC without additional printings or error messages. Including cleaning the stack. This is not as hard for the ZX81, but I was not successfully for the ZX80. Are there available any samples for similiar situations?
Or an example solving my problem accurate? Let me formulate the task:
I would like to have an MC-program for the ZX80 doing the following: The command PRINT USR(MC-address),"X" <CR> should print out just the given letter X, nothing else.
Re: Drop the PRINT instruction on ZX80
The command makes sense, the result of the printing is only displayed when the boolean result from the USR call is true, which it is when BC >0.
However the PRINT itself wil print nothing even when BC >0, the ; will keep the cursor on the same line and not to the next line.
Your problem is different than what you asked. You need to drop the RET to the printing on the stack.
On the ZX Spectrum you get that by increasing the SP with 14, don’t know by heart how much you need on a ZX80.
After that you need scanning or GET CHAR RST routine to read your data.
However the PRINT itself wil print nothing even when BC >0, the ; will keep the cursor on the same line and not to the next line.
Your problem is different than what you asked. You need to drop the RET to the printing on the stack.
On the ZX Spectrum you get that by increasing the SP with 14, don’t know by heart how much you need on a ZX80.
After that you need scanning or GET CHAR RST routine to read your data.
- 1024MAK
- Posts: 5145
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: Drop the PRINT instruction on ZX80
To be fair, this is valid on a ZX81. But as you have found out, the syntax checker does not allow it on a ZX80.
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
Re: Drop the PRINT instruction on ZX80
Do you absolutely need to use PRINT? Couldn't you do RAND USR 30000?
I see now from your other post what you're trying to do; I know it's possible (for example SHREB does this, but using REM and LPRINT instead I believe), but don't know the technique. It would basically be a parser that then 'skips' to the end of the line for what to execute next/return to the initiating instruction.
Re: Drop the PRINT instruction on ZX80
From what I remember seeing SHREB doing, it's usually formulated like:
My guess is that the MC function then returns 0, meaning the THEN part never gets executed (which in this case it wouldn't, being a REM, but other tokens could be used to mean other things, like LPRINT). This would be the simplest way to 'suppress' any action from the MC call returning anything to BASIC.
Code: Select all
IF USR MC-ADDR THEN REM <stuff to parse or execute by MC routine>
Re: Drop the PRINT instruction on ZX80
It seems so that the problem is solved now. The "magic" number for the ZX80 could be 8. For details see the assembler instruction at:https://forum.tlienhard.com/phpBB3/view ... 512#p46512dr beep wrote: ↑Sun Nov 01, 2020 2:55 pm The command makes sense, the result of the printing is only displayed when the boolean result from the USR call is true, which it is when BC >0.
However the PRINT itself wil print nothing even when BC >0, the ; will keep the cursor on the same line and not to the next line.
Your problem is different than what you asked. You need to drop the RET to the printing on the stack.
On the ZX Spectrum you get that by increasing the SP with 14, don’t know by heart how much you need on a ZX80.
After that you need scanning or GET CHAR RST routine to read your data.