Ranger03 Posted July 13, 2018 Share Posted July 13, 2018 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? Quote Link to comment Share on other sites More sharing options...
carlsson Posted July 13, 2018 Share Posted July 13, 2018 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? Quote Link to comment Share on other sites More sharing options...
Ranger03 Posted July 13, 2018 Author Share Posted July 13, 2018 too cumbersome. there was no other way huh? shame Quote Link to comment Share on other sites More sharing options...
flanauf Posted July 14, 2018 Share Posted July 14, 2018 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... Quote Link to comment Share on other sites More sharing options...
Ranger03 Posted July 14, 2018 Author Share Posted July 14, 2018 most of us are used to IDE's so going back to basics is alien. it is for me. yet i like the ts1000 and zx81, to the point where i had a weird dream involving one the size of a wristwatch Quote Link to comment Share on other sites More sharing options...
Ranger03 Posted July 16, 2018 Author Share Posted July 16, 2018 it's the memory map. it's hard for me to understand Quote Link to comment Share on other sites More sharing options...
factus10 Posted July 16, 2018 Share Posted July 16, 2018 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. Quote Link to comment Share on other sites More sharing options...
Ranger03 Posted July 24, 2018 Author Share Posted July 24, 2018 do i use Rand or run for machine code or run? also, does the zx81 actually use anything in the REM command or does it ignore it? Quote Link to comment Share on other sites More sharing options...
+5-11under Posted July 24, 2018 Share Posted July 24, 2018 I think on the ZX81 we put the numbers in data statements, then made a short program to read those and poke them into the REM statement. Doing math for the jumps was fun. Quote Link to comment Share on other sites More sharing options...
Ranger03 Posted July 24, 2018 Author Share Posted July 24, 2018 I think on the ZX81 we put the numbers in data statements, then made a short program to read those and poke them into the REM statement. Doing math for the jumps was fun. could you provide an example Quote Link to comment Share on other sites More sharing options...
JamesD Posted July 25, 2018 Share Posted July 25, 2018 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. 1 Quote Link to comment Share on other sites More sharing options...
Ranger03 Posted July 25, 2018 Author Share Posted July 25, 2018 (edited) would this be an example of a machine code program? and yes i read it and it mentioned just printing to the screen, not actually running the machine code Edited July 25, 2018 by Ranger03 Quote Link to comment Share on other sites More sharing options...
factus10 Posted July 27, 2018 Share Posted July 27, 2018 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. Quote Link to comment Share on other sites More sharing options...
Ranger03 Posted July 27, 2018 Author Share Posted July 27, 2018 got it. Quote Link to comment Share on other sites More sharing options...
JamesD Posted July 29, 2018 Share Posted July 29, 2018 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 Quote Link to comment Share on other sites More sharing options...
Ranger03 Posted July 31, 2018 Author Share Posted July 31, 2018 i am currently trying to do a version of Snake for the zx81. here is the code so far (though i doubt inkey$ is a good usage for key presses) machine code for snake.bmp Quote Link to comment Share on other sites More sharing options...
Willsy Posted August 28, 2018 Share Posted August 28, 2018 I'm *so* glad we don't program like this any more! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.