Page 2 of 2

Re: mode after bare bones

Posted: Fri Mar 20, 2009 2:54 pm
by Troy Martin
mov si,answer
call print_string

answer db "Yes.",0Dh,0Ah,0

Re: mode after bare bones

Posted: Fri Mar 20, 2009 5:55 pm
by ru2aqare
Troy Martin wrote:
Solar wrote:Just a gut feeling that we, as a community, are getting a bit too aggressive and negative.
/agree=completely
I wouldn't want to take out either the -Werror nor the parameters (as both are helpful), but I wouldn't want to bloat the tutorial with parameter-handling code...
It's possible we could "handle" the parameters in a clean and simple way, using just some kind of "if (param1 == param2);" that should count as usage without doing anything. If I'm wrong, it's because I have asmbrain.
Couldn't you use something like this?

Code: Select all

(void)param1;
(void)param2;
I haven't tried it out though.

Re: mode after bare bones

Posted: Sat Mar 21, 2009 12:52 am
by pcmattman
If it's GCC you could define an UNUSED macro (__attribute__((unused)) iirc, but it's been a long while) and put that around the main() parameter names.

That might make things too complicated though, it is a BareBones tutorial :P

Re: mode after bare bones

Posted: Mon Mar 23, 2009 12:18 am
by Solar
...and you'd have to go ahead and explain GCC attributes, and why it's not a good idea to rely on them, bloating the tutorial further.

I added a code comment; better yet would be example code that checks the magic number, and prints something from the multiboot data structure to screen - but I'm in a hurry (as always). Might add it later.

Re: mode after bare bones

Posted: Mon Mar 23, 2009 2:46 am
by Solar
Can't really test it ATM, but now it should compile without problems.