School Commit Init

This commit is contained in:
2024-08-31 12:07:21 +03:00
commit 0b130ee18c
2801 changed files with 4720552 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
bits 32 ; assembling for the 32 bits architecture
; declare the EntryPoint (a label defining the very first instruction of the program)
global start
; declare external functions needed by our program
extern exit ; tell nasm that exit exists even if we won't be defining it
import exit msvcrt.dll ; exit is a function that ends the calling process. It is defined in msvcrt.dll
; msvcrt.dll contains exit, printf and all the other important C-runtime specific functions
; our data is declared here (the variables needed by our program)
segment data use32 class=data
; ...
a db "coaie"
l equ $-$$
b resb l
; our code starts here
segment code use32 class=code
start:
; ...
mov ESI,a
mov EDI,b
mov ECX,l
cld
jecxz end
label:
lodsb
sub al,"a"-"A"
stosb
loop label
end:
; exit(0)
push dword 0 ; push the parameter for exit onto the stack
call [exit] ; call exit to terminate the program
+36
View File
@@ -0,0 +1,36 @@
bits 32 ; assembling for the 32 bits architecture
; declare the EntryPoint (a label defining the very first instruction of the program)
global start
; declare external functions needed by our program
extern exit ; tell nasm that exit exists even if we won't be defining it
import exit msvcrt.dll ; exit is a function that ends the calling process. It is defined in msvcrt.dll
; msvcrt.dll contains exit, printf and all the other important C-runtime specific functions
; our data is declared here (the variables needed by our program)
segment data use32 class=data
; ...
a db "coaie"
l equ $-$$
b resb l
; our code starts here
segment code use32 class=code
start:
; ...
mov ESI,a
mov EDI,a+2*l-1
mov ECX,l
jecxz end
label:
CLD
lodsb
STD
stosb
loop label
end:
; exit(0)
push dword 0 ; push the parameter for exit onto the stack
call [exit] ; call exit to terminate the program
+29
View File
@@ -0,0 +1,29 @@
bits 32 ; assembling for the 32 bits architecture
; declare the EntryPoint (a label defining the very first instruction of the program)
global start
; declare external functions needed by our program
extern exit ; tell nasm that exit exists even if we won't be defining it
import exit msvcrt.dll ; exit is a function that ends the calling process. It is defined in msvcrt.dll
; msvcrt.dll contains exit, printf and all the other important C-runtime specific functions
; our data is declared here (the variables needed by our program)
segment data use32 class=data
; ...
s1 dw 1,10,32
l1 equ ($-s1)/2
s2 dw 0FF23h,0AF21h,0B25h
l2 equ ($-s2)/2
s resb l1+l2
e db 10
; our code starts here
segment code use32 class=code
start:
; ...
mov ax,256
mov bl,1
div bl
; exit(0)
push dword 0 ; push the parameter for exit onto the stack
call [exit] ; call exit to terminate the program