aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-01 14:10:14 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-01 14:10:14 +0100
commit1c56880aecf83fac3f1a9f16d296c39573a65918 (patch)
tree0faf7aab0acd8ed66db8b5d1fd2a86188cd252c9
parent18929d37d4ff7592a87bcd9ed3c90898fca8cdca (diff)
downloadtr8vm-1c56880aecf83fac3f1a9f16d296c39573a65918.tar.gz
tr8vm-1c56880aecf83fac3f1a9f16d296c39573a65918.zip
Typos, formatting
-rw-r--r--README.md47
1 files changed, 30 insertions, 17 deletions
diff --git a/README.md b/README.md
index b39634b..f01719f 100644
--- a/README.md
+++ b/README.md
@@ -15,10 +15,10 @@ Sound: TBD
Other features:
-* programable in ASM
+* programmable in ASM
* TR-8 CPU
- 16-bit registers: stack pointer (SP) and program counter (PC)
- - 8-bit registers: 4 general purpose registers (a, b, x, y), flags refister (F)
+ - 8-bit registers: 4 general purpose registers (a, b, x, y), flags register (F)
* frame interrupt (60Hz) and external IO interrupt
* port based IO
@@ -46,7 +46,7 @@ On Linux install a C compiler and the development packages for the requirements.
Example on Debian/Ubuntu using `sudo`:
- sudo apt install build-essential libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
+ sudo apt install build-essential libsdl2-dev libsdl2-mixer-dev
Then run `make`.
@@ -71,7 +71,8 @@ You can then compile and run the example with `make example`.
The controller support d-pad with 4 directions, 2 action buttons, select and start.
-Read the port `0xf0` for the 8 1-bit flags reporting the state of the controller 1, and `0xf1` for controller 2.
+Read the port `0xf0` for the 8 1-bit flags reporting the state of the
+controller 1, and `0xf1` for controller 2.
```
76543210
@@ -87,7 +88,8 @@ Read the port `0xf0` for the 8 1-bit flags reporting the state of the controller
### Palette
-Ports from `0xe0` to `0xef` can be used to select the colors to use in the 16 color palette from the 32 available.
+Ports from `0xe0` to `0xef` can be used to select the colors to use in the 16
+color palette from the 32 available.
TODO: palette colours
@@ -132,7 +134,7 @@ fill_loop:
inc x
bno
jmp fill_loop
- ; x overfows, so we increment a
+ ; x overflows, so we increment a
; and decrement y (one 256 block done)
inc a
dec y
@@ -158,7 +160,8 @@ instructions:
Set the address to that value. By default the starting address is `0x0000`.
.db imm [, imm]
-Literal byte. Label can be used with `<` prefix for the low byte of the address and `>`for the high byte.
+Literal byte. Label can be used with `<` prefix for the low byte of the address
+and `>`for the high byte.
.dw imm [, imm]
Literal word.
@@ -253,11 +256,13 @@ Subtract the immediate value to r1, storing the result in r1.
Affected flags: ZF, CF, OF, SF
CMP r1, r2
-Perform a SUB of r1 minus r2, without storing the result and only updating the flags.
+Perform a SUB of r1 minus r2, without storing the result and only updating the
+flags.
Affected flags: ZF, CF, OF, SF
CMP r1, imm
-Perform a SUB of r1 minus the immediate value without storing the result and only updating the flags.
+Perform a SUB of r1 minus the immediate value without storing the result and
+only updating the flags.
Affected flags: ZF, CF, OF, SF
#### Bit Operations
@@ -279,7 +284,7 @@ Rotate r1 n bits to the right (0 to 7), storing the result in r1.
Affected flags: ZF, CF, SF
BIT r1, n
-Test bit n (0 to 7) or r1, setting ZF if it is set or clearing it otherwise.
+Test bit n (0 to 7) or r1, setting ZF if it is set or clearing it otherwise.
Affected flags: ZF
#### Jump and Call
@@ -288,10 +293,12 @@ JMP addr
Set the PC to the 16-bit address.
CALL addr
-Store the next PC in the stack (16-bit address) and sets te PC to the 16-bit address.
+Store the next PC in the stack (16-bit address) and sets the PC to the 16-bit
+address.
CALL [r1:r2]
-Store the next PC in the stack (16-bit address) and sets te PC to the 16-bit address provided by r1:r2.
+Store the next PC in the stack (16-bit address) and sets te PC to the 16-bit
+address provided by r1:r2.
RET
Return from a call by setting PC to the top 16-bit value popped from the stack.
@@ -341,10 +348,12 @@ Affected flags: BF
#### IO, flags and Misc
HALT
-Stop the execution until there is frame interrupt. If the interruption flag is set, this will hang the CPU.
+Stop the execution until there is frame interrupt. If the interruption flag is
+set, this will hang the CPU.
PORT r1, r2
-Write the value of r2 in the port number provided by r1. If there is an output, the value will be stored in r1.
+Write the value of r2 in the port number provided by r1. If there is an output,
+the value will be stored in r1.
NOP
No instruction has no effect.
@@ -354,7 +363,8 @@ Set IF, disabling the interrupt.
Affected flags: IF
CIF
-Clear IF, enabling the interrupt. If called in an interrupt handler, it won't have effect. Use IRET instead to return from the interrupt to unset IF.
+Clear IF, enabling the interrupt. If called in an interrupt handler, it won't
+have effect. Use IRET instead to return from the interrupt to unset IF.
Affected flags: IF
CCF
@@ -370,14 +380,17 @@ Clear overflow flag.
Affected flags: OF
IRET
-Return from an interupt handler by setting PC to the top 16-bit value popped from the stack. It enables interrupts by clearing the interrupt flag.
+Return from an interrupt handler by setting PC to the top 16-bit value popped
+from the stack. It enables interrupts by clearing the interrupt flag.
Affected flags: IF
### TR8 file format
It is a binary file to be run on the TR-8.
-It doesn't have a header and it will be loaded at `0x0000` address. The execution will start on that address with interruptions disabled (interruption flag set).
+It doesn't have a header and it will be loaded at `0x0000` address. The
+execution will start on that address with interruptions disabled (interruption
+flag set).
See the memory map for further information.