I met a strange error

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
gfmay
Posts: 3
Joined: Mon Apr 09, 2007 6:27 am

I met a strange error

Post by gfmay »

When I run a simple program, I got a strange error which makes DOS frozen. Here is my code:

Code: Select all

org 0100h

  mov ax,cs
  mov ds,ax
  mov es,ax

  call disp_str
  jmp $

disp_str:
  mov ax,msg
  mov bp,ax
  mov cx,16
  mov ax,01301h
  mov bx,000ch
  mov dl,0
  int 10h
  ret
msg: db 'Hello OS world!'
  times 510-($-$$) db 0
  dw 0xaa55
and I built it as a .com file using Nasm in DOS 6.22. This OS was installed in Virtual PC 2004.
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Post by Tyler »

What strange? You loop infinetly at the end of the program so obviously dos doesnt respond...
gfmay
Posts: 3
Joined: Mon Apr 09, 2007 6:27 am

Post by gfmay »

Thanks Tyler!
And sorry, I forgot that I had commented the instruction "jmp $"
Post Reply