Assembly program only using ZX81!
Vložit
- čas přidán 10. 09. 2024
- This video is about writing assembly code on a real zx81 just for the hell of it. It's possible now as it was back then to write code(assembly or higher level language) on a different computer and then save that compiled or assembled code in the real zx81. I just wanted to explore some options that might have been open to small scale home coders, not those working for or owning their own companys.
some code on my github:
github.com/Adr...
get the zxas assembler from here:
spectrumcomput...
see also this great page:
bumbershootsof...
I wrote the game Masada Class in the 90s on a real ZX81 using ZXAS assembler. It took 18 months
Thing is we did use compilers , TRS80 ran the compiler , RS232 uploaded the code to spectrum. Later Especially for Atari / Amega 386/486 Pc where used with cross compilers. As even 16bit was slow at compiling. Rem Statements where really using in Magazines. And as a basic Learning key to Assembler. The Back of the Spectrum Horizon hand book was unique as it had the ascii to Sudo Assembler Language listed in its Index pages. 'ld a,8 ' ld hl,234 'etc so that you could have the 8bit decimal code. Spectrum Assemblers arrived as more RAM become available. But the preferd method outlined above was still sued by software houses.
In modern times you can use a compiler and with that you can get much more out of a (1K) ZX81. You can even set code over the systemvariables.
You mean a compiler can produce smaller code in comparison to a real talented assembler-programmer? Just kidding
@@gehtniemandwasan2925
The talented coder will use the bytes the ZX81 itself needs when coding directly ON the ZX81. My base model sets the BASIC-line to start machinecode fully over the SYSVAR and the machinecode is coded without a REM. And What is a printerbuffer anyway?
I learned assembly language to fill the screen. no other way to do it. good stuff.
Gosh that’s painful. The problem really is that back then the tool sets they could provide on the zx81 were limited. So although you assume they typed the rem statement in, they didn’t, they actually wrote it directly in assembler. Nobody actually used that translation set you see in the manual. Yes, as you show it is possible, although extremely painful to type in the character set representing the assembler instruction no programmer did that. If you see the link below, the guy writing this set of videos explains how back in 70’s and 80’s they built their own computers at Marconi Radar Systems In Chelmsford and coded the air traffic control systems for the UK in assembler. He’d be pleased I’m sure to think they had brains the size of planets but he explains how it was done and how to actually build a computer. He shows it being coded in assembler and then compiling that assembler code into machine code and then loading that into memory on the computer. Back then there was no computers no internet so you couldn’t google a solution and you had to build your own and work it out yourself. The Zilog chip was used by Marconi also, and in Rochester in Kent in the British Aerospace factory in the 80’s they used the zilog microprocessor to build a computer rather than the 8086 and that computer they build was coded for submarine hunting. Here the code for the Zilog was written not in Assembler but a high level language called Coral 66, this was then compiled into machine code and then loaded into memory of the Zilog computer they designed. On the zx81 it would have been coded in assembler and not done via the rem and character representation as that’s just too convoluted, and hard to do. As you show it can be done that way, but they just wanted to provide some mechanism using what was available on the zx81 at the time to show how this character representation could be used to create assembler, but in reality it was coded directly in assembler
czcams.com/video/tOkGg0UEm9w/video.htmlsi=9PcEQ9frNw2-Mrew
It was... most of the times and don't even bother to save first version to tape...
10:31 I noticed line 32 looked odd, so I replayed for a closer examination, the mnemonics aren't valid, and in fact the assembler has fudged its output (10:52) producing code LD A.(16532) and LD A.(16533) - instead of report an error. The correct mnemonic is LD DE.(16532) which would encode to instruction bytes ED 5B 94 40.
Yes wow you're right, 3A 94 40 is definitely ld a, (16352) and not ld e,(16532). Infact ld e,(HHLL), isn't a valid instruction so is probably my mistake that the assembler didn't catch a an error. As you say it should be ld de,(16532) which assembles to ED 5B 94 40
@@byteforever7829 The assembler is at fault. I had ACS's Ultraviolet Assembler for the spectrum, it was similarly sloppy with error checking.
@@EmmittBrownBTTF1You had an assembler ?🤔
@@AK-vx4dy Ultraviolet, it was sloppy too, so I wrote my own, by the time I got it up to equivalent spec it was 1k smaller, and blazing faster. Ran on a Spectrum
@@EmmittBrownBTTF1 cheater 😜 I had only zx81 manual (heavily abused), ballpen and notebook 😉
But without other machine, you needed some kind of editor at first or put assembly mnemonics after REM, if editor wasn't full screen then it were quite tideius too.
I could never get my head around this. Basic was easy and today I understand html but this, no, machine code no, even java script today, no
I struggle when i've not done any assembly for a while, and i'm a C++ programmer normally. Easy things in other programming laguages like "if x < 5 then..." are more complicated in assembly. I find i tend to try to change the logic around to make it easier to write or just experiment until it works and when i need that again, i'll copy/paste.
I assembled manualy regularly... Rather small programs. Once i assembled manually disassembler based on z80 cpu book. I dissasembled most of rom, and used some procedures to write "Excel" for zx81... this was basic assembly hybrid, but have formulas and even "plots"... also i experimented with "turbo" and sound "digitalizing"... Last pages of zx81 manual were abused, dark and fell off...
😅
Is there no assembler for the Z80? I had one around 1981 for the trs80 color computer. Never heard of using basic to poke an assembly language program.
Yes there's a few like zxas i've videos on those as well czcams.com/video/t77zdXxKYCo/video.htmlsi=01VVQL2JJJZlG099
alot of programmers used rem statements on the vic20 for short routines, must be a small memory thing.
@@ncurtis1970 that is old school AF, we really did have to walk uphill both ways back then
This is awesome!
03:15 I very much doubt that code was hand coded. It was probably written and assembled on a more capable machine and then ported across to the ZX by some means. If they didn’t have a hardware interface they probably saved the data in ZX format that could simply be loaded into the ‘81. The average user without such facilities would however have to hand assemble their code but then would probably use a simple data loader (For/Next loop) to poke the values into 16514 onwards. If the data is stored as Hex or Decimal values in a string or array or similar then it can be saved with the program and easily modified during debugging.
Think I remember reading that Matt Smith used a Model III Tandy to code up manic miner and "squirted" the assembled binary over to the zx spectrum en.m.wikipedia.org/wiki/Matthew_Smith_(games_programmer)
@@byteforever7829 Sounds familiar. I'm sure there is a video online of a documentary where he shows us around his complete setup. It may be in one of the references that are linked to on the page you refer to or possibly on 1 of my dvds such as bedroom coders etc. Certainly it was common practice for any of the the popular software house.
I hand coded many programs that way, it was most effective on bare zx81, any other representation means at least 3x bytes needed and bare has 1KB only. Entering in a loop could work but I don't see advantage and see some some possible problems.
When I was a kid, I did this through all my assembly learning. The rate of success was about 2%, and by success, I mean not freezing the poor little bastard. Most of the times, the code just crashed and you had to start all over again. But then, putting the hand-translated assembler program in a REM statement meant that you could SAVE and LOAD to the dataset (cassette tape) to recover after the usual garbage screen.
@@juanro22 Same here, but i was about 14, at first attempt i didn't bother to save because it was obvious it will crash or freeze 😉
Wow!
16514 I cannot forget this address...