zasm assembly compiler support next instruction (jmp; inc; mov 32bit, 32bit; hlt...
[ZeXOS.git] / apps / zasm / src
blob5807169cad31c86101dbdd22a4a2843071ec8880
1 ; Example source code for ZeX/OS assembly compiler
2 global entry
3 global print
5 entry:
6         ; map process
7         mov eax, 46
8         int 0x80
10         ; set ecx register to value 1
11         mov ecx, 1
12 print:
13         ; print on screen
14         mov eax, 4
15         mov ebx, 'H'
16         int 0x80
18         mov eax, 4
19         mov ebx, 'e'
20         int 0x80
22         mov eax, 4
23         mov ebx, 'y'
24         int 0x80
26         mov eax, 4
27         mov ebx, '!'
28         int 0x80
30         mov eax, 4
31         mov ebx, 10
32         int 0x80
34         ; sleep ([cycle]s)
35         mov eax, 3
36         mov ebx, ecx
37         int 0x80
39         ; increase ecx register's value
40         inc ecx
42         ; jump to start of print function
43         jmp print
45         ; exit program (this part is not used, because jmp instruction is neverending)
46         mov eax, 1
47         int 0x80
49         ret