diff options
| author | ruki <[email protected]> | 2020-05-19 23:04:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-05-19 12:27:40 +0800 |
| commit | 678fcb59c1dbf71e4cfc8bce8f7e9b65349c6a5f (patch) | |
| tree | e24f27375da0dfbe35b2fc6338023de1766f0309 | |
| parent | 737e0081819f9337a60b5019b2445a12091e9e41 (diff) | |
improve yasm test
| -rw-r--r-- | tests/projects/yasm/src/main.S | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/tests/projects/yasm/src/main.S b/tests/projects/yasm/src/main.S index 822d9bf4c..800722a44 100644 --- a/tests/projects/yasm/src/main.S +++ b/tests/projects/yasm/src/main.S @@ -1,18 +1,20 @@ -;asm00.s +bits 64 + +extern _puts section .data - msg db 'Hello world!' - nl db 0x0a - msgLen equ $-msg + +message: + db 'hello xmake!', 0 + section .text -global _start -_start: - mov rax, 1 - mov rdi, 1 - mov rsi, qword msg - mov rdx, qword msgLen - syscall - mov rax, 60 - mov rdi, 0 - syscall +global _main +_main: + push rbp + mov rbp, rsp + lea rdi, [rel message] + call _puts + xor rax, rax + pop rbp + ret |
