Start from a main routine: Difference between revisions

no edit summary
No edit summary
Line 1:
{{task}}
 
{{omit from|BBC BASIC}}
 
Some languages (like Gambas and Visual Basic) support two startup modes.   Applications written in these languages start with an open window that waits for events, and it is necessary to do some trickery to cause a main procedure to run instead.   Data driven or event driven languages may also require similar trickery to force a startup procedure to run.
Line 10:
Languages that always run from main() can be omitted from this task.
<br><br>
=={{header|8086 Assembly}}==
Whether a program runs automatically from main or needs to be called depends entirely on the hardware, but in MS-DOS you have to type the name of the program you wish to run.
<code>C:\>prog.exe</code>
 
=={{header|Ada}}==
Line 641 ⟶ 644:
<pre>
Hello from the main function.
</pre>
=={{header|Z80 Assembly}}==
This depends entirely on the hardware. WinAPE (an Amstrad CPC emulator) can run a program by typing <code>call &addr</code> where <code>addr</code> is the operand of the <code>org</code> directive at the beginning of the source document.
 
In your source code:
<lang z80>org &8000</lang>
 
At the Amstrad CPC terminal, type this:
<pre>
call &8000
</pre>
 
Line 657 ⟶ 670:
 
{{omit from|Axe}}
{{omit from|BBC BASIC}}
{{omit from|Bc|Scripts start running from the top}}
{{omit from|Brlcad|Scripts start running from the top in mged}}
1,489

edits