diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2026-02-20 12:50:05 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2026-02-20 12:50:05 +0100 |
| commit | ba84097e38b02b3a213fbfc37f0ee2312ce6aa20 (patch) | |
| tree | ade3c6ee165ded547d213dc384b28720e65366c4 /src/error.S | |
| parent | 794ce30a84be44e258a96fd35eb9f86e235ce807 (diff) | |
| download | snake.s-main.tar.xz snake.s-main.zip | |
Diffstat (limited to 'src/error.S')
| -rw-r--r-- | src/error.S | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/error.S b/src/error.S index 50597dd..8075c26 100644 --- a/src/error.S +++ b/src/error.S @@ -3,20 +3,25 @@ #ifndef __STDC_VERSION__ +.section .rodata + + sdl_error_format: .string "%s: %s\n" + .section .text - //! @function _print_sdl_error(char const * format) + //! @function _print_sdl_error(char const * prefix) + //! + //! @param (%rdi) prefix The prefix to be printed in front of the error message function_begin _print_sdl_error - push %rdi sub $8, %rsp + push %rdi call SDL_GetError@PLT - mov %rax, %rsi + mov %rax, %rdx - add $8, %rsp - pop %rdi - + mov (%rsp), %rsi + lea sdl_error_format(%rip), %rdi call printf@PLT function_end |
