Jump to content
IGNORED

how was machine language done on the TS1000 and zx80/81?


Recommended Posts

i'm curious. i've viewed some of the sync magazines (thanks to archive.org) and was wondering: how did they ever get the listings to work. i can understand using the REM statement to hold them in memory but outside of poking memory, how else did they get them to work?

Link to comment
Share on other sites

That was exactly how to do it. First define a line that will hold your routine:

 

10 REM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

Then POKE values directly into the BASIC program, which requires knowledge of the memory map and that you can't use certain values like 0 which would indicate end of line. Once you had put everything in memory, save and don't edit the line.

 

Once again, what is wrong with POKE?

Link to comment
Share on other sites

i dont understand the point here... Poke was a Basic command to insert a value in a position of memory, as every other basic of the era did, from Apple to to Trs 80... what exactly is the prejudice with the zx-81/sinclair models ? they have a lot of other points to criticize, like the keyboard or initial memory, but that...

Link to comment
Share on other sites

You could put machine language above RAMTOP but that was problematic: saving a BASIC program didn't save the machine code. And, on the ZX81/TS1000, there was no easy way to say "save this portion of memory". It was a little easier with the 2068.

 

This book might help you with ZX81/TS1000 machine language programming.

Link to comment
Share on other sites

  • 2 weeks later...

That's the same way you can embed assembly in most Microsoft BASICs.
You can use a REM or a string variable on the first line.
This is how I created a few of the BASIC patches for the MC-10, CoCo 3, and Plus/4. I also used it on a TRS-80 Model III when I was in high school.
The one limitation was that you couldn't use a zero in your code because that's the end of line terminator and that would screw up the interpreter.
Once the code is embedded in the string or REM, you can delete the code that POKEs it into memory and the data statements.

  • Like 1
Link to comment
Share on other sites

Well... it could be. The code is all over the place and won't execute. You're missing NEXT statements, the DATA statements are inside your (non-existent) FOR loops... and then there's that RESTORE 10 that'll be executed 25 times.

 

This isn't ZX-81/TS-1000 BASIC: it lacked READ, DATA and RESTORE.

 

Machine language on the ZX81/1000 is usually executed with a USR statement, like LET A = USR(16514)

 

A would receive any value the machine code returns.

Link to comment
Share on other sites

If you know what the address is for the first byte after the REM (it should always be the same on startup) then you just assemble your code to start at that address.
Have the assembler output a lst (or equivalent) file that shows the addresses, machine code as hex, and original code.
Then you just convert from hex to decimal and put it in data statements.
No fun math to do for the jumps, the assembler does it.
On the TRS-80 you had to beware of zeros in the data (the line terminator) but I don't know if that's an issue on the ZX-80

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...