On Sun, 14 Sep 1997, Leigh Morresi wrote:
> Well im getting closer to fully understanding bootable code.
> Ive looked at some examples and they say that the DATA offset has to be
> 7C00h, now my problem is...
>
> mov ah,09
> mov dx,OFFSET string
> int 21h
It's not possible to use DOS calls in boot code.
; Mini OS- Demos a simple boot sector.
;
; Assemble as a COM file, then write to a floppy:
; debug mini.com
; -w 100 0 0 1 ;be careful with this- it destroys DOS loader.
; -q ;Use only 100 0 0 1- read debug docs.
;
cseg segment
assume cs:cseg,ds:cseg
org 0 ;Zero, BIN or COM
Begin:
mov ah,3
xor bh,bh
int 10h ;Get cursor location.
mov ax,1301h
mov bl,7h
mov bp,offset txt + 7C00h
mov cx,0Fh
int 10h ;Display welcome text.
main:
mov ah,0
int 16h
mov bx,7
mov ah,0Eh
int 10h ;Print keypresses to screen.
jmp main
txt db 'Start typing!', 0Dh, 0Ah
org 510
dw 0AA55h ;Some BIOS require this.
cseg ends
end Begin
--- ifmail-tx (i386 Linux)
---------------
* Origin: jvahn@short.circuit.com (1:346/15.1@fidonet)
|