George Phillips
  • Member for 5 years, 8 months
  • Last seen this week
Fixing obscure 8080 emulator bug?
Accepted answer
97 votes

The General Advice Answer For a failure that happens so quickly (at most 89 instructions) I'd recommend simply looking at what your emulator does at each instruction and determine if did everything ...

View answer
Where did the popularity of the `i` variable come from?
Accepted answer
89 votes

FORTRAN made all variables starting with I, J, K, L, M and N integer by default. So just I by itself could be conveniently used as a loop variable. I imagine that choice was made because I, J, K, M ...

View answer
What is the origin of this bizarre advert of people wearing swimsuits in a room with computer hardware?
Accepted answer
60 votes

It's advertising computer room air conditioning. No doubt appeared in some late 1970's or early 1980's US-based computer magazine. But exactly which one I couldn't find based on a little bit of ...

View answer
How did the Z80 instruction set differ from the 8080?
Accepted answer
54 votes

For the most part the Z-80 extends the 8080 instruction set. If we consider just the 8080 instructions themselves there are a few incompatibilities: Overflow flag. On the 8080 bit 2 of the flags ...

View answer
How did Woz write the Apple 1 BASIC before building the computer?
38 votes

One thing is certain: Steve Wozniak was very good at hand assembling 6502. Instead of writing assembler mnemonics he could simply type in the necessary hex code. I realize this isn't a proper answer ...

View answer
What is the relationship between solid-state ROM and inaccessible content in arcade games?
Accepted answer
30 votes

Excess capacity. ROM chips come in standard sizes based on powers of 2 and it is quite unlikely a particular size will be exactly what a game needs. For example, suppose a game displays numbers that ...

View answer
What exactly is a cycle-accurate emulator?
Accepted answer
29 votes

For an emulator to be "cycle accurate" means the interactions between the components are timed accurately enough so that the emulation behaves the same way as the original machine for any given input. ...

View answer
Strange math syntax in old basic listing
25 votes

