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....
PRINTING WITHOUT BIOS: Does this work????
- matias_beretta
- Member
- Posts: 101
- Joined: Mon Feb 26, 2007 3:39 pm
Re: PRINTING WITHOUT BIOS: Does this work????
Two problems.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....
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.
- matias_beretta
- Member
- Posts: 101
- Joined: Mon Feb 26, 2007 3:39 pm
thanks
thanks for your help... i will replace di for es:di, and emulate it trough ms virtual pc .
- matias_beretta
- Member
- Posts: 101
- Joined: Mon Feb 26, 2007 3:39 pm
Success
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...
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...