Skip to content

Commit c1d344b

Browse files
committed
Update
1 parent 2fcaead commit c1d344b

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ For the Z80:
2626

2727
For the Homemade CPU:
2828

29-
- A branch delay slot executes the instruction already in the pipeline if a jump occurs. The emulator may not produce the correct results if the instruction in the delay slot is another jump (but this will probably be disallowed either by the hardware or the assembler anyway).
30-
- A store-to-memory delay slot is probably also needed, but is not implemented (`STOR (mm)` and `PUSH` instructions). This may be better described as a delayed fetch, because the fetch that would occur during the execution phase of a store-to-memory instruction would need to be delayed until the existing write to memory has completed.
29+
- The emulator always executes the instruction after a jump instruction (a branch delay slot), since that instruction is already in the pipeline in the actual CPU hardware. The emulator may not produce the correct results if the instruction in the delay slot is another jump (but this will probably be disallowed either by the hardware or the assembler anyway).
30+
- A store-to-memory (`STOR (mm)` and `PUSH` instructions) delay slot is probably also needed, but is not implemented. This may be better described as a delayed fetch, because the fetch that would occur during the execution phase of a store-to-memory instruction would need to be delayed until the existing write to memory has completed.
3131

3232
The [Future Functionality](#future-functionality) items listed below may be included in later releases.
3333

3434
## Usage
3535

36-
```shell
36+
```text
3737
emulator [-az | -ah] [-h] [input-file]
3838
```
3939

40-
Optional parameters `-az` or `ah` specify the architecture to emulate: `-az` for Z80, `-ah` for the Homemade CPU. If no architecture parameter is specified, then Z80 is emulated.
40+
Optional parameters `-az` or `-ah` specify the architecture to emulate: `-az` for Z80, `-ah` for the Homemade CPU. If no architecture parameter is specified, then Z80 is emulated.
4141

4242
`-h` displays a brief help summary, then exits the program.
4343

@@ -61,15 +61,17 @@ make verbose # Adds --verbose to the compiler and linker options
6161
make clean # Removes the executable, object, and linker files
6262
```
6363

64-
## Implementation Details
64+
## Supported OSes
6565

66-
The emulator was developed using Ubuntu 20.04 with gcc version 9.4.0 (by way of [WSL 2][26]) and MacOS Ventura with clang version 12.0.0.
66+
The emulator should compile and run on any modern unix or Linux OS.
6767

68-
It is compatible with MacOS Sequoia and clang version 17.0. It should also work with other versions of MacOS and clang, but has not been tested.
68+
It was originally developed and tested using Ubuntu 20.04 with gcc version 9.4.0 (by way of [WSL 2][26]) and MacOS Ventura with clang version 12.0.0.
6969

70-
It is compatible with Ubuntu 22.04/gcc 11.3 and Ubuntu 24.04/gcc 13.2 within the GitHub Actions environment.
70+
Further development and testing was done with MacOS Sequoia and clang version 17.0.
7171

72-
I have not tried it on other platforms, but there is no machine dependent code. It should work as-is (or with minimal changes) on other unix-like platforms and compiler versions.
72+
Within the GitHub Actions environment, it has been tested with Ubuntu 22.04/gcc 11.3 and Ubuntu 24.04/gcc 13.2.
73+
74+
## Implementation Details
7375

7476
### General Program Flow
7577

@@ -99,7 +101,7 @@ I have not tried it on other platforms, but there is no machine dependent code.
99101

100102
The CPU-specific code is encapsulated in classes named `Z80` and `HomemadeCPU` which inherit from the abstract base class `abstract_CPU`. Additional CPUs can be emulated by creating classes specific to those CPUs.
101103

102-
The CPU opcodes are defined in several tables implemented with arrays of structs for the main and extended opcodes (`Z80_opcodes.h`, `HomemadeCPU_opcodes.h`). Each array entry contains the size of the instruction, the opcode/data layout, and the instruction mnemonic. The opcode value is represented by the array index.
104+
The CPU opcodes are defined in several tables implemented with arrays of structs for the main and extended opcodes (`Z80_opcodes.h`, `HomemadeCPU_opcodes.h`). Each array entry contains the opcode/data layout, the instruction mnemonic, and, if necessary, the length of the instruction. The opcode value is represented by the array index.
103105

104106
The `Z80` class contains:
105107

@@ -124,7 +126,7 @@ The `Z80` class contains:
124126
- Generate a string containing the disassembled instruction and data
125127
- Execute the actual instruction (load, store, jump, etc.)
126128

127-
The `HomemadeCPU` class structure is similar to the `Z80` class, but simplified in many areas due to the RISC vs. CISC differences in the processor architectures. One notable difference is that the Homemade CPU has fixed-length 2-byte instructions.
129+
The `HomemadeCPU` class structure is similar to the `Z80` class, but simplified in many areas due to the RISC vs. CISC differences in the processor architectures. One notable difference is that the Homemade CPU has fixed-length 2-byte instructions, and therefore does not need to specify the instruction length in the opcodes array.
128130

129131
## Z80 Assemblers
130132

0 commit comments

Comments
 (0)