-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo_macros_impl.nasm
68 lines (60 loc) · 1.04 KB
/
demo_macros_impl.nasm
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
61
62
63
64
65
66
67
68
%macro f_actively_cause_global_warming16 1
push cx
mov cx, %1
call actively_cause_global_warming16
pop cx
%endmacro
%macro f_actively_cause_global_warming32 1
push ecx
mov ecx, %1
call actively_cause_global_warming32
pop ecx
%endmacro
%macro f_puts16_ptr 1
push si
mov si, %1
call puts16
pop si
%endmacro
%macro f_puts16 1
jmp %%skip
%%data:
db %1, `\n\r`, 0
%%skip:
f_puts16_ptr %%data
%endmacro
%macro f_puts32 1
jmp %%skip
%%data:
db %1, 0
%%skip:
push esi
mov esi, %%data
call puts32
pop esi
%endmacro
demopause: equ 130
%macro f_demo_puts16_ptr 1
f_puts16_ptr %1
f_actively_cause_global_warming16 demopause
%endmacro
%macro f_demo_puts16 1
f_puts16 %1
f_actively_cause_global_warming16 demopause
%endmacro
%macro f_demo_puts32 1
f_puts32 %1
f_actively_cause_global_warming32 demopause
%endmacro
%macro f_demo_nl32 0
xor eax, eax
xor ebx, ebx
xor edx, edx
mov ax, [vidmem_addr]
mov bx, 80*2
div bx
mul bx
add ax, 80*2
sub ax, 16*2
mov [vidmem_addr], ax
%endmacro