New page wikitext, after the edit (new_wikitext) | 'Welcome to Assembly But Worse! A worse version of assembly language made by the genius himself, [[User:WoodyFan3412|WoodyFan3412]].
<br>
The language is heavily inspired by [https://en.wikipedia.org/wiki/Assembly_language Assembly Language].
[[File:CWarp4Screenshot.png|thumb|right|A program written in Assembly But Worse.]]
[[File:CWarp4Screenshot2.png|thumb|right|Pre Processer Directives.]]
== Memory ==
when the program is started, a list with 3,000 values (3 kb) is initalized to 0, the program can read and write from this list of values
<br>
the program can also use a stack
== Program Info ==
<br>
{| class="wikitable"
|+ Registers
|-
! Name !! Purpose !! Default
|-
| X || Index X || 0
|-
| Y || Index Y || 0
|-
| A || The accumulator, any math operations will use this value. || 0
|-
| PC || Program Counter || 1
|-
| Z || Is set to 1 if the accumulator is 0, is set to 0 otherwise. || 1
|}
{| class="wikitable"
|+ Instructions
|-
! Name !! Opcode !! Operands !! Description
|-
| goto || 0 || <label> || Sets the program counter to this location in the code
|-
| call || 1 || <subroutine> || Pushes a return address onto the stack and sets the program counter to this location in the code
|-
| ret || 2 || || Returns to the value on the top of the stack, this also allows for subroutines to be nested inside of eachother
|-
| return || 2 || || Returns to the value on the top of the stack, This is an alias of 'ret'
|-
| quit || 3 || || Quits the program
|-
| echo || 4 || <text> || Puts this text in the console. If the argument is a register, it puts the value of the register in the console.
|-
| push || 5 || <register> || pushes the value of this register on the stack
|-
| pop || 6 || <register> || gets the value on the top of the stack and sets the register to that value
|-
| read || 7 || <address> <register> || Reads a value from memory and stores it in the register
|-
| write || 8 || <address> <register> || Writes the value of the register to this location in memory
|-
| move || 9 || <loc1> <loc2> || move a 15 will move the value 15 into register A, move 15 10 will move the value 10 into memory 15, move a x will move the value of a into X.
|-
| inc || 10 || <register> || changes this register's value by 1, the register can only be in the range 0 - 255 and can overflow
|-
| dec || 11 || <register> || changes this register's value by -1, the register can only be in the range 0 - 255 and can overflow
|}
== Pre-Processing ==
ABW supports pre-processing, which are instructions that dictate how the source should be compiled to byte-code
<br>
Just like in C++, you can use #define to make the compiler replace a string with a value
<pre>
#define HELLO "Hello, World!"
goto main
main:
echo HELLO
quit
; Output: "Hello, World!"
</pre>
== Examples ==
=== function ===
<pre>
goto main
main:
call Message1 ; print hello world
call Message2 ; print my name is
call Message3 ; print john
quit ; quit the program
Message1:
echo "Hello World"
; in here, returning will return to the main function
ret
Message2:
echo "My Name Is"
ret
Message3:
echo John
return ; return can also be used, it acts the same as ret
; Output: Hello World My Name Is John
</pre>
=== loop 1 ===
<pre>
goto loop ; start the loop
loop:
echo Boom! ; print it to the console
goto loop ; jump to the loop (2 lines above)
; Output: Boom! Boom! Boom! Boom! Boom! Boom! ...
</pre>
=== loop 2 (smaller) ===
<pre>
echo "0101" ; print the text
goto "1" ; goto also supports going to a line number
; Output: 01010101010101010101010101010101 ...
</pre>
=== memory addresses ===
<pre>
move 1 15 ; Store 15 into index 1
move 2 30 ; Store 30 into index 2
move 3 45 ; Store 45 into index 3
read 1,a
echo "a"
read 2,a
echo "a"
read 3,a
echo "a"
; Output: 15 30 45
</pre>
=== nesting ===
<pre>
call n1
quit
n1:
echo "Beyond"
call n2
ret
n2:
echo "The"
call n3
return
n3:
echo "Horizon"
return
; Output: Beyond The Horizon
</pre>
== Implementation ==
I only ever implemented this language in TurboWarp.
[[Category:Languages]] [[Category:2026]] [[Category:Output only]] [[Category:Finite state automata]] [[Category:Implemented]]' |
Lines added in edit (added_lines) | [
0 => 'Welcome to Assembly But Worse! A worse version of assembly language made by the genius himself, [[User:WoodyFan3412|WoodyFan3412]].',
1 => '<br>',
2 => 'The language is heavily inspired by [https://en.wikipedia.org/wiki/Assembly_language Assembly Language].',
3 => '',
4 => '[[File:CWarp4Screenshot.png|thumb|right|A program written in Assembly But Worse.]]',
5 => '[[File:CWarp4Screenshot2.png|thumb|right|Pre Processer Directives.]]',
6 => '',
7 => '== Memory ==',
8 => 'when the program is started, a list with 3,000 values (3 kb) is initalized to 0, the program can read and write from this list of values',
9 => '<br>',
10 => 'the program can also use a stack',
11 => '',
12 => '== Program Info ==',
13 => '<br>',
14 => '{| class="wikitable"',
15 => '|+ Registers',
16 => '|-',
17 => '! Name !! Purpose !! Default',
18 => '|-',
19 => '| X || Index X || 0',
20 => '|-',
21 => '| Y || Index Y || 0',
22 => '|-',
23 => '| A || The accumulator, any math operations will use this value. || 0',
24 => '|-',
25 => '| PC || Program Counter || 1',
26 => '|-',
27 => '| Z || Is set to 1 if the accumulator is 0, is set to 0 otherwise. || 1',
28 => '|}',
29 => '',
30 => '{| class="wikitable"',
31 => '|+ Instructions',
32 => '|-',
33 => '! Name !! Opcode !! Operands !! Description',
34 => '|-',
35 => '| goto || 0 || <label> || Sets the program counter to this location in the code',
36 => '|-',
37 => '| call || 1 || <subroutine> || Pushes a return address onto the stack and sets the program counter to this location in the code',
38 => '|-',
39 => '| ret || 2 || || Returns to the value on the top of the stack, this also allows for subroutines to be nested inside of eachother',
40 => '|-',
41 => '| return || 2 || || Returns to the value on the top of the stack, This is an alias of 'ret'',
42 => '|-',
43 => '| quit || 3 || || Quits the program',
44 => '|-',
45 => '| echo || 4 || <text> || Puts this text in the console. If the argument is a register, it puts the value of the register in the console.',
46 => '|-',
47 => '| push || 5 || <register> || pushes the value of this register on the stack',
48 => '|-',
49 => '| pop || 6 || <register> || gets the value on the top of the stack and sets the register to that value',
50 => '|-',
51 => '| read || 7 || <address> <register> || Reads a value from memory and stores it in the register',
52 => '|-',
53 => '| write || 8 || <address> <register> || Writes the value of the register to this location in memory',
54 => '|-',
55 => '| move || 9 || <loc1> <loc2> || move a 15 will move the value 15 into register A, move 15 10 will move the value 10 into memory 15, move a x will move the value of a into X.',
56 => '|-',
57 => '| inc || 10 || <register> || changes this register's value by 1, the register can only be in the range 0 - 255 and can overflow',
58 => '|-',
59 => '| dec || 11 || <register> || changes this register's value by -1, the register can only be in the range 0 - 255 and can overflow',
60 => '|}',
61 => '',
62 => '== Pre-Processing ==',
63 => 'ABW supports pre-processing, which are instructions that dictate how the source should be compiled to byte-code',
64 => '<br>',
65 => 'Just like in C++, you can use #define to make the compiler replace a string with a value',
66 => '<pre>',
67 => '#define HELLO "Hello, World!"',
68 => 'goto main',
69 => '',
70 => 'main:',
71 => ' echo HELLO',
72 => ' quit',
73 => '',
74 => '; Output: "Hello, World!"',
75 => '</pre>',
76 => '',
77 => '',
78 => '== Examples ==',
79 => '',
80 => '=== function ===',
81 => '<pre>',
82 => 'goto main',
83 => '',
84 => 'main:',
85 => ' call Message1 ; print hello world',
86 => ' call Message2 ; print my name is',
87 => ' call Message3 ; print john',
88 => ' quit ; quit the program',
89 => '',
90 => '',
91 => 'Message1:',
92 => ' echo "Hello World"',
93 => ' ',
94 => ' ; in here, returning will return to the main function',
95 => ' ret',
96 => '',
97 => 'Message2:',
98 => ' echo "My Name Is"',
99 => ' ret',
100 => '',
101 => 'Message3:',
102 => ' echo John',
103 => ' return ; return can also be used, it acts the same as ret',
104 => '',
105 => '; Output: Hello World My Name Is John',
106 => '</pre>',
107 => '',
108 => '=== loop 1 ===',
109 => '<pre>',
110 => 'goto loop ; start the loop',
111 => '',
112 => 'loop:',
113 => ' echo Boom! ; print it to the console',
114 => ' goto loop ; jump to the loop (2 lines above)',
115 => '',
116 => '; Output: Boom! Boom! Boom! Boom! Boom! Boom! ...',
117 => '</pre>',
118 => '',
119 => '=== loop 2 (smaller) ===',
120 => '<pre>',
121 => 'echo "0101" ; print the text',
122 => 'goto "1" ; goto also supports going to a line number',
123 => '',
124 => '; Output: 01010101010101010101010101010101 ...',
125 => '</pre>',
126 => '',
127 => '=== memory addresses ===',
128 => '<pre>',
129 => 'move 1 15 ; Store 15 into index 1',
130 => 'move 2 30 ; Store 30 into index 2',
131 => 'move 3 45 ; Store 45 into index 3',
132 => '',
133 => 'read 1,a',
134 => 'echo "a"',
135 => 'read 2,a',
136 => 'echo "a"',
137 => 'read 3,a',
138 => 'echo "a"',
139 => '',
140 => '; Output: 15 30 45',
141 => '</pre>',
142 => '=== nesting ===',
143 => '<pre>',
144 => 'call n1',
145 => 'quit',
146 => '',
147 => 'n1:',
148 => ' echo "Beyond"',
149 => ' call n2',
150 => ' ret',
151 => '',
152 => 'n2:',
153 => ' echo "The"',
154 => ' call n3',
155 => ' return',
156 => '',
157 => 'n3:',
158 => ' echo "Horizon"',
159 => ' return',
160 => '',
161 => '; Output: Beyond The Horizon',
162 => '</pre>',
163 => '',
164 => '== Implementation ==',
165 => 'I only ever implemented this language in TurboWarp.',
166 => '',
167 => '[[Category:Languages]] [[Category:2026]] [[Category:Output only]] [[Category:Finite state automata]] [[Category:Implemented]]'
] |