summaryrefslogtreecommitdiff
path: root/main.asm
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2024-09-20 10:51:45 +0200
committerfxqnlr <[email protected]>2024-09-20 10:51:45 +0200
commit0b7957db671400ee34f8f597b409f792e5300186 (patch)
tree8d0375b54a861b6de54c69a34fdd68d20e959d76 /main.asm
parent9c5783f030d7c876ccf6e05e8182d88f84a97fc3 (diff)
downloadasmsite-main.tar
asmsite-main.tar.gz
asmsite-main.zip
stuff and debug deleteHEADmain
Diffstat (limited to 'main.asm')
-rw-r--r--main.asm16
1 files changed, 14 insertions, 2 deletions
diff --git a/main.asm b/main.asm
index 8c19651..03148b4 100644
--- a/main.asm
+++ b/main.asm
@@ -12,9 +12,10 @@ struc db [data]
12segment writable readable 12segment writable readable
13connect_header db 'HTTP/1.1 200 OK', 13, 10 13connect_header db 'HTTP/1.1 200 OK', 13, 10
14 db 'Content-Type: text/html', 13, 10 14 db 'Content-Type: text/html', 13, 10
15 db 'Server: asmsite', 13, 10
15 db 'Connection: close', 13, 10 16 db 'Connection: close', 13, 10
16 db 13, 10 17 db 13, 10
17 db '<!DOCTYPE html><html><head><title>asmsite</title></head><body>Hello, World!</body></html>', 10 18 db '<!DOCTYPE html><html><head><title>asmsite</title></head><body>Hello, World!</body></html>', 10
18connect_header_len = $ - connect_header 19connect_header_len = $ - connect_header
19 20
20stat_msg db 'Get file stats', 10 21stat_msg db 'Get file stats', 10
@@ -50,6 +51,13 @@ serveraddr_len = $ - serveraddr.sin_family
50clientaddr servaddr_in 51clientaddr servaddr_in
51clientaddr_len dd serveraddr_len 52clientaddr_len dd serveraddr_len
52 53
54struc timespec
55{
56 .time dq 0
57 .time_nano dd 0
58}
59sleep_time timespec
60
53segment readable executable 61segment readable executable
54 62
55entry _main 63entry _main
@@ -92,7 +100,7 @@ _main:
92 jl error 100 jl error
93 101
94 ls_write STDOUT, listen_msg, listen_msg.size 102 ls_write STDOUT, listen_msg, listen_msg.size
95 ls_listen qword [socketfd], 5 103 ls_listen qword [socketfd], 4096
96 cmp rax, 0 104 cmp rax, 0
97 jl error 105 jl error
98 106
@@ -106,6 +114,10 @@ listen:
106 114
107 ls_write qword [connfd], connect_header, connect_header_len 115 ls_write qword [connfd], connect_header, connect_header_len
108 116
117 ;; mov [sleep_time.time], 10
118 ;; mov [sleep_time.time_nano], 1000
119 ;; ls_nanosleep sleep_time.time, 0
120
109 ls_close qword [connfd] 121 ls_close qword [connfd]
110 122
111 jmp listen 123 jmp listen