2 Bits, 1 Byte but 01 and 10 are swapped

From Esolang
Jump to navigation Jump to search

2 Bits, 1 Byte but 01 and 10 are swapped is 2 Bits, 1 Byte but 01 and 10 are swapped.

Operations

Code Name Description
00 DON DO Nothing. Or in other words, NOP.
01 JMP JuMP. Jump (unconditionally) to address specified.
10 ACT ACTion. Given value in memory, change the value according to the following table:
From To
00 11
01 10
10 00
11 01
11 END END. Print the entire memory as character and end the program.

Programs

Since the memory is one byte, you can represent the entire program with just one character.

For example:

I

becomes:

01001001

which, when disassembled, becomes:

JMP 00b
ACT 01b

Example codes

Endless loop

/

Disassembled:

JMP 00b
END ; lol
END

Output '/'

,

Disassembled:

DON
ACT 11b
DON ; becomes END

Quine

Any digit outputs itself. For example:

7

Each ASCII digit starts with 0011 in binary, so the first two instructions are DON END.

Also, any character with ASCII value not less than 0xC0 is a quine, because the first instruction is END.

All examples

\x00 → Does not terminate
\x01 → Does not terminate
\x02 → Does not terminate
\x03 → \x03
\x04 → Does not terminate
\x05 → Does not terminate
\x06 → Does not terminate
\x07 → \x07
\x08 → Does not terminate
\x09 → Does not terminate
\x0a → Does not terminate
\x0b → \x03
\x0c → \x0c
\x0d → \x0d
\x0e → \x0e
\x0f → \x0f
\x10 → Does not terminate
\x11 → Does not terminate
\x12 → Does not terminate
\x13 → Does not terminate
\x14 → Does not terminate
\x15 → Does not terminate
\x16 → Does not terminate
\x17 → Does not terminate
\x18 → Does not terminate
\x19 → Does not terminate
\x1a → Does not terminate
\x1b → Does not terminate
\x1c → Does not terminate
\x1d → Does not terminate
\x1e → Does not terminate
\x1f → \x1f
\x20 → Does not terminate
!    → Does not terminate
"    → Does not terminate
#    → \x03
$    → Does not terminate
%    → Does not terminate
&    → Does not terminate
'    → \x07
(    → Does not terminate
)    → Does not terminate
*    → Does not terminate
+    → \x0b
,    → \x0c
-    → \x0d
.    → \x0c
/    → \x0f
0    → 0
1    → 1
2    → 2
3    → 3
4    → 4
5    → 5
6    → 6
7    → 7
8    → 8
9    → 9
:    → :
;    → ;
<    → <
=    → =
>    → >
?    → ?
@    → Does not terminate
A    → Does not terminate
B    → Does not terminate
C    → Does not terminate
D    → Does not terminate
E    → Does not terminate
F    → Does not terminate
G    → Does not terminate
H    → Does not terminate
I    → Does not terminate
J    → Does not terminate
K    → Does not terminate
L    → Does not terminate
M    → Does not terminate
N    → Does not terminate
O    → Does not terminate
P    → Does not terminate
Q    → Does not terminate
R    → Does not terminate
S    → Does not terminate
T    → Does not terminate
U    → Does not terminate
V    → Does not terminate
W    → Does not terminate
X    → Does not terminate
Y    → Does not terminate
Z    → Does not terminate
[    → Does not terminate
\\   → Does not terminate
]    → Does not terminate
^    → Does not terminate
_    → _
`    → Does not terminate
a    → Does not terminate
b    → Does not terminate
c    → c
d    → Does not terminate
e    → Does not terminate
f    → Does not terminate
g    → g
h    → Does not terminate
i    → Does not terminate
j    → Does not terminate
k    → c
l    → l
m    → m
n    → n
o    → o
p    → Does not terminate
q    → q
r    → p
s    → s
t    → Does not terminate
u    → u
v    → t
w    → w
x    → Does not terminate
y    → y
z    → x
{    → {
|    → Does not terminate
}    → }
~    → |
\x7f → \x7f
\x80 → Does not terminate
\x81 → Does not terminate
\x82 → Does not terminate
\x83 → \x03
\x84 → Does not terminate
\x85 → Does not terminate
\x86 → Does not terminate
\x87 → \x07
\x88 → Does not terminate
\x89 → Does not terminate
\x8a → Does not terminate
\x8b → \x03
\x8c → \x0c
\x8d → \x0d
\x8e → \x0e
\x8f → \x0f
\x90 → Does not terminate
\x91 → Does not terminate
\x92 → Does not terminate
\x93 → \x13
\x94 → Does not terminate
\x95 → Does not terminate
\x96 → Does not terminate
\x97 → \x17
\x98 → Does not terminate
\x99 → Does not terminate
\x9a → Does not terminate
\x9b → Does not terminate
\x9c → \x1c
\x9d → \x1d
\x9e → \x1e
\x9f → \x1f
\xa0 → Does not terminate
\xa1 → Does not terminate
\xa2 → Does not terminate
\xa3 → #
\xa4 → Does not terminate
\xa5 → Does not terminate
\xa6 → Does not terminate
\xa7 → '
\xa8 → Does not terminate
\xa9 → Does not terminate
\xaa → Does not terminate
\xab → \x03
\xac → ,
\xad → -
\xae → .
\xaf → /
\xb0 → 0
\xb1 → 1
\xb2 → 0
\xb3 → 3
\xb4 → 4
\xb5 → 5
\xb6 → Does not terminate
\xb7 → 7
\xb8 → 0
\xb9 → 1
\xba → 2
\xbb → 3
\xbc → <
\xbd → =
\xbe → >
\xbf → ?
\xc0 → \xc0
\xc1 → \xc1
\xc2 → \xc2
\xc3 → \xc3
\xc4 → \xc4
\xc5 → \xc5
\xc6 → \xc6
\xc7 → \xc7
\xc8 → \xc8
\xc9 → \xc9
\xca → \xca
\xcb → \xcb
\xcc → \xcc
\xcd → \xcd
\xce → \xce
\xcf → \xcf
\xd0 → \xd0
\xd1 → \xd1
\xd2 → \xd2
\xd3 → \xd3
\xd4 → \xd4
\xd5 → \xd5
\xd6 → \xd6
\xd7 → \xd7
\xd8 → \xd8
\xd9 → \xd9
\xda → \xda
\xdb → \xdb
\xdc → \xdc
\xdd → \xdd
\xde → \xde
\xdf → \xdf
\xe0 → \xe0
\xe1 → \xe1
\xe2 → \xe2
\xe3 → \xe3
\xe4 → \xe4
\xe5 → \xe5
\xe6 → \xe6
\xe7 → \xe7
\xe8 → \xe8
\xe9 → \xe9
\xea → \xea
\xeb → \xeb
\xec → \xec
\xed → \xed
\xee → \xee
\xef → \xef
\xf0 → \xf0
\xf1 → \xf1
\xf2 → \xf2
\xf3 → \xf3
\xf4 → \xf4
\xf5 → \xf5
\xf6 → \xf6
\xf7 → \xf7
\xf8 → \xf8
\xf9 → \xf9
\xfa → \xfa
\xfb → \xfb
\xfc → \xfc
\xfd → \xfd
\xfe → \xfe
\xff → \xff