Skip to content

Commit f49b307

Browse files
committed
Printing 9 stars
1 parent 64e7862 commit f49b307

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

ShowStars/ShowStars.asm

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,25 @@
22
; x86 architecture
33
; Intel specification
44
section .data
5-
5+
msg db 'Displaying 9 stars',0xa ;a message
6+
len equ $ - msg ;length of message
7+
s2 times 9 db '*'
68

79
section .text
810
global _start
911

1012
_start:
11-
12-
13-
13+
mov edx,len ;message length
14+
mov ecx,msg ;message to write
15+
mov ebx,1 ;file descriptor (stdout)
16+
mov eax,4 ;system call number (sys_write)
17+
int 0x80 ;call kernel
18+
19+
mov edx,9 ;message length
20+
mov ecx,s2 ;message to write
21+
mov ebx,1 ;file descriptor (stdout)
22+
mov eax,4 ;system call number (sys_write)
23+
int 0x80 ;call kernel
24+
25+
mov eax,1 ;system call number (sys_exit)
26+
int 0x80 ;call kernel

0 commit comments

Comments
 (0)