Anyone mind telling me why this doesn't 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
rocko384
Posts: 18
Joined: Mon Aug 30, 2010 12:09 am
Location: Racine, WI
Contact:

Anyone mind telling me why this doesn't work?

Post by rocko384 »

I'm probably being a moron, but I can't get this to boot...

Code: Select all

 [ORG 0x7c00]
 xor ax, ax ; make it zero
 mov ds, ax
 
 loop:
	mov ah, 0Ch
	mov bh, 1
	mov al, 0F4h
	mov cx, 0
	mov dx, 0
	add cx, 1
	add dx, 1
	int 0x10
	jmp loop
 
 
 
 
 times 510-($-$$) db 0
     db 0x55
     db 0xAA
I've been programming for 6 years, and can learn most languages in a day....you really wanna start a fight?
User avatar
linuxfood
Member
Member
Posts: 38
Joined: Wed Dec 31, 2008 12:22 am

Re: Anyone mind telling me why this doesn't work?

Post by linuxfood »

Suggestions:

1. Be more specific about the error.
1a. Tell us what debugging you've done already.
2. Tell us what you're trying to accomplish.
3. Don't just dump (uncommented!) code and ask us to fix it.

That said,
You appear to be trying to write a pixel in graphics mode, however, you never set it up.
That right there is likely your (first) problem pertinent to what I assume you want to do.
Other issues are that you never setup a stack, and that you aren't doing error checking.
Now, according to RBIL, it looks like function int 0x10 0x0C doesn't return any errors so,
you're a bit hosed there, but you could at least do a 0x0D (read pixel) while you're testing to see if you get what you expect.

-B
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: Anyone mind telling me why this doesn't work?

Post by Chandra »

Did you test this code under real hardware or under emulator?

Hope you won't mind mentioning that along with the result you got.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
rocko384
Posts: 18
Joined: Mon Aug 30, 2010 12:09 am
Location: Racine, WI
Contact:

Re: Anyone mind telling me why this doesn't work?

Post by rocko384 »

Sorry...Yeah, I was trying to get pixels to run down the screen, and I was using real hardware. It went straight back to windows, and my test machine had no complaints..
I've been programming for 6 years, and can learn most languages in a day....you really wanna start a fight?
User avatar
rocko384
Posts: 18
Joined: Mon Aug 30, 2010 12:09 am
Location: Racine, WI
Contact:

Re: Anyone mind telling me why this doesn't work?

Post by rocko384 »

@Berkus, I went to boot menu, and selected CD-drive or w/e. 4th option in the BIOS. So, it doesn't like me =/
I've been programming for 6 years, and can learn most languages in a day....you really wanna start a fight?
User avatar
linuxfood
Member
Member
Posts: 38
Joined: Wed Dec 31, 2008 12:22 am

Re: Anyone mind telling me why this doesn't work?

Post by linuxfood »

rocko384 wrote:@Berkus, I went to boot menu, and selected CD-drive or w/e. 4th option in the BIOS. So, it doesn't like me =/
That doesn't seem very specific. [emphasis mine.]

Seriously though, have you tried this in an emulator such as Bochs?
Post Reply