repo.or.cz
/
ZeXOS.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
zasm assembly compiler support next instruction (jmp; inc; mov 32bit, 32bit; hlt...
[ZeXOS.git]
/
apps
/
zasm
/
src
blob
5807169cad31c86101dbdd22a4a2843071ec8880
1
; Example source code for ZeX/OS assembly compiler
2
global entry
3
global print
4
5
entry:
6
; map process
7
mov eax, 46
8
int 0x80
9
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
17
18
mov eax, 4
19
mov ebx, 'e'
20
int 0x80
21
22
mov eax, 4
23
mov ebx, 'y'
24
int 0x80
25
26
mov eax, 4
27
mov ebx, '!'
28
int 0x80
29
30
mov eax, 4
31
mov ebx, 10
32
int 0x80
33
34
; sleep ([cycle]s)
35
mov eax, 3
36
mov ebx, ecx
37
int 0x80
38
39
; increase ecx register's value
40
inc ecx
41
42
; jump to start of print function
43
jmp print
44
45
; exit program (this part is not used, because jmp instruction is neverending)
46
mov eax, 1
47
int 0x80
48
49
ret