Finished lesson 36

All done
This commit is contained in:
Lauri Koskenniemi 2025-06-24 21:14:37 +03:00
parent 5a0c4a49c7
commit 42d2533099
24 changed files with 501 additions and 0 deletions

BIN
lesson29/l29 Executable file

Binary file not shown.

27
lesson29/l29.asm Normal file
View File

@ -0,0 +1,27 @@
; %include '../lib/fl.asm' ; local
%include 'lib/fl.asm' ; build.sh
SECTION .text
global _start
_start:
xor eax, eax
xor ebx, ebx
xor edi, edi
xor esi, esi
_socket:
push byte 6
push byte 1
push byte 2
mov ecx, esp
mov ebx, 1
mov eax, 102
int 80h
call iprintLF
_exit:
call quit

BIN
lesson29/l29.o Normal file

Binary file not shown.

BIN
lesson30/l30 Executable file

Binary file not shown.

39
lesson30/l30.asm Normal file
View File

@ -0,0 +1,39 @@
; %include '../lib/fl.asm' ; local
%include 'lib/fl.asm' ; build.sh
SECTION .text
global _start
_start:
xor eax, eax
xor ebx, ebx
xor edi, edi
xor esi, esi
_socket:
push byte 6
push byte 1
push byte 2
mov ecx, esp
mov ebx, 1
mov eax, 102
int 80h
_bind:
mov edi, eax
push dword 0x00000000
push word 0x2923
push word 2
mov ecx, esp
push byte 16
push ecx
push edi
mov ecx, esp
mov ebx, 2
mov eax, 102
int 80h
_exit:
call quit

BIN
lesson30/l30.o Normal file

Binary file not shown.

BIN
lesson31/l31 Executable file

Binary file not shown.

47
lesson31/l31.asm Normal file
View File

@ -0,0 +1,47 @@
; %include '../lib/fl.asm' ; local
%include 'lib/fl.asm' ; build.sh
SECTION .text
global _start
_start:
xor eax, eax
xor ebx, ebx
xor edi, edi
xor esi, esi
_socket:
push byte 6
push byte 1
push byte 2
mov ecx, esp
mov ebx, 1
mov eax, 102
int 80h
_bind:
mov edi, eax
push dword 0x00000000
push word 0x2923
push word 2
mov ecx, esp
push byte 16
push ecx
push edi
mov ecx, esp
mov ebx, 2
mov eax, 102
int 80h
_listen:
push byte 1
push edi
mov ecx, esp
mov ebx, 4
mov eax, 102
int 80h
_exit:
call quit

BIN
lesson31/l31.o Normal file

Binary file not shown.

BIN
lesson32/l32 Executable file

Binary file not shown.

56
lesson32/l32.asm Normal file
View File

@ -0,0 +1,56 @@
; %include '../lib/fl.asm' ; local
%include 'lib/fl.asm' ; build.sh
SECTION .text
global _start
_start:
xor eax, eax
xor ebx, ebx
xor edi, edi
xor esi, esi
_socket:
push byte 6
push byte 1
push byte 2
mov ecx, esp
mov ebx, 1
mov eax, 102
int 80h
_bind:
mov edi, eax
push dword 0x00000000
push word 0x2923
push word 2
mov ecx, esp
push byte 16
push ecx
push edi
mov ecx, esp
mov ebx, 2
mov eax, 102
int 80h
_listen:
push byte 1
push edi
mov ecx, esp
mov ebx, 4
mov eax, 102
int 80h
_accept:
push byte 0
push byte 0
push edi
mov ecx, esp
mov ebx, 5
mov eax, 102
int 80h
_exit:
call quit

BIN
lesson32/l32.o Normal file

Binary file not shown.

BIN
lesson33/l33 Executable file

Binary file not shown.

79
lesson33/l33.asm Normal file
View File

@ -0,0 +1,79 @@
; %include '../lib/fl.asm' ; local
%include 'lib/fl.asm' ; build.sh
SECTION .bss
buffer resb 255,
SECTION .text
global _start
_start:
xor eax, eax
xor ebx, ebx
xor edi, edi
xor esi, esi
_socket:
push byte 6
push byte 1
push byte 2
mov ecx, esp
mov ebx, 1
mov eax, 102
int 80h
_bind:
mov edi, eax
push dword 0x00000000
push word 0x2923
push word 2
mov ecx, esp
push byte 16
push ecx
push edi
mov ecx, esp
mov ebx, 2
mov eax, 102
int 80h
_listen:
push byte 1
push edi
mov ecx, esp
mov ebx, 4
mov eax, 102
int 80h
_accept:
push byte 0
push byte 0
push edi
mov ecx, esp
mov ebx, 5
mov eax, 102
int 80h
_fork:
mov esi, eax
mov eax, 2
int 80h
cmp eax, 0
jz _read
jmp _accept
_read:
mov edx, 255
mov ecx, buffer
mov ebx, esi
mov eax, 3
int 80h
mov eax, buffer
call sprintLF
_exit:
call quit

BIN
lesson33/l33.o Normal file

Binary file not shown.

