Page 1 of 1

PRINTING WITHOUT BIOS: Does this work????

Posted: Mon Jul 30, 2007 10:18 am
by matias_beretta
org 256

mov ax, 0b800h
mov es, ax
mov di, 0

mov byte [di], 'a'
inc di
mov byte [di], 0x0F
inc di

jmp $

--------------

I wrote this but it doesn't work, maybe because I am running it under windows as a .COM file....

Re: PRINTING WITHOUT BIOS: Does this work????

Posted: Mon Jul 30, 2007 11:22 am
by SpooK
matias_beretta wrote:org 256

mov ax, 0b800h
mov es, ax
mov di, 0

mov byte [di], 'a'
inc di
mov byte [di], 0x0F
inc di

jmp $

--------------

I wrote this but it doesn't work, maybe because I am running it under windows as a .COM file....
Two problems.

1) Unless you are using MOVS/CMPS/etc... you have to explicitly use a segment override prefix. In this case, you assume ES is being used, when in fact you must state "mov byte [es:di], ..."

2) Running any sort of COM files on Windows is discouraged... even Win9x from my experience. For better support, use an emulator like DOSBox.

thanks

Posted: Mon Jul 30, 2007 11:39 am
by matias_beretta
thanks for your help... i will replace di for es:di, and emulate it trough ms virtual pc .

Success

Posted: Mon Jul 30, 2007 11:48 am
by matias_beretta
This is the code that works...

org 256

mov ax, 0b800h
mov es, ax
mov di, 0

mov byte [es:di], 'a' ;CHAR
inc di
mov byte [es:di], 0x0F ;ATTRIBUTE
inc di

jmp $

---

This will write 'A' in white

Thanks...