Commits

Paweł Wieczorek committed ff679df Draft

server socket is created

Comments (0)

Files changed (3)

 # All rights reserved.
 
 .include "frame.s"
+.include "constants.s"
 
 LOCAL_PROC prepare_server
     FRAME_ENTER
+
+    mov $server_sockaddr,   %rdi
+    mov $server_address,    %rsi
+    mov $80,                %rdx
+    call fill_sockaddr_in
+
+    call sock_create
+    mov %rax,  server_socket
+    # check-error
+
     FRAME_LEAVE
 
 LOCAL_PROC serve
     FRAME_LEAVE
 
 ##########################################################################
+# SECTION DATA 
+##########################################################################
+.section .data
+
+.lcomm server_sockaddr, SOCKADDR_IN_SIZE
+.lcomm client_sockaddr, SOCKADDR_IN_SIZE
+server_socket : .int 0
+client_socket : .int 0
+
+
+##########################################################################
 # SECTION RODATA 
 ##########################################################################
 .section .rodata
 
-print_int_fmt: .asciz "integer: %i [hex: 0x%x]\n"
-addr:          .asciz "0.0.0.0"
+print_int_fmt:
+    .asciz "integer: %i [hex: 0x%x]\n"
+
+server_address:
+    .asciz "0.0.0.0"
 ##########################################################################
 .section .data
 
-# Linux
-.set PF_INET, 2
-.set SOCK_STREAM, 1
-.set IPPROTO_TCP, 6
 
-.set SOCKADDR_IN_SIZE, 16
-
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.