12
\$\begingroup\$

Subleq is a programming language with only one instruction. Each instruction contains 3 parameters. Code and data space is the same. How it works:

A B C

A, B and C are signed ints. Instructions are executed in the next way:

*B = *B - *A
if(*B <= 0) goto C;

One post is one tip. Write your tips for Subleq here!

Online interpreter, assembler and C to Subleq converter

\$\endgroup\$
2
  • 1
    \$\begingroup\$ So, you could goto a number that isn't a multiple of 3 and therefore jump into an instruction, so to speak? \$\endgroup\$
    – Neil
    Feb 3, 2016 at 8:50
  • 1
    \$\begingroup\$ @Neil yes. you can \$\endgroup\$ Feb 3, 2016 at 8:54

1 Answer 1

4
\$\begingroup\$

Third Argument in Output Command is Extra Memory

Subleq specifies output with the three word command x -1 y, where x is the address of the value to be output. Unlike other Subleq commands, execution will proceed to the next command in all cases and y is ignored. This means it is available to be used for memory.

For example 0:2 -1 65 will print the "A" (CHAR(65)) stored in 2: and then proceed to 3:.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.