-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint32.asm
More file actions
60 lines (47 loc) · 1.08 KB
/
Copy pathprint32.asm
File metadata and controls
60 lines (47 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Print routines for 32 bit protected mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[bits 32]
VIDEO_MEMORY equ 0xb8000
VIDEO_MEMORY_SIZE equ 0xfa0
WHITE_ON_BLACK equ 0x0f
WHITE_ON_BLUE equ 0x1f
BLUE_ON_GRAY equ 0x0A
COLOR_BLACK equ 0x000000
COLOR_BLUE equ 0x0000AA
COLOR_GREEN equ 0x00AA00
COLOR_CYAN equ 0x00AAAA
COLOR_RED equ 0xAA0000
COLOR_PURPLE equ 0xAA00AA
COLOR_BROWN equ 0xAA5500
COLOR_GRAY equ 0xAAAAAA
COLOR_LT_BLUE equ 0x5555FF
cls:
pusha
mov eax, VIDEO_MEMORY_SIZE-1
mov edx, VIDEO_MEMORY
mov al,0x20 ; Space character
mov ah,WHITE_ON_BLUE
clsloop:
mov [edx],ax
dec ebx
add edx, 2
cmp ebx,0
jne clsloop
popa
ret
print_string_pm:
pusha
mov edx, VIDEO_MEMORY
print_string_pm_loop:
mov al, [ebx]
mov ah, WHITE_ON_BLUE
cmp al, 0
je print_string_pm_done
mov [edx], ax
add ebx, 1
add edx, 2
jmp print_string_pm_loop
print_string_pm_done:
popa
ret