SUBLEQ just isn't complicated enough. We can make it better, stronger, slower, more obfuscated!
We start with standard SUBLEQ. We then assign memory location zero as "Mode". Mode gets checked before each instruction is read. Mode can radically change the behavior of SUBLEQ. There will be a varying number of words per instruction. Data is treated as signed Integers ("Ai"), unless specified as Float ("Bf"). A is a literal. *A is a pointer. **A is an indirect pointer. We'll keep the SUBLEQ+ convention that a negative address is also an indirect pointer (allowing an effective triple pointer).
Mode Words Effect
-1 1 Halt
-2 1 *A <= stdin char, Mode=0
-3 1 A <= stdin char, Mode=0
-4 1 stdout <= char ABS(*A), Mode=0
-5 1 stdout <= char ABS(A), Mode=0
0x00 3 *B=*B-*A, if *B≤0 Jump C (standard SUBLEQ)
0x01 2 *B=*B-*A
0x02 3 *B=*B-A, if *B≤0 Jump C
0x03 2 *B=*B-A
0x10 4 *C=*B-*A, if *C≤0 Jump D
0x11 3 *C=*B-*A
0x12 4 *C=*B-A, if *C≤0 Jump D
0x13 3 *C=*B-A
0x20 4 **C=**B-**A, if **C≤0 Jump D
0x21 3 **C=**B-**A
0x22 4 **C=**B-*A if **C≤0 Jump D
0x23 3 **C=**B-*A
0x24 4 **C=**B-A if **C≤0 Jump D
0x25 3 **C=**B-A
0x26 4 **C=*B-*A if **C≤0 Jump D
0x27 3 **C=*B-*A
0x28 4 **C=*B-A if **C≤0 Jump D
0x29 3 **C=*B-A
0X30 3 *Bf=*Bf-*Af, if *Bf≤0 Jump C
0x31 2 *Bf=*Bf-*Af
0x32 3 *Bf=*Bf-Af, if *Bf≤0 Jump C
0x33 2 *Bf=*Bf-Af
0x34 3 *Bf=*Bf-*Ai, if *Bf≤0 Jump C
0x35 2 *Bf=*Bf-*Ai
0x36 3 *Bi=*Bi-*Af (floor), if *Bi≤0 Jump C
0x37 2 *Bi=*Bi-*Af (floor)
0X38 2 *Bf=*Ai
0x39 2 *Bf=Ai
0x3a 2 *Bi=*Af (floor)
0x3b 2 *Bi=Af (floor)
0x3c 2 *Bi=*Af (round down)
0x3d 2 *Bi=Af (round down)
0x40 2 if *Af≤0 Jump B
0x41 2 *Bf=*Bf + *Af
0x42 2 *Bf=*Bf * *Af
0x43 2 *Bf=*Bf / *Af
0x44 2 *Bf=*Bf + Af
0x45 2 *Bf=*Bf * Af
0x46 2 *Bf=*Bf / Af
0x47 2 *Bf=*Bf raised to power of *Af
0x48 2 *Bf=*Bf raised to power of Af
0x49 2 *Bf=log base *Bf of *Af
0x4a 2 *Bf=log base *Bf of Af
0X4b 2 *Bf=*Af root of *Bf
0x4c 2 *Bf=Af root of *Bf
0x4d 2 *Bi=*Bf MOD *Ai
0x4e 2 *Bi=*Bf MOD Ai
0x50 2 if *Af>0 Jump B
0x51 3 *Cf=*Bf + *Af
0x52 3 *Cf=*Bf * *Af
0x53 3 *Cf=*Bf / *Af
0x54 3 *Cf=*Bf + Af
0x55 3 *Cf=*Bf * Af
0x56 3 *Cf=*Bf / Af
0x57 3 *Cf=*Bf raised to power of *Af
0x58 3 *Cf=*Bf raised to power of Af
0x59 3 *Cf=log base *Bf of *Af
0x5a 3 *Cf=log base *Bf of Af
0X5b 3 *Cf=*Af root of *Bf
0x5c 3 *Cf=Af root of *Bf
0x5d 3 *Ci=*Bf MOD *Ai
0x5e 3 *Ci=*Bf MOD Ai
0x60 1 *A=NOT *A
0x61 2 *B=*B AND *A
0x62 2 *B=*B OR *A
0x63 2 *B=*B XOR *A
0x64 2 *B=*B << *A bits
0x65 2 *B=*B >> *A bits
0x66 2 *B=*B AND A
0x67 2 *B=*B OR A
0x68 2 *B=*B XOR A
0x69 2 *B=*B << A bits
0x6a 2 *B=*B >> A bits
0x70 2 *B=NOT *A
0x71 2 *C=*B AND *A
0x72 2 *C=*B OR *A
0x73 2 *C=*B XOR *A
0x74 2 *C=*B << *A bits
0x75 2 *C=*B >> *A bits
0x76 2 *C=*B AND A
0x77 2 *C=*B OR A
0x78 2 *C=*B XOR A
0x79 2 *C=*B << A bits
0x7a 2 *C=*B >> A bits
0x80 2 if *A≤0 Jump B
0x81 2 *B=*B + *A
0x82 2 *B=*B * *A
0x83 2 *B=*B / *A
0x84 2 *B=*B MOD *A
0x85 2 *B=*B raised to *A power
0x86 2 *B=*B + A
0x87 2 *B=*B * A
0x88 2 *B=*B / A
0x89 2 *B=*B MOD A
0x8a 2 *B=*B raised to A power
0X8B 3 *B=*B / *A, *C=*B MOD *A
0x8c 3 *B=*B / A, *C=*B MOD A
0x80 2 if *A>0 Jump B
0x91 3 *C=*B + *A
0x92 3 *C=*B * *A
0x93 3 *C=*B / *A
0x94 3 *C=*B MOD *A
0x95 3 *C=*B raised to *A power
0x96 3 *C=*B + A
0x97 3 *C=*B * A
0x98 3 *C=*B / A
0x99 3 *C=*B MOD A
0x9a 3 *C=*B raised to A power
0X9B 4 *C=*B / *A, *D=*B MOD *A
0x9c 4 *C=*B / A, *D=*B MOD A
No comments:
Post a Comment
I reserve the right to remove egregiously profane or abusive comments, spam, and anything else that really annoys me. Feel free to agree or disagree, but let's keep this reasonably civil.