Gaming

Common and Hidden Instructions in SHENZHEN I/O (Spoilers)

f77e2af2fdcc0c86e63370c840d8bfe7d760d5ee.jpg

Basic instructions

  • nop Does nothing.

  • mov R/I R Copies the first operand into the second operand.

  • jmp L Jumps to the specified label and executes the next instruction.

  • slp R/I Sleeps for the number of time units specified by the operand.

  • slx P Sleeps until data can be read from the XBus pin specified by the operand.

Arithmetic Instructions

Registers can store integers from -999 to 999, inclusive. If an arithmetic operation produces a result outside this range, the system stores the nearest allowed value. For example, if acc is 800 and you execute add 400, the system stores 999 in acc.

  • add R/I adds the first operand to the value in the acc register and stores the result in acc.

  • sub R/I subtracts the first operand from the value in the acc register and stores the result in acc.

  • mul R/I multiplies the first operand by the value in the acc register and stores the result in acc.

  • not stores 100 in acc if acc is 0; otherwise, it stores 0 in acc.

  • dgt R/I extracts the digit specified by the operand from the acc register and stores the result in acc.

  • dst R/I R/I selects the digit in acc specified by the first operand and sets it to the value of the second operand.

Test Instructions

  • teq R/I R/I tests whether the first operand (A) equals the second operand (B).

  • tgt R/I R/I tests whether the first operand (A) is greater than the second operand (B).

  • tlt R/I R/I tests whether the first operand (A) is less than the second operand (B).

  • tcp R/I R/I compares the first operand (A) and the second operand (B).

Hidden Instructions

  • gen P R/I R/I generates a pulse. The first R/I specifies how long it stays on at 100, and the second R/I specifies how long it stays off at 0.

  • @ marks initialization code that runs only once.

Published 06/27/2019 · Krunk Zhou

Join the conversation