logoalt Hacker News

kazinatortoday at 12:24 AM1 replyview on HN

You've not done it long enough to have worked with machine language programs that used instruction timing to click a speaker.

This worked well in 1980's microcomputers which used an accurate, crystal oscillator clock. IC's like the MOS6502 or Intel 8086 don't have built-in clocking. The boards were large and costly enough to afford a clock; and often it was dual purposed. E.g. in Apple II machines, the master oscillator clock from which the NTSC colorburst clock was derived also supplied the CPU clock.

These processors had no caches, so instructions executed with predictable timing. Every data access or instruction fetch was a real cycle on the bus, taking the same time every time.

Code that arranged not to be interrupted could generate precise signals.

Some microcomputers used software loops to drive serial lines, lacking a UART chip for that. You could do that well enough to communicate up to around 1200 baud.


Replies

rwmjtoday at 10:43 AM

As in the Manic Miner soundtrack on the ZX Spectrum: https://cirrusretro.com/listen/5333-manic-miner-zx-spectrum (warning: loud and annoying!)