qwertyuiopasdfghjkl;vb

From Esolang
Jump to navigation Jump to search

qwertyuiopasdfghjkl;vb is an extension of asdf and 1234.(Including Brainfuck and I/D machine and BCT.)The pointer begins at memory location 3. It can be moved left or right infinitely. IO is memory mapped. To read from the console, toggle the bit at location 0 twice without moving or hitting a loop; this will read one bit from the console into location 2. To write to the console, toggle the bit at location 1 twice without moving or hitting a loop; this will write one bit from location 2 to the console. Since all console IO is bytewise, all reads and writes to the console are buffered (8 bits).

Instruction Description
a Toggles the bit at the current location and sets the toggle flag.
s If the toggle flag is clear, move the pointer right. If the toggle flag is set, move the pointer left. Either way, clear the toggle flag.
d If the bit at the current location is 1, jump forward to the matching f. Also, clear the toggle flag.
f If the bit at the current location is 0, jump backward to the matching d. Also, clear the toggle flag.
g Increment the bit pointed.
h Jump to byte numbered as the bit pointed.
q Move the pointer to the right
w Move the pointer to the left
e Increment the memory cell under the pointer
r Decrement the memory cell under the pointer
u Output the character signified by the cell at the pointer
i Input a character and store it in the cell at the pointer
o Jump past the matching ] if the cell under the pointer is 0
p Jump back to the matching [ if the cell under the pointer is nonzero
j Flip the current bit and move the pointer left. If the pointer ends at location -4, the pointer is moved to location 0.
k If the pointer is at location -3, read a character from the console and put it in locations 0 through 7; then move the pointer to location 0. If the pointer is at location -2, write a character to the console corresponding to locations 0 through 7; then move the pointer to location 0. At any other location, move the pointer right.
l Specifies a jump symbol. If the pointer is below 0, do nothing. If the current bit is TRUE, skip back to either the previous jump symbol or the start of the program. If the current bit is FALSE, skip forward to either the next jump symbol or the end of the program.
; Specified code-jump. Jump right the number of the pointed byte in the code.
t start BCT code
y end BCT code
v BCT 0
b BCT 1

Examples

Hello, world!

asaasaasssasaasssasaaaasssasaasssasaaaaaaaasssasaaaasssasaaaasssasaasssasaasssasaasssasaasssasaaaasssasaasssasaaaasssasaaaaaasssas
aaaasssasaasssasaaaasssasaaaaaasssasaaaasssasaasssasaaaaaaaasssasaaaasssasaasssasaasssasaaaasssasaaaaaaaasssasaasssasaaaaaaaaaaaas
ssasaaaaaasssasaasssasaaaaaasssasaasssasaaaasssasaasssasaaaaaaaasssasaasssasaaaaaasssasaaaasssasaasssasaaaasssasaaaasssasaasssasaa
aasssasaaaaaasssasaaaasssasaaaasssasaasssasaaaaaaaasssasaasssasaaaaaaaasssasaa

Move the pointer right, regardless of toggle bit (note: may perform I/O at low addresses)

aasss

Move the pointer left, regardless of toggle bit (note: may perform I/O at low addresses)

aas

Cat Program

jjjkjkjjk