54 lines
No EOL
1.8 KiB
NASM
54 lines
No EOL
1.8 KiB
NASM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; PlutOS ;
|
|
; Copyright (C) 2024 Patrick_Pluto ;
|
|
; ;
|
|
; This program is free software: you can redistribute it and/or modify ;
|
|
; it under the terms of the GNU General Public License as published by ;
|
|
; the Free Software Foundation, either version 3 of the License, or ;
|
|
; (at your option) any later version. ;
|
|
; ;
|
|
; This program is distributed in the hope that it will be useful, ;
|
|
; but WITHOUT ANY WARRANTY; without even the implied warranty of ;
|
|
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;
|
|
; GNU General Public License for more details. ;
|
|
; ;
|
|
; You should have received a copy of the GNU General Public License ;
|
|
; along with this program. If not, see <https://www.gnu.org/licenses/>.;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; takes one char input and places it at register al
|
|
get_char:
|
|
mov ah, 0x00
|
|
int 0x16
|
|
ret
|
|
|
|
; takes char at al, and prints it
|
|
print_char:
|
|
mov ah, 0x0E
|
|
int 0x10
|
|
ret
|
|
|
|
; prints a null terminated strin in the register si
|
|
print_str:
|
|
lodsb
|
|
cmp al, 0
|
|
je return
|
|
call print_char
|
|
jmp print_str
|
|
|
|
; compares two null terminated strings, in si and di, and sets the zero flag if they are equal.
|
|
compare_str:
|
|
lodsb
|
|
scasb
|
|
jne return
|
|
|
|
cmp al, 0
|
|
je return
|
|
|
|
jmp compare_str
|
|
|
|
; clears the entire screen
|
|
clear_screen:
|
|
mov ax, 0x0003
|
|
int 0x10
|
|
ret |