Hot answers tagged

56

There are many issues here. As it is already said in comments, decoupling capacitor is a must! 555 (non-CMOS) timer output is very much like the output of TTL ICs, however Z80 requires a firm logic one. When feeding Z80 clock pin from a TTL output, you should use pullup resistor of 200..500 Ohm. NMOS Z80 uses dynamic logic, that means it has some minimal ...


44

One language that was popular on early 8-bit micros, including those that used the 6502 CPU, was Forth. Forth is exceptionally good for this use case, and superior to a C compiler, because Forth can make more efficient use of the 6502's hardware stack. Forth lacks any sophisticated methods of dealing with parameters. Everything is passed through the Forth ...


41

It appears that A0 through A6 operate correctly, but A7 though A9 (I've not tested the rest of the upper bits) are only active on the clock edge. Doesn't that exactly look like refresh cycles? :)) Basic Z80 bus behaviour, here especially the M1 cycle: Z80 timing is structured in Machine cycles (M-states). A machine cycle consists of several Clock cycles (...


23

... a scaled-down, cost-reduced, clone of the Intel 8080. The Z80 had a massively extended instruction set, featured more addressing modes and had more registers than the 8080. It also had a built-in DRAM refreshing logic. ... and it was more expensive than the 8080! This is the opposite of "cost-reduced". It only used a 4-bit ALU. I assume this would ...


22

The TRS-80 series is Z80 based, and Z80 uses, like all 8080 offspring (*1,3) a separate address space for I/O. It allows easy decoding for I/O. Thus memory address 0000h is different from I/O address 00h. On logical (program) level, access to either address space is selected by the instructions used. Memory instructions always access memory address space ...


20

I know that the Z80 and the 6502 are very different, but I was wondering if there are any languages on a higher level than assembly which can generate compact and efficient 8-bit machine code by design, and how this was achieved? Well, a prime candidate would be Ada. It was a specific design goal for Ada to produce good code for tiny and 'odd' ...


20

C can be greatly improved as a language for the 6502 and Z80, as well as micros like the PIC and 8051, if one abandons the notion that implementations must provide for recursive subroutine calls, and adds qualifiers for things in zero page or pointers that are limited to accessing such things, and (for the Z80) adds qualifiers to identify objects that are ...


19

If there are two consecutive bytes of RAM one can write at a known address, one could store the byte values E1h, E9h [POP HL / JP (HL)] at that address and then CALL it to place the address following the call into HL. Alternatively, if those byte values appear at some known address in ROM one could simply call that address likewise. There isn't any way to ...


18

It may help if you load the address of the text to be printed. After all, you relocated the routine including the text, but still load the old address: ld de, text ; 11 0E 7F; => 17 14 127 7F0Eh equals 32,526, which is fine with the orriginal address of 32,512. With 65,415 as start address, DE should now be loaded with 65,429, or FF95h, as ...


18

For Spectrum BASIC, the routine for Small Integers (16 bit) can be seen on page 179 of the Complete ZX Spectrum ROM Disassembly, where it loops over the sixteen bits of one operand, shifting them into the carry bit, adding successively doubling values to the result value each time the test passes, and testing for overflow if the result doesn't fit in a small ...


18

The Z80 is "binary compatible" with the 8080. It adds a bunch of new instructions, but places them all in unused (well, undocumented) opcodes. yes .. err, no, they placed them on redundant opcodes. For example the whole 00-xxx-000 group were NOP instructions for the 8080, while Zilog only left 00h as NOP, while the others became jumps (and EX). Likewise ...


18

Bill's MinZ180 is tiny, fast, fully assembled, and falls within your price range. . He may have one or two left, I'm not sure.


16

A Z80 will always do a refresh cycle during T3/T4 of an M1 cycle. Disabling is not possible. During a refresh cycle the /RFSH signal will be active for both cycles, signaling a valid refresh address, while /MREQ is active during the second half of T3 and the first half of T4. Neither /RD nor /WR will be active during T3/T4. Thus a refresh cycle is never a ...


16

Multiplying (and dividing) by powers of 2 has always been trivial and fast even for 8-bit processors like Z80 or 6502, with shifting instructions (commonly arithmetic shift left aka ASL). But those processors didn't have a MUL instruction so when it came to non-power of 2 multiplication, it always involved shifting, testing bit and adding shifted result if ...


14

Funny that this post still doesn't have the right answer. The Commodore 128 of course! Thanks to Tommy for providing a beautiful picture of the mainboard, which reveals the Z80B very clearly:


14

I'd just like to expand on a couple of points in lvd's excellent answer. Reset Circuit You might get by with just using a jumper wire to short the reset pin to ground for a brief moment after you've powered up the CPU. It's worked for me, but if you're having problems it's best to build a proper reset circuit. Many CPUs have a minimum length for the reset ...


13

Your observation about the 64K address space is correct, your 32K RAM and 32K EEPROM will be able to fill that address space to 100%. In Z80 designs, the ROM/PROM/EPROM/EEPROM is usually placed starting at 0x0000 since when you do a RESET, the Z80 starts executing at 0x0000 and you usually want to have your program start there. Of course there are many ...


12

Possibly a simple logic trick. The slow path in addition is carry propagation (not the individual half-adders). You can thus often double the clock rate by pipelining the carry. If you pipeline the carry, then you can reuse the bit adders at the beginning of the chain, and put them at the end. Depending on the ratio between pipeline registers, reuse ...


12

You can write Zilog 80 programs and games (as I do) on the Commodore 128. I exploit Z88DK, which does the magic of booting the C128 in Zilog 80 mode. The Zilog80 at 2mhz effective speed is about as fast as a MOS6502/8502@1mhz in many situations. In some situations that depend on a bigger hardware stack, the slow Zilog80@2mhz can beat the MOS6502/8502@1mhz. ...


12

The Z80 can access all hardware I/O addresses in the C128, with the natural exception of the built-in I/O port (a 6520-style PIA) of the 8502 CPU. That means that, if I remember correctly, the only hardware that is not easily usable from the Z80 is the cassette the CAPS LOCK key of the US version (ASCII/DIN in German models, I don't know what it is called ...


12

Preface, this is not really how RC.SE works. If you're looking for someone to design your hardware or write you a program, there are many sites out there where you can put a reward for someone taking the job. RC.SE is about answering your questions, as detailed as they are asked I am working on designing a Z80 computer and I would like to use a PS/2 ...


11

I'm not familiar with the C64, and didn't do much with the Apple ][ back in the day, but I did spend a lot of time under the hood of my TRS-80. There wasn't a lot of room for plugin accelerators in the TRS-80 Model I. I did put in a CP/M daughtercard, which remapped system memory to get ROM out of the low address space, but didn't replace the processor. ...


11

Those two mnemonics opcodes are known to have the same timing / same inner mechanisms of mapping into HL. It is obviously a bug in documentation from the link you give us. Those two pages you mention (86 and 87) were certainly edited based in the HL instruction, and someone forgot to edit that value to reflect the IY timing. Also, do not focus much in ...


11

opc T0 T1 MC1 MC2 MC3 MC4 MC5 MC6 MC7 mnemonic DD36S1U2 23 00 M1R 4 M1R 4 MRD 3 NON 5 MRD 4 MWR 3 ... 0 LD (IX+S8),U8 FD36S1U2 23 00 M1R 4 M1R 4 MRD 3 NON 5 MRD 4 MWR 3 ... 0 LD (IY+S8),U8 As you can see, the timings (T0/T1) are identical. Beware most Z80 instruction set docs contain errors (even those which claim to be 100% correct). ...


11

Why did the Z80 with 4-bit ALU out-perform the fully 8-bit Intel 8080? Did it? I guess this depends on what 'performance' meant here. If it's about instructions per clock, then No. They are, for all practical purposes, identical. If it's about reaching higher clock speed, then Yes. If it's about an increased instruction set, then as well Yes. If it's about ...


11

The 0xDD does not allow an interrupt to happen after it's been fetched, no matter what comes next in the instruction stream. As Wayne Conrad pointed out, otherwise the CPU would have to time travel into the future to find out what instruction is going to get fetched.


11

Assuming you use the SDCC backend: SDCCs printf does not include float support by default. You need to recompile the z80.lib library with USE_FLOATS=1 set in printf_large.c


11

About the R register on a real Z80: But is the 8th bit actually used? Yes, it's freely available and won't be touched by any instruction except loading R Is its behaviour undocumented or can it only be altered by loading it with a value from the accumulator It's well documented and can be used like assumed. When loaded all 8 bits from A are stored in R - ...


11

The .z80 format comes from the Z80 emulator by Gerton Lunter. He released some documentation about the file formats used in it, and regarding offsets 11 and 12, this is what the manual says: .Z80 FILES: ----------- The old .Z80 snapshot format (for version 1.45 and below) looks like this: Offset Length Description 0 1 A register ...


11

It sounds as if your ideal device would be something like a Raspberry Pi, but based on a Z80 rather than an ARM core. The Pi provides a video generator, USB ports for peripherals, GPIO points, and so on. However, the reason Raspberry Pis are so cheap is that they're based on System-on-Chip products that are made in large volumes for other applications. ...


Only top voted, non community-wiki answers of a minimum length are eligible