Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .text
- extern printf
- global _start ;must be declared for linker (ld)
- _start: ;tells linker entry point
- push ebp ;save the calling program base pointer (OS)
- mov ebp, esp ;creates a new entry for the program
- push msg ;pushes the memory address onto the stack
- call printf
- mov esp, ebp ;destroy stack frame and restores the pointer to OS
- pop ebp
- ret
- section .data
- msg db 'Hello, world!' , 10,0 ;string to be printed 10-return to next
- ;10 - return to next line, 0 end of message
- len equ $ - msg ;length of the string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement