summaryrefslogtreecommitdiff
path: root/02/in02
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2021-11-09 20:53:55 -0500
committerpommicket <pommicket@gmail.com>2021-11-09 20:53:55 -0500
commitbefd4a64357e1509c8ab83599fafd9a328e1b736 (patch)
treee7c32dc169684a37454f6600111ab0fce0e9fd05 /02/in02
parent66496d98c4104f2ccef318054fc6598de861e438 (diff)
hello world working! yay!
Diffstat (limited to '02/in02')
-rw-r--r--02/in0248
1 files changed, 46 insertions, 2 deletions
diff --git a/02/in02 b/02/in02
index a304839..8355546 100644
--- a/02/in02
+++ b/02/in02
@@ -1,3 +1,47 @@
-::hw
jm
-:-hw
+:-co jump to code
+::hw
+'H
+'e
+'l
+'l
+'o
+',
+'
+'w
+'o
+'r
+'l
+'d
+'!
+\n
+::he end of hello world
+::co start of code
+//
+// now we'll calculate the length of the hello world string
+// by subtracting hw from he.
+//
+im
+--he
+BA
+im
+--hw
+nA
++B
+DA put length in rdx
+// okay now we can write it
+im
+##1.
+JA set rdi to 1 (stdout)
+im
+--hw
+IA set rsi to a pointer to "Hello, world!\n"
+im
+##1. write
+sy
+im
+##0. exit code 0
+JA
+im
+##3c. exit = syscall 0x3c
+sy