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
@@ -0,0 +1,35 @@
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 10
b db 12
c db 8
d dw 45
; our code starts here
segment code use32 class=code
start:
; ...
mov al,[a]
add al,[b]
sub al,[c]
mov bl,2
mul bl
add ax,[d]
sub ax,5
mov bx,[d]
mul bx
; exit(0)
push dword 0 ; push the parameter for exit onto the stack
call [exit] ; call exit to terminate the program
@@ -0,0 +1,42 @@
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 10
b db 12
c db 5
d dw 45
; our code starts here
segment code use32 class=code
start:
; ...
mov ax,0
mov al,[a]
add al,[b]
mov bl,2
div bl
mov bl,al
mov ax,0
mov al,[a]
div byte [c]
mov cl,10
sub cl,al
add bl,cl
mov ax,0
mov al,[b]
mov cl,4
div cl
add bl,al
; exit(0)
push dword 0 ; push the parameter for exit onto the stack
call [exit] ; call exit to terminate the program
@@ -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 10
b db 2
c db 16
d db 42
e dw 52
f dw 16
g dw 36
h dw 28
; our code starts here
segment code use32 class=code
start:
; ...
mov al,[a]
sub al,[b]
mov bl,4
mul bl
div byte [c]
; exit(0)
push dword 0 ; push the parameter for exit onto the stack
call [exit] ; call exit to terminate the program
@@ -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 10
b db 25
c db 2
d db 64
e dw 25
f dw 17
g dw 85
h dw 19
; our code starts here
segment code use32 class=code
start:
; ...
mov al,[a]
mul al
mov bx,[e]
add bx,[f]
sub ax,bx
; exit(0)
push dword 0 ; push the parameter for exit onto the stack
call [exit] ; call exit to terminate the program