diff --git a/related_info/lab1/Makefile b/related_info/lab1/Makefile new file mode 100644 index 0000000..e190775 --- /dev/null +++ b/related_info/lab1/Makefile @@ -0,0 +1,6 @@ +all: write + +write: defines.h write.s + gcc -o write write.s +clean: + rm write write.o diff --git a/related_info/lab1/defines.h b/related_info/lab1/defines.h new file mode 100644 index 0000000..1dd7b48 --- /dev/null +++ b/related_info/lab1/defines.h @@ -0,0 +1,26 @@ +SYS_exit = 1 +SYS_fork = 2 +SYS_write = 4 +SYS_open = 5 +SYS_close = 6 +SYS_execve = 11 +SYS_lseek = 19 +SYS_dup2 = 63 +SYS_mmap = 90 +SYS_munmap = 91 +SYS_socketcall = 102 +SYS_socketcall_socket = 1 +SYS_socketcall_bind = 2 +SYS_socketcall_listen = 4 +SYS_socketcall_accept = 5 + +SEEK_END = 2 +PROT_READ = 1 +MAP_SHARED = 1 + +AF_INET = 2 +SOCK_STREAM = 1 +IPPROTO_TCP = 6 + + +STDOUT = 1 diff --git a/related_info/lab1/write.s b/related_info/lab1/write.s new file mode 100644 index 0000000..11b1de7 --- /dev/null +++ b/related_info/lab1/write.s @@ -0,0 +1,14 @@ +.include "defines.h" +.data +hello: + .string "hello world\n" + +.globl main +main: + movl $SYS_write,%eax + movl $STDOUT,%ebx + movl $hello,%ecx + movl $12,%edx + int $0x80 + + ret