SHENZHEN I/O

SHENZHEN I/O

View Stats:
Nosferatu 5 Aug, 2023 @ 6:57am
Assist/Hint Needed
I'm on the second level (first conditional) feeling very stupid.

mov p0 p1 # move input to output
loop: # start loop
+teq p1 100 # conditional - when p1 is equal to 100 do :
mov 0 p1 # the next four lines just make the power go up and down each second.
slp 1
mov 100 p1
slp 1
end:

Unfortunately, I can't seem to get the conditional to proc. When I add a plus to the code, it just gets greyed out at runtime. Any hint on this? I don't want the answer.
< >
Showing 1-2 of 2 comments
vapier 6 Aug, 2023 @ 9:30pm 
from the datasheet:
Conditional Execution
All instructions in the MCxxxx programming language are capable of conditional execution. Prefixing an instruction with a “+” or “-” symbol will cause that instruction to be enabled or disabled by test instructions. When an instruction is disabled by a test instruction, it will be skipped and will not consume power. Instructions with no prefix are never disabled and always execute normally. All conditional instructions start in a disabled state. A test instruction must be executed to enable conditional instructions.

all `+` and `-` statements start off disabled which means you have to execute a test insn first. the only test insn you have is prefixed with a `+` which starts off disabled, so it's impossible to have it be enabled. so don't put the `+` in front of the `teq`, put the `+` in front of the statements you want to be affected by the `teq`.
Last edited by vapier; 6 Aug, 2023 @ 9:31pm
Nosferatu 9 Aug, 2023 @ 2:23pm 
Originally posted by vapier:
from the datasheet:
Conditional Execution
All instructions in the MCxxxx programming language are capable of conditional execution. Prefixing an instruction with a “+” or “-” symbol will cause that instruction to be enabled or disabled by test instructions. When an instruction is disabled by a test instruction, it will be skipped and will not consume power. Instructions with no prefix are never disabled and always execute normally. All conditional instructions start in a disabled state. A test instruction must be executed to enable conditional instructions.

all `+` and `-` statements start off disabled which means you have to execute a test insn first. the only test insn you have is prefixed with a `+` which starts off disabled, so it's impossible to have it be enabled. so don't put the `+` in front of the `teq`, put the `+` in front of the statements you want to be affected by the `teq`.


Thank you for the direction!
< >
Showing 1-2 of 2 comments
Per page: 1530 50