![]() |
Help with simple program
Okay I'm done with school for a while and I decided to toy with systems programming after a crash course in assembly I decided to try something. The program boots but doesn't execute properly. I've examined my code but I haven't found any problem. So if you could help me I'd really appreciate. It was assembled in NASM.
:
[BITS 16] |
I'll refer you to the following posts I started here where I had similar inquiries and problems and also to a tutorial I posted on another forum:
http://flatassembler.net/ |
Thanks I tried to fix a few things but it's still broke and I have no clue where. Guess this is what I get for diving in headfirst if anyone could take a look I'd appreciate it.
:
[BITS 16] |
Where exactly does the program fail? Does it not accept the enter key at all? I suggest before trying to accept input, trying to output something beforehand. Also, some of your labels and instructions like jmp main and main: are unecessary, as is the jmp terminate with the terminate: label right after.
Also check out this post at the flatassembler page http://board.flatassembler.net/topic.php?t=6088 That program prints Hello World! waits for a key press and when a key is entered it powers down, which I think is sort of what you're trying to achieve. |
:
end:Now suppose you remove the worthless jump. The end and terminate labels now represent the same address. That doesn't consume any code or take any time, but what the hell good is it, except for introducing confusion? I don't care how many trees you kill. Use a pencil and paper to solidify your thoughts. Trace lines from here to there. Disentangle spaghetti. Better to kill a tree than an innocent person when your critical code goes south. |
| All times are GMT -5. The time now is 2:45 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC