10 ms·
Have to upvote - just because Z80: I spend my youth programming this thing literally in hex: To program my Amstrad CPC646, I wrote down opcodes on a piece of pa
by japanuspus 4y ago
Have to upvote - just because Z80: I spend my youth programming this thing literally in hex: To program my Amstrad CPC646, I wrote down opcodes on a piece of paper and then manually translated to hex according to a copy of the Z80 spec sheet I found in the back of some book. Relative jumps were especially fun...
If only I had had the internet, maybe I would have stumbled on the concept of an "assembler". Not sure if it had been more fun? In any case, I did not find the protected mode.
- mfuzzey 4y agoI did that too, on a ZX80 back. Well after a week of doing it using a book and caclulating relative jumps (the backawards ones were worse) by hand I thought "there has to be a better way" and wrote my own assembler in BASIC (but I didn't know it was called an assembler at the time)
- kazinator 4y ago> If only I had had the internet ... I joined the fray later, in the early 1980's. I had access to public libraries, computer magazines like Byte and Creative Computing, computer stores with software, books and magazines, dial-up BBSes, computer expo events, enthusiast meet ups and swap meets, ...
- kazinator 4y agoThough knowing what an assembler is didn't translate to easily getting one. I used an interactive instruction-at-a-time assembler inside the Apple II+ ROM. This was a small level above entering hex. MS-DOS had a similar facility in DEBUG.COM. Eventually I got my hands on a copy of Randy Hyde's LISA (Laser-Systems Interactive Symbolic Assembler), and was able to make larger, more complex programs.
- KingOfCoders 4y agoMe too, my first real assembler program was a hex editor with RSX |hex on a CPC464.
- zimpenfish 4y ago> In any case, I did not find the protected mode. Because, unless I'm misunderstanding the video, it doesn't exist until you add a whole bunch of external hardware (which is why the video is clickbait - a fact he acknowledges later.)
- visarga 4y agoJust a flip flop and an OR gate.
- qwerty456127 4y ago> until you add a whole bunch of external hardware Why mind this if the hardware to add is the same level of technology like Z80 itself? I would be glad to build a computer as advanced as possible combining some Z80s and additional HW.
- zimpenfish 4y ago> Why mind this if the hardware to add is the same level of technology like Z80 itself? But it's not "the Z80's protected mode" - it's "the Z80 + an extra circuit to emulate protected mode". It's a super clever hack, yes! But filthy clickbait also.
- mannykannot 4y agoThere’s a small irony in your clickbait complaint containing a misrepresentation of the content.
- moron4hire 4y agoIt's not uncommon for chips to support configuring different features by wiring in external components. Though usually they are passive components, this isn't completely absurd.
- korfuri 4y agoI mean, true, but "a whole bunch" is kind of misleading. It's a really clever hack using really a tiny amount of extra gates. It's still a very cool and innovative hack that nobody really had thought about before.
- mdp2021 4y ago> If only I had had I never understood how the English, and sometimes the Dutch, seemed in general (looking at their results) to be able to learn many times faster than amateurs in other territories. Sometimes with borrowed machines! "They gave me this, and after some weeks I had my first videogame working". I guess/ed it may have been a matter of human network - of being able to find knowledgeable people in the neighborhood to learn and exchange -, but it seems to have been often a solitary effort. It seems in a way like a talent, like that of the Scots for inventions, but there have to be keys that made kids talented coders through their own natural grit. Others have had difficulties in finding documentation alone, not to mention competent peers.
- josh2600 4y agoI’ve found that there are oddballs in just about every culture who make new things. Some cultures celebrate them, others don’t. The most tolerant cultures tend to get the most interesting new art. Edit: corollary, some of the best new art happens in the most restrictive environments. Maybe it’s a case of living at the extremes?
- mdp2021 4y agoI think that some environments raised kids to be grittier, more focused on getting results (and less e.g. prone to consume time in entertainment). > some of the best new art happens in the most restrictive environments You reminded me of Paul Buchanan, frontman of The Blue Nile, revealing that they would compose and rehearse standing shoulders to a wall in a narrow corridor in a house in Glasgow - that was the room they had.
- josh2600 4y agoSo real. I grew up real poor and it made me hungry. I think that's where a lot of the hacker mentality comes from, one form of poverty or another. I am hoping to raise children soon and I am wondering how to help them to feel a hunger for the world without suffering in the same way I was raised. It's hard for me to imagine how they'll learn to thirst for the experience of the world if they don't have the same socioeconomic pressures, but I think that will be one of my most profound growing experiences in this life. I intend to accept them for who they are and to try to give them as much opportunity as they can stomach.
- tluyben2 4y agoYep, I still know all the hex opcodes of the z80 (MSX) now so many years later. It was nice; just type them in basic, poke and go. I never, at that age, knew the assembler equivalents and didn’t know it was a think until many years later. I learnt c and pascal before having an actually z80 assembler. After that I moved on to Amiga where I did learn 68000 instructions to make demos and games.
- bbojan 4y agoHaha, did the same thing also on a CPC464. I did know about the concept of "assembler", I just wasn't able to obtain one.
- shever73 4y agoDid exactly the same on a ZX Spectrum. Fun times! Sprites drawn on graph paper and every byte was precious.
- Tepix 4y agoHaving to do the opcode translation to hex manually sounds like torture! I started with the 6502 on the C64, the Z80 came much later when i wrote some trainer patches for Gameboy ROMs.
- flohofwoe 4y agoAfter a little while you know the most common opcodes without having to look them up, I still have some burned into my brain forever: LD HL,nnnn: 21 nn nn LDIR: ED B0 JMP nnnn: C3 nn nn CALL nnnn: CD nn nn RET: C9 ...etc..., and probably dozens more after getting back into the groove :)
- Tepix 4y agoI only remember NOP from x86 assembler: $90
- deleted 4y ago[deleted]
- rwmj 4y agoThe ZX81 & Spectrum manuals had a big table of opcodes in the back so it wasn't too bad. Most of them you memorized after a while. See page 94 here: http://www.retro8bitcomputers.co.uk/Content/downloads/manuals/zx81-basic-manual.pdf http://www.retro8bitcomputers.co.uk/Content/downloads/manual... Other Z80 computers did have pretty capable assemblers, even with simple macros as I recall.
- mrspuratic 4y agoThis was the tersest possible listing of opcode mnemonics :/ I cobbled together a basic understanding from various machine code listings (Toni Baker, Your Sinclair IIRC), and my "assembler" was paper, pencil and a FOR/INPUT/POKE loop... My uncle loaned me a Sharp MZ700 one summer, its manual had a detailed breakdown of Z80 opcodes (in mere 4 pages) which was a revelation to me, and an annotated monitor in assembler. https://archive.org/details/sharpmz700ownersmanual https://archive.org/details/sharpmz700ownersmanual (p160-)
- Gordonjcp 4y agoThe ZX81 and ZX Spectrum manuals had the character code table (ASCII-ish on the Spectrum, something totally different on the ZX81) alongside all the Z80 mnemonics and their hex and decimal values in the back. I think the Jupiter Ace manual might have had that too, but it's been a long time since I've even seen my copy of that.
- Starwatcher2001 4y agoI did a lot of that on my CPC464 and TRS-80 too. Thanks for rekindling the memory. Relative jumps were the easiest way to make code relocatable, but you were limited to +/- 128 for an offset. I used the "Programming the Z-80" book by Rodney Zaks, which is still on my bookshelf. Some manuals just can't be disposed of! From memory I recall my favourite instruction - LDIR (Z80 block memory move) is EDB0, and JMP is CA. Slightly more on topic, I piggybacked a 2716 EPROM onto the back of the TRS-80 ROM so I could get to the previous hard-coded RST locations and interrupt vector of the Z80 processor. In a nutshell, that allowed me to stop/debug/hack running programs without software being able to prevent me. Fun times.
- jgrahamc 4y agoI used the "Programming the Z-80" book by Rodney Zaks I have that and the 6502 book by Zaks also. I read those books when I was a teenager as if they were tomes filled with wisdom of the ancients. I protected them with plastic book covers and wrote my own notes in the margins in pencil. I worked a Saturday job when I was 16 and spent the money on them. At the time they were so expensive!
- pmontra 4y agoSame plastic cover on Zaks' book (it's still there) and excellent paper quality.
- davidgerard 4y agosame, protective plastic cover and all
- GeorgeTirebiter 4y agoThanks you guys, now the eBay price for those chestnuts has likely doubled! ;-)
- beachy 4y agoDitto, I've been purging my old tech books but I just couldn't let the Zaks book go.
- mananaysiempre 4y agoThere’s an Russian-language memoir[1] by Kronrod (of the ITEP programming school that also includes Adelson-Velskij and Landis of AVL fame and served as the birthplace of ABBYY some decades later) that mentions that for some time, they did things exactly that way, and that it was a small breakthrough to be able to talk about symbolic variables and draw jumps graphically once they had explained to the secretarial staff how to translate that into addresses. So, taking into account the lack of accessible reference material, you are in good company :) (The book also includes a discussion on VLIW-style microcoding, a plea for more registers, and a note how a population count instruction may be worth including despite its situational utility because of how easy it is to do in hardware compared to a software emulation. That team did one of the first chess programs, though, so it’s not surprising popcount came to minds easily.) [1] https://www.goodreads.com/book/show/58582645 https://www.goodreads.com/book/show/58582645
- wazoox 4y agoI knew what an assembler was (because my friend who had a C64 had one), but it was too darn expensive, so I wrote one myself in MSX BASIC :) Though it was very primitive, and didn't implement much more than an opcode table and a load and save to tape feature.
- actionfromafar 4y agoI bought one from a classified in a computer magazine. The guy who sold it had written it himself, in hand assembled machine code. I knew there existed other assemblers, but I couldn't find any to pirate or buy. I didn't have a disk drive, only the standard cassette deck, so before selling it to me he had to slightly rewrite the assembler to support loading and saving programs to cassette. In the end, the syntax was not exactly like in the Rodney books. Some examples worked, some not, so I resorted quite a bit to hand assembling myself.
- wazoox 4y agoAs I had the Rodney book (and no disk drive: it was twice as expensive as my computer!) at least I implemented my assembler as the one from the book :)
- pjmlp 4y agoI feel you pain, using DATA statements in BASIC, or monitors, as I could not yet afford buying a nice Assembly editor at the time, and there wasn't none I could find on local shops, importing it from some UK store would have been the option.
- davidgerard 4y agodid the same with the Rodnay Zaks book to hand. Definitely my favourite tech manual in my early teenage years.
- xattt 4y agoWhat would you say would be a contemporary equivalent for kids to poke around on to the same experience you had back then with the Z80?
- deleted 4y ago[deleted]
- markx2 4y agoCPC6128 with among others a MAXAM 1.5 ROM hanging off the back. (Along with PROTEXT). Couldn't write BASIC to save my life, but Z80 Assembler using MAXAM and the 6128 detailed manual and I flew along happily. https://www.cpcwiki.eu/imgs/e/e2/Maxam_Manual.pdf https://www.cpcwiki.eu/imgs/e/e2/Maxam_Manual.pdf Edit to add: Found the Firmware Manual https://archive.org/details/SOFT968TheAmstrad6128FirmwareManual https://archive.org/details/SOFT968TheAmstrad6128FirmwareMan...
- mattl 4y ago464 or 664?
- chx 4y agoC9 club members unite! (I forgot it all. It's been 35 years ago last I did this and high school mostly crowded it out of my memory. But C9 was RET, that I still remember. ZX Spectrum, for me. But Z80 manual (dis)assembly nonetheless.)
- ikari_pl 4y agoNice, you had a spec. I had Discology, it had built-in disassembler. So I wrote a binary file like 00 00 01 00 00 02 00 00 03... and disassembled, and put in a notebook what code produced what command (then adding different arguments than all zeros, then finding longer opcodes and generating a new file for them...)
- moosedev 4y ago> To program my Amstrad CPC646 Now I wonder if you meant CPC464 or CPC664 :) (Probably the former, as the 664 was relatively rare, at least in my experience. I’m not sure I ever saw one.)
- bch 4y agoMy “paper programming” experience was about the same, but on the Vic-20 and Commodore-64. Only later did I realize the mnemonics could be coded directly, rather than me getting the decimal opcodes from a table and POKE-ing them into memory.
- craig_livpl 4y agoI did the same, but with an Oric Atmos (6502). It came with an amazing manual, which I've recently had another look at. It taught BASIC, character graphics, machine code, binary and how negative numbers are represented, memory addressing, addressing modes, registers, and the instruction set, explaining each instruction, the machine's memory map, ASCII, lists of binary, hex and decimal conversions and tables of op-codes, ROM routines with call and return parameter registers, circuitry of the machine, and a decent index. I think I learnt more about computers from that book than from any other.
- natas 4y agothe 464 was a ton of fun, I spent more time with it than my own family.
- JoeAltmaier 4y agoCurious note: the opcode space of the Z80 was best viewed in octal, not hex. The first 2 bit decoded the instruction class e.g. 01 was the MOV set of instructions. The next 3 bits were register destination; the last three were register source? Registers were numbered [0-7] b,c,d,e,h,l,m,a if I remember right. h and l were 'high' and 'low' part of the 16-bit indirect 'm' memory address. So in octal, 134 was "mov e,h". You now know 1/4 of the entire Z80 instruction set!