App inst fixed on invalid image file; App zinstall for ZDE works - we've got GUI...
[ZeXOS.git] / apps / zasm / src
blobcb78523d45571efc70513469af827926c2d76eab
1 ; Example source code for ZeX/OS assembly compiler
2 welcome db 'ZASM example binary file', 0xA
4 global entry
5 global loop
7 entry:
8         ; first we get arguments
9         mov eax, 26
10         mov ecx, 0
11         int 0x80
13         ; lets get count of arguments
14         mov eax, 26
15         mov ecx, 1
16         int 0x80
18         ; print welcome message on screen
19         mov eax, 11
20         mov ebx, welcome
21         mov ecx, 25
22         mov edx, 0
23         int 0x80
25         ; set in ecx register value 65 (ASCII character id of 'A')  
26         mov ecx, 65
28 loop:
30         ; sleep (loop cycle + 1 second)
31         mov eax, 3
32         mov ebx, 1
33         int 0x80
35         ; print character on screen from ecx register
36         mov eax, 4
37         mov ebx, ecx
38         int 0x80
40         ; increase value in register ecx
41         inc ecx
43         ; compare value in ecx register with 91
44         cmp ecx, 91
46         ; jump to start of loop function, when value in ecx register is NOT 91
47         jnz loop
49         ; print character '\n' on screen
50         mov eax, 4
51         mov ebx, 0xA
52         int 0x80
54         ; exit program with succefully status
55         mov eax, 1
56         mov ebx, 0
57         int 0x80
59         ret