why the string can't display

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
wentong

why the string can't display

Post by wentong »

=========================
why the string can't display
=========================


ORG 0x7c00

BOOTSEG equ    0x07c0
INITSEG equ    0x600

start:
   ;move all the code to 0x6000
   jmp   start1
   nop
   nop
   nop
   nop

start1:

   mov   ax,BOOTSEG
   mov   ds,ax
   mov   ax,INITSEG
   mov   es,ax
   mov   cx,256
cld
   sub   si,si
   sub   di,di
   rep    movsw

   jmp    INITSEG:go
go:
   mov   ax,cs
   mov   ds,ax
   mov   es,ax
   mov   ss,ax
   mov   sp,0x400   ; arbitrary value >>512

   ;read the cursor position
   mov   ah,0x03   ; read cursor pos
   xor   bh,bh
   int   0x10

   ;display the string
   mov   cx,24
   mov   bx,0x0007   ; page 0, attribute 7 (normal)
   mov   bp,msg1
   mov   ax,0x1301   ; write string, move cursor
   int   0x10

   jmp $

msg1:
   db 13,10
   db "Loading system ..."
   db 13,10,13,10

times 510-($-$$) db 0
dw 0xAA55
Tom

Re:why the string can't display

Post by Tom »

I've used code like that...your using bochs right? I've noticed that BOCHS doesn't print even when the code is correct :-\
Post Reply