2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
23
Task/Hello-world-Text/X86-Assembly/hello-world-text-3.x86
Normal file
23
Task/Hello-world-Text/X86-Assembly/hello-world-text-3.x86
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// No "main" used
|
||||
// compile with `gcc -nostdlib`
|
||||
#define SYS_WRITE $1
|
||||
#define STDOUT $1
|
||||
#define SYS_EXIT $60
|
||||
#define MSGLEN $14
|
||||
|
||||
.global _start
|
||||
.text
|
||||
|
||||
_start:
|
||||
movq $message, %rsi // char *
|
||||
movq SYS_WRITE, %rax
|
||||
movq STDOUT, %rdi
|
||||
movq MSGLEN, %rdx
|
||||
syscall // sys_write(message, stdout, 0x14);
|
||||
|
||||
movq SYS_EXIT, %rax
|
||||
xorq %rdi, %rdi // The exit code.
|
||||
syscall // exit(0)
|
||||
|
||||
.data
|
||||
message: .ascii "Hello, world!\n"
|
||||
Loading…
Add table
Add a link
Reference in a new issue