Assembly Woes in Simple Put_char Function......
Posted: Mon Apr 02, 2007 7:57 pm
I'm working on creating a HAL type layer for my OS that communicates directly with the hardware, and creates a base layer for a C based layer above it. However.....My assembly is somewhat failing me at the moment and I have not been able to figure out what's wrong...This is what I've been working with:
I am using fasm...and bochs for testing.
At the moment it doesn't print anything.
Any ideas?
Thanks.
Code: Select all
use32
;This is our main; My boot loader jumps here.
main:
mov al, 'S'
call print_char
mov al, 'W'
call print_char
hang:
jmp hang
;This keeps track of where we are on the screen....
char_place: dd 0xb8000, 0
; Print the char in al
; This takes the char to print in al.
print_char:
push ebx
push edx
; Load the address.
xor ebx, ebx
mov ebx, [char_place]
; Move the data in.
mov byte [ebx], al
inc ebx
mov byte [ebx], 7
inc ebx
; Advance our place
mov dword [char_place], ebx
; Pop!
pop edx
pop ebx
ret
At the moment it doesn't print anything.
Any ideas?
Thanks.