Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
hello1
global _start section .data message: db 'hello world',10 linefeed: db 10 section .text _start: ;mov rax, 1 ;system call number should be stored in rax ;mov rdi,1 ;argument #1 in rdi: where to write (descriptor)? ;mov rsi,message+6 ;argument #2 in rsi: where does the string start? ;mov rdx,6 ;argument #3 in rdx, how many bytes to write? ;syscall ;this instruction invokes a system call mov rax, 4 ; sys_write mov rbx, 1 ;stdout mov rcx, message+6 ; print starting from "world" mov rdx, 6 int 80H ;mov rax,1 ;mov rdi,1 ;mov rsi,message ;mov rdx,5 ;syscall mov rax, 4 ;sys_write mov rbx, 1 ;std_out mov rcx, message; print from hello world mov rdx, 5 ; print 5 characters? int 80H ;mov rax,1 ;mov rdi,1 ;mov rsi,linefeed ;mov rdx,1 ;syscall mov rax, 4 mov rbx, 1 mov rcx, linefeed ; go to end to put new line at the end of hello mov rdx, 1 ; only one character int 80H mov rax,1 ;The system call for exit (sys_exit) xor rbx,rbx ; Exit with return code of 0 (no error) int 80H ;invokes the system call
run
|
edit
|
history
|
help
0
lec4b.asm
sadffsdfdsafsd
displaying 9 stars
dfhgjfsdsff
MyFirst Program
sdasdasad
FirstProject
FirstProgram
dfdfdfsff
intfunct_64