summaryrefslogtreecommitdiff
path: root/02/in02
blob: 8355546af64e03a2c09636ab12864f341e4da5cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
jm
:-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