Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
lec4.asm
;File: lec4.asm ;read from standard in and write to standard out ;assemble using NASM: nasm -felf64 lec4.asm -o lec4.o ;link with ld: ld –o lec4 lec4.o ;execute with ./lec4 %define STDIN 0 %define STDOUT 1 %define EXIT 60 %define WRITE 1 %define READ 0 %define BUFLEN 256 section .data msg1: db "Enter string: " len1: equ $-msg1 ;length of first message section .bss buf: resb BUFLEN section .text global _start _start: mov rax, WRITE mov rdi, STDOUT mov rsi, msg1 mov rdx, len1 syscall mov rax, READ mov rdi, STDIN mov rsi, buf mov rdx, BUFLEN syscall mov rax, WRITE mov rdi, STDOUT mov rsi, buf mov rdx, BUFLEN syscall mov rax,EXIT xor rdi,rdi syscall
run
|
edit
|
history
|
help
0
fdsfdasfdsfd
lec4bb.asm
text.asm
lec4bb
First Program Group Lab
dfsafdsafdsafdsfsd
Hello World
Hello
write
Counting from 0 to 10