PRINTING WITHOUT BIOS: Does this work????

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

PRINTING WITHOUT BIOS: Does this work????

Post 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....
SpooK
Member
Member
Posts: 260
Joined: Sun Jun 18, 2006 7:21 pm

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

Post 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.
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

thanks

Post by matias_beretta »

thanks for your help... i will replace di for es:di, and emulate it trough ms virtual pc .
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

Success

Post 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...
Post Reply