summary refs log tree commit diff
path: root/the_e_programming_language/test.e
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2025-03-31 19:27:55 +0300
committerWlodekM <[email protected]>2025-03-31 19:27:55 +0300
commitef4e8c20719822eebd6318a878cc37902c2b85a5 (patch)
treec80cc67921c8b511f5a50ec68834b5b28deb05a1 /the_e_programming_language/test.e
pc thing
Diffstat (limited to 'the_e_programming_language/test.e')
-rwxr-xr-xthe_e_programming_language/test.e43
1 files changed, 43 insertions, 0 deletions
diff --git a/the_e_programming_language/test.e b/the_e_programming_language/test.e
new file mode 100755
index 0000000..4996d5c
--- /dev/null
+++ b/the_e_programming_language/test.e
@@ -0,0 +1,43 @@
+// comments exist
+// 
+// types (in addresses (they store 2 bytes if you forgot)):
+// int - 1
+// char - 1
+// bool - 1
+// uuh yeah,, theyre all 1 address ;-;
+//
+// $VARNAME is the address of the var, when used in mov it means that we get that var
+// [$VARNAME] is the address of the var, but when it's used in mov it means we set to the address
+
+// translates to:
+// mov a 0
+// mov $counter a
+// prob not gonna make it do assembly tho
+int[4] buff = 0
+int counter = 0
+
+fn _start {
+    // translates to
+    // <inner code>
+    // mov a $counter
+    // mov b 4
+    // cmp a b
+    // jz $start_of_inner_code
+    while (counter < 4) {
+        // translates to
+        // mov a [$buff]
+        // mov b [$counter]
+        // add a a b
+        // mov b $counter
+        // str a b
+        buff[counter] = counter
+        // translates to
+        // mov a $counter ; further translates to:
+        //                ; mov a $counter
+        //                ; ld a a
+        // mov b 1
+        // add a a b
+        // str $counter a
+        counter = counter + 1
+    }
+}
\ No newline at end of file