Click to See Complete Forum and Search --> : programming an OS (Drawing to screen)


answer
November 27th, 2004, 01:19 PM
How may I draw on the screen?

This is what I got


[bits 16]
[ORG 0x7C00]

; sets up video mode to mode 13
mov ax, 0x0013
int 0x10

jmp main
; Just a loop to try and draw anything to screen
main:
mov [eax], bl
inc bl
inc eax
cmp eax, 0x0000A000 + 0xC000
je .reset
.back1
cmp bl, 0xFF
je nebx

jmp main

.reset
mov eax, 0x0000A000
jmp .back1

nebx:
mov bl, 9
jmp main

times 510 - ($-$$) db 0

dw 0xAA55


Thanks in advance!

Andreas Masur
November 27th, 2004, 03:57 PM
[ Moved thread ]

lepricaun
November 28th, 2004, 06:20 AM
http://doorknobsoft.tripod.com/asm_tutorial.html

read that tutorial, it has a few chapters about graphics to the screen. wish i could tell you more, but i'm still reading it at the moment ;)

answer
November 29th, 2004, 08:12 PM
What about 32bits addressing? As I read using 32bits there is no need for haveing a segment or an offset. Lets say we take a segment 0xA000 and offset of 0x0000. If I would address that in 32bits would it be '0xA000 0000'? Doing something similer doesn't work

mov eax, 0xA0000000
mov byte [eax], 0xFF

but what's told on the site works. I don't understand why.