Basic Input/Output Commands

From Esolang
Jump to navigation Jump to search

Basic Input/Output Commands is an esoteric assembly code-like programming language that simply uses device input/output.

Instruction Details Examples

@s num

Changes the set of switches in the RAM represented by s to the binary representation of n. The maximum number of n depends on the bitsize. For example, if the bitsize is 8, the maximum number of n is 255, and if the bitsize is 16, the maximum number of n is 65536.

  • @0 65
  • @1 b01000001 // using binary representation
  • @2 x41 // using hexadecimal representation
  • read id:sect @s
  • read id:@sref #@s
  • read id:sect:subsect @s
  • read id:@sref:@ssref #@s
Reads a value from a section by number in the device with the specified ID and stores it at memory position s. @s uses a value from memory (see "@s ...")
  • read 14:1 @3
  • read @4:35:@5 #@6
(see the standard device reference for more examples)
  • write id:sect n1 n2 n3 …
  • write id:@sref @s1 @s2 @s3 …
  • write id:sect:subsect n1 n2 n3 …
  • write id:@sref:@ssref @s1 @s2 @s3 …

Writes a value or set of values to a section by number in the device with the specified ID.

  • write 16:9 98 12 52 43 54
  • write @7:12 13 @8 23 94 @9
(see the standard device reference for more examples)
  • clear id
  • clear id:sect
  • clear id:sect:subsect

Replaces all subsections in the specified section of the specified device identifier with 0. If the top-level section is cleared, a reset signal is sent to the device

  • clear 11
  • clear 12:43
  • qio qid n1 n2 n3 … @s
  • qio @qds @s1 @s2 @s3 … #@s
Sends n1, n2, n3, etc. to the quick input/output device with the specified identifier, waits for the device to process the input, then sets the set of switches represented by s to the output (mainly for quick conditional processing or mathematics)
  • qio 13 82 84 21 @10
  • qio 12 @11 89 43 25 @12 @13 @14 #@15
(see the standard device reference for more examples)
if @s instruction Executes instruction if the set of switches represented by s is not 0
qrl Short for "Quick Reload" - jumps to the beginning of the program
frl Short for "Full Reload" - clears the memory cells that the program used and jumps to the beginning of the program