yes, I suppose. (Tomorrow I go to my dealer and ask him for the programming handbook, have only Pulsar). Made a different view to things:
Proposition:
Program Soundcard
main
{
if( WannaBuyANewSoundcard() )
then GoAndGetIt();
else
SayShit();
return 0; //errors since this program makes no mistakes!
}
Here we go: The OS lists main under the name Soundcard in the taskmanager, that is, it knows the starting point as address in the ram, the place where it loaded it. If looks for TRUE and finds an address to jump to for the answer. The address is an offset from the starting point main, found out by the linker of the program.
- Tools: a program is made by a compiler and a linker. The compiler looks that everything is written well and the linker organizes the compiled parts into an executable program.
At this point the linker will say: Ok, can make starting sequence and finish, but 3 parts are missing, more precise 3 BLOCKs.
First BLOCK named WannaBuyANewSoundcard() must give answer TRUE or FALSE so:
BOOL WannaBuyANewSoundcard()
{
ARRAY Cards[6][15]={"Scope, ProTools, Pulsar, Powercore, Digi001, Oasys"};
NUMBER Money = 1000; // $
NUMBER nCards = 6;
NUMBER counter;
// now for each soundcard check, if possible
for( counter = 0; counter < nCards; counter++ )
{
CheckPrice( Cards[counter], Money );
}
}
So, WannaBuyANewSoundcard() needs a helper:
BOOL CheckPrice( Cardname, Money )
{
ARRAY Cards[6][15]={"Scope, ProTools, Pulsar, Powercore, Digi001, Oasys"};
ARRAY Price[6]={7000, 8000, 1200, 1240, 990, 850};
NUMBER nCards = 6;
NUMBER counter;
// now for each soundcard look if it is the one and compare the price
// if price is less return TRUE
for( counter = 0; counter < nCards; counter++ )
{
if( Cards[counter] == Cardname )
{
if( Price[counter] < Money )
then return TRUE;
else return FALSE;
}
}
}
The program is organized by the linker in startcode, DATA-section, instructions. All ARRAY and NUMBER are lined up in the DATA section so Money, counter etc. are in reality only offsets from main. So the information is open for the OS. So Cards can be found:
main+offsetBLOCK2+offset(there) and/or main+offsetBLOCK3+offset(there).
Pulsar can be found main+offsetBLOCK2+offset+15+15 and/or main+offsetBLOCK3+offset+15+15.
Nobody cares about main+offsetBLOCK2+offset(there), let the linker care, but the +15+15 are useful. So when you say Cards[2] you could also say Cards+15+15. OK?
IF-THEN-ELSE is from this point of view a fork containing 2 Adresses to jump to: THEN-Block and ELSE-Block. Adresses are marked with &. ELSE can be NOP (=nothing to do). (So the compiler puts a NOP in the code at the place of the adress of the ELSE-Block where you should have written else, but did not or the linker fills in the demanded offset) The inner logic of IF is then: TRUE->&THEN, FALSE->&ELSE, -> stands for the Processor-Instruction JUMP. OK?
BTW: CW: Hiding Programmer Handbooks is not so intelligent, as you can see from this thread. Can't help him the way I possibly could.

Happy scoping (in this case)
Micha