You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

44 regels
1.1 KiB

BITS 16
; Routine for outputting string in 'si' register to screen
print:
;mov bh, 0x00
mov bl, 0x02
mov ah, 0xE ; Specify 'int 0x10' 'teletype output' function
; [AL = Character, BH = Page Number, BL = Colour (in graphics mode)]
.printchar:
lodsb ; Load byte at address SI into AL, and increment SI
cmp al, 0
je .done ; If the character is zero (NUL), stop writing the string
int 0x10 ; Otherwise, print the character via 'int 0x10'
jmp .printchar ; Repeat for the next character
.done:
ret
printCRLF:
mov ah, 0xE
mov al, 13
int 0x10
mov al, 10
int 0x10
ret
printSpace:
mov ax, 0xE20
int 0x10
ret
printALChar:
mov ah, 0xE
mov bl, 0x02 ;color
int 0x10
ret
; Changing the screen the user i looking at.
; value in 'al' is the screen we want to switch to.
; starting from 0x00
os_change_screen:
; Here the addresses for the screens stack
; and base pointer has to be set.
mov ah, 0x05
int 0x10
ret