It is the exponentiation operator. Why is that? On a TRS-80 Model III the line of BASIC entered would literally be: LET Z1 = M * D1 * (PQ / A) [ 3 To get the [ character you would press the up ...

View answer
Variances in Basic highest line numbers
20 votes

With so many different implementations of BASIC a comprehensive answer is difficult. So here's the limits for TRS-80 Model I and III BASIC (written by Microsoft). Line numbers are stored as a two ...

View answer
Ratio of code density between 8080 and Z80
Accepted answer
19 votes

85% A Z-80 program will be 15% smaller than an 8080 program. To come up with this guess I took a reasonably tight Z-80 program, the TRS-80 4K Level 1 BASIC ROM and estimated the cost of replacing the ...

View answer
Measuring frame length on the ZX Spectrum
Accepted answer
15 votes

I took a look at how fusetest does it, but first let me talk about the general theory. The key is to write a Z-80 subroutine that will run for any given number of T-states (Z-80 parlance for cycles). ...

View answer
What kind of software was used to develop Nintendo 64 titles?
Accepted answer
14 votes

It used the same C compiler that shipped with the Indy workstation. See: Nintendo 64 Development Manual: C Compiler Suite It required a few flags not normally used when building C programs for the ...

View answer
Did Microsoft BASIC ever use Z80 only instructions?
13 votes

Yes, Z-80 instructions were used in Microsoft's Z-80 BASIC. For example, look at the TRS-80 Model I or Model III ROM BASIC and you'll find a relative jump JR NZ,0x871 at location 0x88E. The 8080 ...

View answer
Is NitrOS-9/OS-9 a preemptive multitasking environment?
Accepted answer
13 votes

Yes, it is pre-emptive. See: https://sourceforge.net/p/nitros9/wiki/The_Kernel/#multiprogramming In particular, it uses the 60 Hz interrupt to switch between active processes with the same priority....

View answer
z80 CPU User Manual AND P/V Flag
Accepted answer
12 votes

Referring to this reference manual: www.zilog.com/docs/z80/um0080.pdf See the bottom of page 78: This flag is also used with logical operations and rotate instructions to indicate the resulting ...

View answer
What did POKE 842,13 on Atari do? (Jamming the Return key)
Accepted answer
12 votes

If bit 0 of location 842 is set then the keyboard scanning routine immediately returns 0x9B which is the code indicating the ENTER key has been pressed. In short, a surprisingly literal effect. The ...

View answer
How was polyphony achieved on systems with only one audio channel?
12 votes

And these systems had not just a single audio channel, but a single-bit audio channel. There are no doubt many techniques, but a simple approach is to rapidly interleave the output of two or more ...

View answer
Intel 8080 - Behaviour of the carry bit when comparing a value with 0
Accepted answer
11 votes

The documentation makes the mistake of trying to explain the compare instruction in terms of how the 8080 functions internally and then compounds it by getting that explanation wrong. Check out this ...

View answer
How fast is memcpy on the Z80?
10 votes

Perhaps I should just edit the contradiction out of the accepted answer that starts by claiming you can do no better than LDIR then mentions that unrolling it to a series of LDI instructions is faster....

View answer
Why did MS BASIC use the line number for FOR loops?
Accepted answer
9 votes

Your initial interpretation was correct -- Microsoft Basic is storing the address of the first statement of the FOR/NEXT loop. But it is also storing the line number of the first statement. See the ...

View answer
What effect does exiting a FOR/NEXT loop early have on the TRS-80 Color Computer?
Accepted answer
8 votes

The BASIC in question (and many Microsoft BASIC versions) use a single stack to track both FOR/NEXT loops and GOSUBs. Here's a first approximation of the rules: FOR x puts a loop record on the stack ...

View answer
Accelerators for Z80 micros?
Accepted answer
8 votes

The main TRS-80 line (Model I, III and 4) had several third party Z-80 accelerator boards. The Archbold board could bring the Model I up to 5.3 MHz from 1.77 MHz. The Holmes Sprinter boosted the ...

View answer
Was there any indication that video game companies tried to circumvent Game Shark?
Accepted answer
8 votes

Yes. TV Tropes NoFairCheating page lists a number of games that would react to the use of GameShark including Donkey Kong 64: Using any Gameshark code in this game will cause DK to spasm ...

View answer
Carry flag in 8080/8085 subtraction
Accepted answer
8 votes

The 8080 sets the carry flag when the unsigned value subtracted is greater than the unsigned value it is subtracted from. So for SUB B carry is set if and only if the unsigned value of B register is ...

View answer
Arithmetic operations on multiple words on the PDP-8
7 votes

Doug Jones' PDP-8 Programmer's Reference Manual is very helpful here. There's pretty much just one way to do multi-word precision add and subtract. Memory addressing complicates things so let's just ...

View answer
How to use virtual cassettes with Matthew Reed's TRS-80 Model III emulator? (TRS32)
Accepted answer
7 votes

I got the same result -- it's a bug. It does work at low-baud rate so you can use that as a workaround. Type L when the Cass? prompt appears at startup. Looking at the output file the emulator is ...

View answer
How do Z80 Block Transfer instructions work?
6 votes

Yes, the Z-80 has block move instructions for memory, I/O and searching. These were additions made by Zilog and were more definitely not available on the Intel 8080. Nominally the Z-80 accesses ...

View answer
Intel 8080 Read/Set Interrupt Mask Instructions
6 votes

To answer your specific question, the 0x20 and 0x30 opcodes on the 8080 were undefined. In practice they were equivalent to NOP (0x00). A handy table of 8080 instructions can be found here: http://...

View answer
Make the "z80asm" assembler place an instruction at a known memory address
5 votes

The org directive should do specifically what you ask. However, z80asm is a little simplistic in its output format. Instead you can use ds to place routines at particular addresses: ds ...

View answer
What is known about the internal workings of the Z80?
5 votes

The best I've seen is Goran Devic's implementation for an FPGA. He's taken the existing bits of Z-80 reverse engineering and filled in the missing pieces and connected them all together. Read ...

View answer