Files
low-level-programming/baremetal_gamarjoba.asm
2015-09-18 02:22:39 -07:00

56 lines
964 B
NASM

%include "multiboot_header.asm"
%include "x86_vram.asm"
%define stack_size 0x1000
section .bss
stack resb stack_size ;define stack_size worth of uninitialized space
section .data
print_word db 'Hahaha',0
section .text
extern get_vram_offset
extern c_entry
global write_to_coord
global boot
mov esp, stack + stack_size ;stack is stack-size bytes higher than highest uninitialized memory
xor ebp, ebp ; zero ebp
jmp main
main:
push word BG.CYAN | ' ' ; repeatdly set cell to be black space
call clear
add esp, 2
push dword BG.BLACK | FG.RED | 'A'
push dword 0
push dword 0
call write_to_coord
add esp, 12
mov ecx, 0
.loop:
add ecx, 1
cmp ecx, 5
jne .loop
push dword BG.BLACK | FG.YELLOW | FG.BRIGHT | 'Z'
push dword 0
push dword 24
call write_to_coord
add esp, 12
call c_entry
jmp halt
halt:
hlt
jmp halt
%include "x86_vram_functions.asm"