New answers tagged

0

If I'm reading that diagram correctly, the Z80 expects bus control to transfer (either way) synchronously with the rising edge of the clock. The diagram shown is scaled to match a typical clock speed of several MHz, but the time between the clock edge and the control lines being driven will be independent of the actual clock speed. You could handle this ...


6

Maybe I'm overlooking something, but why not use pull-ups (or pull-downs, whatever is required for a safe state) on all control lines?


9

The most common way to do a general multiplication is the "shift and add" method, where for each bit set in the multiplier you add the multiplicand to the high portion of the result and then shift the result right. Thus, the lowest order bit of the multiplier, if set, contributes 1× the multiplicand to the result after the result has been fully shifted right,...


13

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 ...


15

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 ...


4

One of the complications with z88dk is that there are two libraries: classic and newlib. These days, a lot of the code is shared but there are two separate implementations of stdio and console drivers. The comment about "ROM driver" is referring to how classic scrolls the screen: it just calls address 3582 in ROM3 by default. However, the compile line ...


1

In ZX Spectrum basic, POKE 23692,255 works fine, when done every line to be printed -- the scroll becomes effectively infinite and never requests "scroll?". Check that printf() code does not fiddle with the 23692 value and that z80_bpoke(23692, 255); really does what it is intended to do. Maybe *((char *)23692)=0; would work instead?


1

With newlib it seems you have to explicitly state that you want to include the floating point formatter with a pragma, just add: #pragma printf %f to the source code. That way it will work with both sccz80 and zsdcc as the compiler. By default the integer converters are included. sccz80 does format detection, but this is only picked up the classic library....


Top 50 recent answers are included