BIN
lesson34/l34 Executable file

Binary file not shown.

89
lesson34/l34.asm Normal file
View File

@ -0,0 +1,89 @@
; %include '../lib/fl.asm' ; local
%include 'lib/fl.asm' ; build.sh
SECTION .data
response db 'HTTP/1.1 200 OK', 0Dh, 0Ah, 'Content-Type: text/html', 0Dh, 0Ah, 'Content-Length: 14', 0Dh, 0Ah, 0Dh, 0Ah, 'Hello World!', 0Dh, 0Ah, 0h
SECTION .bss
buffer resb 255,
SECTION .text
global _start
_start:
xor eax, eax
xor ebx, ebx
xor edi, edi
xor esi, esi
_socket:
push byte 6
push byte 1
push byte 2
mov ecx, esp
mov ebx, 1
mov eax, 102
int 80h
_bind:
mov edi, eax
push dword 0x00000000
push word 0x2923
push word 2
mov ecx, esp
push byte 16
push ecx
push edi
mov ecx, esp
mov ebx, 2
mov eax, 102
int 80h
_listen:
push byte 1
push edi
mov ecx, esp
mov ebx, 4
mov eax, 102
int 80h
_accept:
push byte 0
push byte 0
push edi
mov ecx, esp
mov ebx, 5
mov eax, 102
int 80h
_fork:
mov esi, eax
mov eax, 2
int 80h
cmp eax, 0
jz _read
jmp _accept
_read:
mov edx, 255
mov ecx, buffer
mov ebx, esi
mov eax, 3
int 80h
mov eax, buffer
call sprintLF
_write:
mov edx, 78
mov ecx, response
mov ebx, esi
mov eax, 4
int 80h
_exit:
call quit

BIN
lesson34/l34.o Normal file

Binary file not shown.

BIN
lesson35/l35 Executable file

Binary file not shown.

94
lesson35/l35.asm Normal file
View File

@ -0,0 +1,94 @@
; %include '../lib/fl.asm' ; local
%include 'lib/fl.asm' ; build.sh
SECTION .data
response db 'HTTP/1.1 200 OK', 0Dh, 0Ah, 'Content-Type: text/html', 0Dh, 0Ah, 'Content-Length: 14', 0Dh, 0Ah, 0Dh, 0Ah, 'Hello World!', 0Dh, 0Ah, 0h
SECTION .bss
buffer resb 255,
SECTION .text
global _start
_start:
xor eax, eax
xor ebx, ebx
xor edi, edi
xor esi, esi
_socket:
push byte 6
push byte 1
push byte 2
mov ecx, esp
mov ebx, 1
mov eax, 102
int 80h
_bind:
mov edi, eax
push dword 0x00000000
push word 0x2923
push word 2
mov ecx, esp
push byte 16
push ecx
push edi
mov ecx, esp
mov ebx, 2
mov eax, 102
int 80h
_listen:
push byte 1
push edi
mov ecx, esp
mov ebx, 4
mov eax, 102
int 80h
_accept:
push byte 0
push byte 0
push edi
mov ecx, esp
mov ebx, 5
mov eax, 102
int 80h
_fork:
mov esi, eax
mov eax, 2
int 80h
cmp eax, 0
jz _read
jmp _accept
_read:
mov edx, 255
mov ecx, buffer
mov ebx, esi
mov eax, 3
int 80h
mov eax, buffer
call sprintLF
_write:
mov edx, 78
mov ecx, response
mov ebx, esi
mov eax, 4
int 80h
_close:
mov ebx, esi
mov eax, 6
int 80h
_exit:
call quit

BIN
lesson35/l35.o Normal file

Binary file not shown.

BIN
lesson36/l36 Executable file

Binary file not shown.

70
lesson36/l36.asm Normal file
View File

@ -0,0 +1,70 @@
; %include '../lib/fl.asm' ; local
%include 'lib/fl.asm' ; build.sh
SECTION .data
request db 'GET / HTTP/1.1', 0Dh, 0Ah, 'Host: 139.162.39.66:80', 0Dh, 0Ah, 0Dh, 0Ah, 0h
SECTION .bss
buffer resb 1,
SECTION .text
global _start
_start:
xor eax, eax
xor ebx, ebx
xor edi, edi
_socket:
push byte 6
push byte 1
push byte 2
mov ecx, esp
mov ebx, 1
mov eax, 102
int 80h
_connect:
mov edi, eax
push dword 0x4227a28b
push word 0x5000
push word 2
mov ecx, esp
push byte 16
push ecx
push edi
mov ecx, esp
mov ebx, 3
mov eax, 102
int 80h
_write:
mov edx, 43
mov ecx, request
mov ebx, edi
mov eax, 4
int 80h
_read:
mov edx, 1
mov edx, buffer
mov ebx, edi
mov eax, 3
int 80h
cmp eax, 0
jz _close
mov eax, buffer
call sprint
jmp _read
_close:
mov ebx, edi
mov eax, 6
int 80h
_exit:
call quit

BIN
lesson36/l36.o Normal file

Binary file not shown.