From a0344672680393597bc18b0101f07607abbb358f Mon Sep 17 00:00:00 2001 From: mole99 Date: Sat, 13 Apr 2024 17:53:12 +0200 Subject: [PATCH] Update docs --- README.md | 12 ++++++------ docs/info.md | 14 +++++++------- sw/assembler.py | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index ecbb574..546112a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Here is an animation using the time register: ## Architecture -Tiny Shader has four (mostly) general purpose registers, REG0 to REG4. REG0 is special in a way as it is the target or destination register for some instructions. All registers are 6 bit wide. +Tiny Shader has four (mostly) general purpose registers, REG0 to REG3. REG0 is special in a way as it is the target or destination register for some instructions. All registers are 6 bit wide. ### Input @@ -66,10 +66,10 @@ The following instructions are supported by Tiny Shader. A program consists of 1 ### Branches |Instruction|Operation|Description| |-----------|---------|-----------| -|IFEQ RA|TAKE <= RA == REG0|Execute the next instruction if RA equals REG0.| -|IFNE RA|TAKE <= RA != REG0|Execute the next instruction if RA does not equal REG0.| -|IFGE RA|TAKE <= RA >= REG0|Execute the next instruction if RA is greater then or equal REG0.| -|IFLT RA|TAKE <= RA < REG0|Execute the next instruction if RA is less than REG0.| +|IFEQ RA|TAKE <= RA == R0|Execute the next instruction if RA equals R0.| +|IFNE RA|TAKE <= RA != R0|Execute the next instruction if RA does not equal R0.| +|IFGE RA|TAKE <= RA >= R0|Execute the next instruction if RA is greater then or equal R0.| +|IFLT RA|TAKE <= RA < R0|Execute the next instruction if RA is less than R0.| ### Arithmetic |Instruction|Operation|Description| |-----------|---------|-----------| @@ -84,7 +84,7 @@ The following instructions are supported by Tiny Shader. A program consists of 1 ### Special |Instruction|Operation|Description| |-----------|---------|-----------| -|SINE RA|RA <= SINE[REG0[4:0]]|Get the sine value for REG0 and write into RA. The sine value LUT has 32 entries.| +|SINE RA|RA <= SINE[R0[4:0]]|Get the sine value for R0 and write into RA. The sine value LUT has 32 entries.| ### Boolean |Instruction|Operation|Description| |-----------|---------|-----------| diff --git a/docs/info.md b/docs/info.md index f4c1f28..eef56eb 100644 --- a/docs/info.md +++ b/docs/info.md @@ -52,7 +52,7 @@ SETRGB R3 ### Architecture -Tiny Shader has four (mostly) general purpose registers, REG0 to REG4. REG0 is special in a way as it is the target or destination register for some instructions. All registers are 6 bit wide. +Tiny Shader has four (mostly) general purpose registers, REG0 to REG3. REG0 is special in a way as it is the target or destination register for some instructions. All registers are 6 bit wide. #### Input @@ -60,7 +60,7 @@ The shader has four sources to get input from: - `X` - X position of the current pixel - `Y` - Y position of the current pixel -- `TIME` - Increases at 7.5 Hz, before it overflow it counts down again. +- `TIME` - Increments at 7.5 Hz, before it overflow it counts down again. - `USER` - Register that can be set via the SPI interface. #### Output @@ -94,10 +94,10 @@ The following instructions are supported by Tiny Shader. A program consists of 1 #### Branches |Instruction|Operation|Description| |-----------|---------|-----------| -|IFEQ RA|TAKE <= RA == REG0|Execute the next instruction if RA equals REG0.| -|IFNE RA|TAKE <= RA != REG0|Execute the next instruction if RA does not equal REG0.| -|IFGE RA|TAKE <= RA >= REG0|Execute the next instruction if RA is greater then or equal REG0.| -|IFLT RA|TAKE <= RA < REG0|Execute the next instruction if RA is less than REG0.| +|IFEQ RA|TAKE <= RA == R0|Execute the next instruction if RA equals R0.| +|IFNE RA|TAKE <= RA != R0|Execute the next instruction if RA does not equal R0.| +|IFGE RA|TAKE <= RA >= R0|Execute the next instruction if RA is greater then or equal R0.| +|IFLT RA|TAKE <= RA < R0|Execute the next instruction if RA is less than R0.| #### Arithmetic |Instruction|Operation|Description| |-----------|---------|-----------| @@ -112,7 +112,7 @@ The following instructions are supported by Tiny Shader. A program consists of 1 #### Special |Instruction|Operation|Description| |-----------|---------|-----------| -|SINE RA|RA <= SINE[REG0[4:0]]|Get the sine value for REG0 and write into RA. The sine value LUT has 32 entries.| +|SINE RA|RA <= SINE[R0[4:0]]|Get the sine value for R0 and write into RA. The sine value LUT has 32 entries.| #### Boolean |Instruction|Operation|Description| |-----------|---------|-----------| diff --git a/sw/assembler.py b/sw/assembler.py index 1cd12df..dc0d947 100644 --- a/sw/assembler.py +++ b/sw/assembler.py @@ -15,15 +15,15 @@ 'GETTIME' : {'format': 'single_operand', 'opcode': '00_0110', 'short': 'RA <= TIME', 'description': 'Set the specified register to the current time value, increases with each frame.', 'category': 'Input'}, 'GETUSER' : {'format': 'single_operand', 'opcode': '00_0111', 'short': 'RA <= USER', 'description': 'Set the specified register to the user value, can be set via the SPI interface.', 'category': 'Input'}, - 'IFEQ' : {'format': 'single_operand', 'opcode': '00_1000', 'short': 'TAKE <= RA == REG0', 'description': 'Execute the next instruction if RA equals REG0.', 'category': 'Branches'}, - 'IFNE' : {'format': 'single_operand', 'opcode': '00_1001', 'short': 'TAKE <= RA != REG0', 'description': 'Execute the next instruction if RA does not equal REG0.', 'category': 'Branches'}, - 'IFGE' : {'format': 'single_operand', 'opcode': '00_1010', 'short': 'TAKE <= RA >= REG0', 'description': 'Execute the next instruction if RA is greater then or equal REG0.', 'category': 'Branches'}, - 'IFLT' : {'format': 'single_operand', 'opcode': '00_1011', 'short': 'TAKE <= RA < REG0', 'description': 'Execute the next instruction if RA is less than REG0.', 'category': 'Branches'}, + 'IFEQ' : {'format': 'single_operand', 'opcode': '00_1000', 'short': 'TAKE <= RA == R0', 'description': 'Execute the next instruction if RA equals R0.', 'category': 'Branches'}, + 'IFNE' : {'format': 'single_operand', 'opcode': '00_1001', 'short': 'TAKE <= RA != R0', 'description': 'Execute the next instruction if RA does not equal R0.', 'category': 'Branches'}, + 'IFGE' : {'format': 'single_operand', 'opcode': '00_1010', 'short': 'TAKE <= RA >= R0', 'description': 'Execute the next instruction if RA is greater then or equal R0.', 'category': 'Branches'}, + 'IFLT' : {'format': 'single_operand', 'opcode': '00_1011', 'short': 'TAKE <= RA < R0', 'description': 'Execute the next instruction if RA is less than R0.', 'category': 'Branches'}, 'DOUBLE' : {'format': 'single_operand', 'opcode': '00_1100', 'short': 'RA <= RA * 2', 'description': 'Double the value of RA.', 'category': 'Arithmetic'}, 'HALF' : {'format': 'single_operand', 'opcode': '00_1101', 'short': 'RA <= RA / 2', 'description': 'Half the value of RA.', 'category': 'Arithmetic'}, 'CLEAR' : {'format': 'single_operand', 'opcode': '00_1110', 'short': 'RA <= 0', 'description': 'Clear RA by writing 0.', 'category': 'Load'}, - 'SINE' : {'format': 'single_operand', 'opcode': '00_1111', 'short': 'RA <= SINE[REG0[4:0]]', 'description': 'Get the sine value for REG0 and write into RA. The sine value LUT has 32 entries.', 'category': 'Special'}, + 'SINE' : {'format': 'single_operand', 'opcode': '00_1111', 'short': 'RA <= SINE[R0[4:0]]', 'description': 'Get the sine value for R0 and write into RA. The sine value LUT has 32 entries.', 'category': 'Special'}, # Boolean operations 'AND' : {'format': 'dual_operand', 'opcode': '01_00', 'short': 'RA <= RA & RB', 'description': 'Boolean AND of RA and RB, result written into RA.', 'category': 'Boolean'},