Home

StormC 3 user manual english

image

Contents

1. If the program makes serious errors which is always possible in C or C the computer may crash because the CPU has so called exceptions i e special soft or hardware states These are treated only very generally by the OS and often don t allow you to work on in a reasonable manner without rebooting the system Rebooting the Amiga is the only solution in most cases when the program is running into and endless loop After an exception or when the program is stopped by exit or abort most of the system resource are still reserved While still reserved memory is only annoying open files or windows may hinder the further work very much or even lead to crash of the OS The problems mentioned here cannot be traced back to their origin in the source code GENERAL INFORMATION ON RUNSHELL 0 151 The Storm Maxim 000 0 ceeeectenetenetstetetenetenststsesesterstseseeteneeees A Resource Tracking Example Freeze the program temporarily 000 000 0000 eeseesteteeereteteteteneeees 153 Halting the program 000 000 cescsssesesesteeessesesestsnetstssenstenensseneeenens 154 Changing the task priority 000 000 0000 eeceseceeeenetetetetetetseeeeenens 154 Sending signals 0ssciccsisssseossecsssscsssccssdeaseseseseoasssesstenesavcssttnscescrsnsndtetstonse 154 USING THE DEBUGGER The Variable Window Temporary Casts i isccccccccsceicctsecssccssssacusecsenceseavescovessecussscsscccusesscesesesestaves
2. The hex editor The hex editor shows an area of memory in hexadecimal and as ASCII characters The display can be byte word or long word based ico a 87 87 a 87 87 87 a 87 87 87 87 oe eo 87 87 87 DDDDDDDDDDDDDDDDD QWWOWWWUWWWWWWWWWWW loolololol WWWWNNNNNNNNNNNAN QN ADAMSADDOO HUA AHADAAAAAAAAAAAAA VOADADSOSOSSOSS O SOWOVMOIOVOVVOV VOADAOTNMNOSVOONDOO BO DADOUSOONDOGAW WOADADWNSOT ONNADA SOVONMNUSTOMMOn05 DAASAOOIMOMA N0WD DOVOSOONON DMONALS meee hoeoeeorss e00 OODODUNDONONNNNAN DUSSADSDOOVOSOVDIMo SOOOTAsOsUeS I OWUS DUSSASVASSSONTODUD SOS CAONSOMMMVNGIM DO VohossosogoAmMoowm SOADAVODOANDDOWND ee a a SOON JOOSVVONV MN OWODSAVISISDHOVWODO SOOOONSOSOwWooManeh DNWOOUISGSJTSGOSDAD BOD ONAGSONMOVO ONWH LJVOSHAHDHOOD SOA AON GANSODAW ATNAODOTODOOTOOOOOOOOO NOONNONNNNNSYN SSN AAADDODOVODVDVYOD TMODAADWWADOWWVWODDW PAADOANNVTNSANDOOSD AOAS2NNUMASONOTIN UDUSSDNUMMUDO MIO WOSWWAMRONASM Choosing the display This pop up allows you to choose how to display the hexadecimal values Byte word and long word can be selected The address string gadget This string gadget shows the current address under the cursor or allows you to set a new address The address column In this column the address of the first byte of each line will be shown These addresses can be changed directly as well no need to switch to the address string gadget The hexadecimal column This column
3. 84 StormC the professional choice Hunk Optimisations and Memory Settings Hunk Optimisations and Memory Settings Linker Linker 1 Linker 2 w7 Link Wizard File To Program Symbolname E MizardSurface J Link One Single Hunk Link One Code Hunk Size Of Code Hunks fsa kByte Link One Data Hunk Size Of Data Hunks po kByte Link One BSS Hunk Size Of BSS Hunks po kByte Residentable Program RI Custom Standard Standard Standard Code Cl Data G Bss Q w7 Generate ROM Code Code Startaddress p Data p B55 p Write Reloctable for Data To Data Summarise Hunk StormLink will only create one CODE hunk which contains all code data and BSS sections This is an interesting thing for game programers A reloc routine has to work on one hunk only When the program is in SmallData model you can write completely PC relatve programs in a high level language The base register for data access normally A4 will be initilised with lea _LinkerDB PC a4 All other accesses are made with d16 pc or d16 a4 and the program will not contain any absolute addresses Such programs can be loaded very fast and are re entrant in most cases In conjunction with Create ROM Code you will get a program that can be loaded to any even address by Read file buffer len and is immediately usable there One condition is that the program does not use abs
4. Please open the project settings once again by selecting the menu item Settings Program Start Workbench Screen cat a Stormo o Project StormC Hello World Helio World AS sly Yo a Yo Program compiled E Dle eaa we x Make project F8 a _StormC Helio World Hello World sf mje Fie Code Text Z 268 131 g Hello World 11032 7 storm lib 336936 amiga lib 203436 Az a v sss sra Bun Debug n Work StormC Hello World Hello World cpp c E tjs fi ofr x fi lv B Programtart p Progam cu include lt iostrean h gt Commandname S void main Ea lll mn cout lt lt lt lt endl E Console 7 ArtEffect 42 StormC the professional choise Console output In the second page of the window you can choose settings regarding the in and output Please enter the following line in the Console text field CON 320 200 Hello World CLOSE AUTO WAIT Double clicking the program s Please restart the program by double clicking the program s name in the name in the project project is sufficient to re run Workbench Screen the program o Storme k 3 Olele DE se z ARA StormCPP StormWizard StormC Hello World Hello World m Storm Console Ime Fie Code Text
5. a Creates an assembler source for each translated text file as C source is inserted as commentary into assembler source a0 No assembler output default b Create small debug information file bf Create large debug information file b0 Without debug information file default bs Create symbol hunk for symbolic debugger bs0 No symbol hunk default C Compile sources and creates the corresponding Lo files d NAME Defines a pre processor symbol Optionally a and the desired value only a token can be set directly behind the name Otherwise the symbol is defined as empty eB Error messages written in bold eb Error messages written normally default ecN Output source in colour number N at error messages ef xxx Write error messages to file xxx Summary StormC User Manual 145 6 COMPILER 146 L 0 XXX O 00 01 02 03 04 05 06 pc PP px StormC the professional choice Ask the user whether he wants to abort at each error message during compilation default Output error messages without user inter action After N errors compilation is aborted default is 10 Like e but with source output in addition Treat warnings like errors Output warnings but ignore them default Data model Near Data a4 Same as gd Data model Near Data a6 Data model Far Data default Code model Near Code Code model Far Code default All
6. 2 StormC the professional choice Licensee agreement LICENSEE AGREEMENT 1 In general 1 2 Object of this contract is the use of computer programs from the HAAGE amp PART NER COMPUTER GmbH including the manual as well as other pertinent written material subsequently summed up as the product The HAAGE amp PARTNER COMPUTER GmbH and or the licensee indicated in the product are owners of all rights of the products and the trademarks 2 Right of usufruct 1 The buyer does receive a non transferable non exclusive right to use the acquired product on a single computer 2 In addition the user may produce one copy for security only 3 The buyer is not allowed to expel the acquired product to rent to offer sub licen ses or in any other ways to put it at the disposal of other persons 4 It is forbidden to change the product to modify or to re assemble it This prohibi tion includes translating changing re engineering and re use of parts 3 Warranty 1 The HAAGE amp PARTNER COMPUTER GmbH guarantees that up to the point in time of delivery the data carriers are physically free of material and manufactu ring defects and the product can be used as described in the documentation 2 Defects of the delivered product are removed by the supplier within a warranty period of six months from delivery This happens through free replacement or in the form of an update at the discretion of the supplier 3 The
7. editor Displays the source in the editor R Deletes all entries of the history This should be done before watching a critical situation This sets the maximum number of entries in the history The Entries value must be between 10 and 256 The breakpoint window All set breakpoints are displayed in this window The window can also be opened by the time Breakpoints in the Windows menu main c line 5 address c line 119 address c line 124 A double click will display the breakpoint sin the editor Displays the breakpoints in the editor Toggles breakpoints on or off Deletes a breakpoint Deletes all breakpoints ot eb Normally all breakpoints are displayed in order they were Sorting set The sorting can be switched to alphabetical where the first criterion is the module name and the second is the line number of the breakpoint Pay attention on breakpoints that are in program parts that are used by different tasks simultaneous e g a dispatcher of a BOOPSI gadget Such a dispatcher is used by the program and by the task input devide if the gadget is part of an StormC User Manual 179 ys 7 THE DEBUGGER Address Hunk Offset Search Cancel open window A breakpoint in the dispatcher could lead to an exception in the input device and so cause a system crash The address requester In the Debugger menu you can open an address requester using Find address This shows the
8. Now you should be on line 30 and the variable address should have a sensible value You can check this now select the variable in the current variables window and select the button I to examine it The elements of the struct Address will replace the variable list StormC the professional choice Sorting of Variables You can change the entered strings even now Select e g the field name and change the contents in the string gadget of value In this case you should only enter a string not longer than the old one because the program has only reserved this space in the dynamic memory by malloc Continue bug hunting and try a couple more things for example watching variables and structure fields When you feel comfortable with the debugger end the program either correctly or with Kill StormC User Manual 163 7 THE DEBUGGER 164 THE PROFILER A profiler is an indispensable tool when optimizing a program Compiler optimizations can only improve program performance by so much whereas a profiler can provide the necessary information for identifying the most time intensive functions in a program These functions can then be rewritten to use better algorithms if possible or at least sped up by carefully optimizing the source code by hand The StormC profiler is especially powerful it allows precise timing and provides many valuable statistics about the program As always we have stuck with the our
9. Paste inserts the contents of the clipboard at the current position of the cursor into the text For example e Please load a large text file into the editor window e Move the cursor to the middle of the first line of the text and choose menu item Edit Mark e Move the cursor down a few lines You will see an inverted area of your text e Choose menu item Edit Cut and the marked block will disappear The rest of your text will be moved to fill the free area To restore the old text you must paste the clipped block from the clipboard to your text But remember that you should Block Operations StormC User Manual 101 5 STORMED not move the cursor because it marks the position for the insertion of the block So if you move it the block will be inserted in a different place e Now choose menu item Edit Paste The block will be inserted from the clipboard and your text will return The cursor will be at the end of the block To insert the block at a different place within your text move the cursor to the desired position and choose Edit Paste again When you want to copy a certain block of your text just mark it and choose Edit Copy The text is not affected but it is copied to the clipboard The Mouse Using the mouse you can move the cursor to any position of the text Just move it to the right place and hit the left button of the mouse As long as you hold the left button down the cursor will fol
10. Ole peaa se al Open new project window Fa StS Semy a _StormC Helio World Hello World f me Fe Code Tert z 0 z Hello World zZ storm lib 336936 amiga lils 203436 Al x Basessa lt gt lt 7 1B Work StormC Hello World Hello World a E t sfrofrif x fi v fio Lk 10 inklude lt iostream h gt void main cout lt lt lt lt endl ArtEffect Please enter the following lines Hello World Example program belonging to the introductionary tutorial inklude lt iostream h gt void main cout lt lt Hello World lt lt endl Save this text by clicking on the Save text icon in the tool bar Jema sel Show end of line Show tabs Show spaces Autoindent Overwrite Lock editor Show textchanges Line Column o Work StormC Hello World Hello World petri rn ie inklude lt iostream h gt void main cout lt lt lt lt endl RD se x StormC User Manual 39 3 FIRST STEPS Adjusting settings Before we compile the program please make sure that the compiler s settings are correct Please choose the entry Compiler out of the Settings menu The window found in the illustration below will appear If you open it for the first time your window will look slightly different than shown below Because the project settings could not be placed in a single window we have divided and separated them onto different
11. a TE Font Colors Olla Olea jee I o unnamed Openat Ef r s MN ofai gt sanr els courier u Shell GFX 13 GoldED 15 IBM 18 Ti topaz Al 24 A eI Custom Font XEN Font feourerfont yf Jeourier fis Size i3 f AaBbCcDdEeFfGgHhIiJjKkLIMMNNOOPpAgRISS 4 o Cancel Termi Use Cancel A A Ea al I lt ArtEffect A detailed description of the use of the ASL font requester can be found in your AmigaDOS user manual 54 StormC the professional choice Creation of a new project ORGANISATION OF A PROJECT Each program you create with StormC should be defined as a project All projects contain at least the source all pertinent header files the name of the program to be created and the options for the compiler linker and debugger Moreover you can add ARexx and Installer scripts documentation as ASCII or AmigaGuide files and other program related files to your project Creation of a new project To create a new empty project you have to click on the icon New Project in the Toolbar When the Toolbar is activated you can select the menu item New from Project as well The default settings for a new project will be loaded from the file template q which can be found in PROGDIR which is the drawer StormC was started from If you have not changed the installation which you should not do it is the drawer StormC StormSYs The template of the project contains
12. blocks are optimised A basic block is a sequence of intermediate code instructions which contain no jumps Successive blocks are summed up which makes work easier for later optimisation steps Unused blocks are removed completely The step is repeated until nothing more is to be improved on this level Also after higher optimisation steps 138 StormC the professional choice it is tried to sum up basic blocks and to remove unused blocks Useless instructions like e g assignments at variables which are never used again will be removed Variable and interim results are packed into processor registers Assignments at variables will be eliminated if the variable is never used again If a complete instruction can be eliminated that way the whole intermediate code will be optimised again until no superfluous assignment is found any more Example In this complete useless function void f int i int j itl int k 2 j only the second instruction will be recognised as useless at lower optimisation levels From level 4 on the code is perused subsequently once more and then the first instruction will be eliminated too At the M680x0 code generation MOVE commands to destination register which are used subsequently only once before they receive a new value are pushed together if possible So move 1 8 a0 d2 add 1 d2 _xyz becomes thereby add 1 8 a0 _xyz At the interpretation of expressions the interim results
13. establish an ARexx message channel to a port called STORMSHELL Parameters StormLink supports the following command line options Selects the output file name TO filename StormLink does not check if a file of the same name already exists if it does it will be overwritten without asking If more than one output file has been selected the last one will be used MAP This option causes StormLink to create a file called a linker map containing all symbols in the created program and their place within the executable Here is an extract from such a linker map _cout 24 in hunk 1 lt stormc 1l1ib storm 1ib gt _std_out 32 in hunk 1 lt stormc 1lib storm 1lib gt _std__in 16 in hunk 1 lt stormc 1ib storm 1ib gt _cin 8 in hunk 1 lt stormc 1ib storm 1ib gt _clog 40 in hunk 1 lt stormc 1ib storm 1ib gt _std__err 4E in hunk 1 lt stormc 1ib storm 1ib gt _cerr 40 in hunk 1 lt stormc 1lib storm 1lib gt TO Usage Description MAP Usage Description am AAR AR ARORA Far Far Far Far Far Far Far Usage Public Public Public Public Public Public Public StormC User Manual vooroor 189 8 THE LINKER LIB Usage Description LIBPATH Usage Description CHIP Usage Description FAST Usage Description CAUTION The first entry in every line contains the name of a symbol followed by its offset in hexadecimal notation and the number of the hunk i
14. intuition library 37 EXIT_3_SchliesseBibliotheken void CloseLibrary intuition base CloseLibrary DOSBase Beside these standard functions a shared library still requires certain tables and data structures which initialise the shared library at start These are situated at the startup code library startup o which is used at linker as shared library automatically This startup code uses some symbols which are created by the linker automatically Among other things a symbol on the beginning of the function table and one symbol on the name of the library and the version string of the library The two last symbols can overwritten They are called _LibNameString and _LibVersionString Important hints to Shared libraries Here a couple of hints for the development of your own shared libraries First develop you functions completely normal and write a test program for them If everything functions to your satisfaction transform the project to a shared library by removing the test program from the project and write a suitable basis structure Of course some project settings must be changed too 128 StormC the professional choice The Setup of a Shared Library You have won two advantages by this way Shared libraries must be removed from memory before you can exchange them by a newer version Therefore you must care that your test program has closed the shared library and that the old library is removed
15. lt Return gt the cursor will jump to the new position if you have chosen an existing line number Open Load Text You will probably have wondered about the difference between opening and loading text The menu item Load is only available when an editor window is active The text will be loaded into this editor window If you Open text this will open a new editor window Tooltypes All attributes of texts like text colour tab size bracket indent and the size of windows are stored in the tool types of the respective icon of this particular kind of text They will be applied when opening and loading At loading the size of the window will not be recognised Save Text Save Text As If you create new text it will be named unnamed This appears in the title bar of the editor window If you made any input to this text Save and Save As will have the same effect The ASL filerequester will be used for selection of a filename Unfortunately you cannot double click to make this selection because ASL does not support this If you stored the text once it will be overwritten every time you choose Save The tool type window size text attributes will be adjusted as well Free Text To remove the text in your active editor window you can dispose of it s contents Choose the menu item Project Clear This item is only available if there is an active editor window The text will be disposed of but the window w
16. pragma amicall GadToolsBase Oxle CreateGadgetA d0 a0 al1 a2 pragma tagcall GadToolsBase Oxle CreateGadget d0 a0 al1 a2 You find the corresponding prototype in the drawer CLIB They contain the following struct Gadget CreateGadgetA unsigned long kind struct Gadget gad struct NewGadget ng struct TagItem taglist struct Gadget CreateGadget unsigned long kind struct Gadget gad struct NewGadget ng Day tagl With the call gad CreateGadget CYCLE_KIND gad ng GTCY_Labels mlabel GTCY_Active 3 TAG DONE you would so to speak inline create a Stub function which pushes all Tags on the stack but in reality calls the function CreateGadgetA For compatibility reasons the most pragma calls of the SAS compiler can be used too The pragma priority StormC supports as a C compiler the automatic call of initialisation and exit functions before and after call of main function C uses this feature to call the constructors and destructors of global variables ANSI C uses this feature for the automatic opening of shared libraries or for the initialisation of standard I O The function table which is processed thereby is created first through the linker Functions which own a certain name will be gathered by the linker to a table of 112 StormC the professional choice The pragma priority initialisation and exit functions The startup code must call the function
17. that is the name of the library here exec for the library exec library with appended _protos h These prototypes define C functions which are always called by the compiler in the way that it puts the parameters of the function on the stack and makes a subroutine call at the matching function This function must always be linked to the program Therefore it is not allowed to call the shared library directly because shared libraries are not linked permanently to the program but are opened at the start of StormC User Manual 117 6 COMPILER To get a good H comparability o with SAS C and other compilers there exists a drawer named StormC include pragmas It contains files which have different file names than these of StormC Include pragma the program Besides functions of shared libraries always expect their parameters in CPU registers and not on the stack This problem can be solved on two ways Either you use Stub functions or the special Amiga like pragma amicall Stub Functions The linker library amiga 1ib contains a so called Stub function for every function of the OS libraries The stub function takes the parameters from the stack loads them into the right CPU registers and then calls the right function of the shared library This method has the disadvantage of an additional function call which swells your program and decreases the execution speed strongly pragma amicall Alternativ
18. will start that program 60 StormC the professional choice If you hold the lt ALT gt key while double clicking such an entry you will start the program in debug mode Open a Child Project Of course there can be projects within projects so it is easy to administrate the source for shared library development or multiple program projects as well With a simple double click on such an item in the project manager you can open the project Keyboard control You have certainly recognised that the section title and the items will stay selected inverted after selection This is an indicator for keyboard control Cursor keys With the keys lt UP gt and lt DOWN gt you can move the inverted beam up or down If there is a horizontal slider at the bottom of the project manager window you can move it with the keys lt LEFT gt and lt RIGHT gt Return The lt Return gt key has the same action as a double click with your mouse If the inverted beam is at a section title and you hit lt Return gt the section will be folded unfolded When the inverted beam is over a document a source file or anything that could be edited in an editor it will be opened there if you hit lt Return gt Deleting Items of a Project unnamed Remove section Libraries and all contained files from the project Delete If you want to delete a whole section of your project you must select the title of it A requester will appear to
19. 107 storm lib 113 127 187 StormLink 185 STORMPRAGMAS 73 118 Stub Functions 118 Support 8 T Technical support 7 Textoptions 95 Thanks 6 Tooltypes 47 94 GOLDED 48 HOTHELP 48 PUBSCREEN 48 QUIET 48 SAVEMEM 48 StormC User Manual 213 INDEX W Warnings 80 wbmain_PO9WBStartup 187 WWW 8 214 StormC the professional choice
20. 32 Bit Reloc Optimise NearCode Model This sets the global constant __VERSION to the value of the string gadget This sets the global constant __REVISION to the value of the string gadget Library Path If StormLink can not find a symbol it prints the message ERROR 25 Before that is a text which shows which file it has to load to find the symbol The logfile which is loaded with this option contains information about object files and the there defined symbols It has the following setup lt filename gt lt This is an object file lt symbol gt lt symbol gt If Load Logfile is active the name of the logfile can be entered into the string gadget Warnings When the program contains 32 Bit Reloc StormLink outputs a warning This option is good for writing position independent programs Optimiser When this option is set StormLink runs an optimisation pass If it detects a 32 Bit Reference which points to the same hunk StormLink tries to change it into a PC relative so the reloc entry will be freed which saves 4 Bytes This method may lead to incorrect programs The optimiser only has a small disassembler which only knows the commands JSR PEA and LEA It has no idea of how to distinguish between code and data in code hunks The optimiser will be called for global references only when building references between object modules For reloc entries an assembler or a compiler should do these optimisations
21. Comments C Comments String Constants Character Constants Number Constants This includes all ANSI C and C standard functions AmigaOS Types Amiga Types dic In this dictionary you will find the Amiga specific types like ULONG STRPTR AmigaOS Functions Amiga Functions dic This dictionary contains a list of all names of AmigaOS functions The following tree entries are for user defined dictionaries They do not contain any settings The files are named User 1 dic User 2 dic and User 3 dic If you activate the functions here the words of the texts in the editor will be marked in various colours according to the colour definitions of the dictionaries Syntax On the right side of the settings page there are controls for further colouring of the editor A comment in C begins with and ends with Comments might be longer than one row but the must not contain further comments As soon as you type the following text will be coloured This will end when you enter We C comments are finite to one row It will be marked with There is no marker for the end of such a comment The marking of a string constant will start with a character you enter with lt Shift gt lt 2 gt It will be ended with the same character Character constants will be marked with a single lt Shift gt lt A gt All numbers that are not contained within quotation marks or semi colon will
22. Debug Files Create Symbol Hunks ASM source without C source ASM Source With C Source Extra Hunk For Every Function Debugger If you choose to create a debug file the compiler will generate a file for each translation unit from which the debugger could take the needed information There are two possibilities Small Debug Files and Fat Debug Files Small debug files contains only a few pieces of data about variables They are stored in the debug files of every module There is no information about include files which are in angle brackets within a debug file These files contain all data types structs and class members The debug files of every module are accordingly big Instead of the StormC source level debugger you can use a symbolic debugger like MetaScope as well To get some important information you should create the so called symbol hunks If you selected this option the compiler will generate an assembler listing for every file it has compiled successfully The assembler source will be stored in a file with the same name as the C source but the ending s If you are familiar with other compilers you might wonder about the obviously well optimised assembler code To clarify this The compiler generates intermediate code in an internal binary format that looks like assembler source in some way but that has nothing to do with an ASCII file The assembler will translate this intermediate code to rea
23. Format of the error output StormC can output error messages in three different kinds e el and ei interactive in short or long format The pre set is interactive error output for which also the option ei can be used Thereby for each error message a short source section approx 5 lines the source position and a prompt Go on with lt return gt abort with lt A gt is shown The exact error position is emphasised in the source section colourfully After pressing lt Return gt or alternatively lt Space gt or lt C gt the translation is continued At input of lt A gt or alternatively lt ESC gt or lt Ctrl gt lt C gt the translation is aborted StormC User Manual 141 6 COMPILER eb eB and ec The compiler option e switches on short output Here only two lines the source position and a short message are outputted at each error and each warning After ten errors the translation process is aborted anyway You can choose another value for that number if you append it just after the option i e e20 The long format is a mixture from interactive mode and the short one Thereby sources and error message are outputted like at ei but it does not wait for an input After a maximum of ten errors the compiler aborts the action For this form of the error output you choose the option e1 As on the option e you can choose the abortion level by adding a number E g el5 would be a meaningful setting
24. Functions Each function call represents a considerable expense First the calling code must arrange some space for the arguments on the stack and store them there Then a JSR jump follows into the function which has to reserve the necessary memory for their own data on the stack before And it has to store the contents of all processor registers which are changed by it At the end of the function the old register contents are restored again The local variables are removed from the stack a RTS jump back to the calling program is following At least the arguments must be taken from the stack There you as programmers might get into moral conflicts Should you define a small function now or insert 108 StormC the professional choice Inline Functions the content of this function every time into the program A typical example is the maximum function int max int a int b if a gt b return a else return b Instead of the function call max x y you could as an alternative insert x gt y x y each time This would be of course more quicker but not more readable For such cases C has a nice feature that StormC now offers in ANSI C mode as well Inline specification If you set the key word inline in ANSI C __inline before the first declaration of a function this function definition will be inserted into the source at each time this function is called Syntactically or semantically the program is n
25. HAAGE amp PARTNER COMPUTER GmbH does not guarantee that the product is suitable for the task anticipated by the customer The HAAGE amp PARTNER COMPUTER GmbH does not take any responsibility for any damage that may be caused 4 The user is aware that under the present state of technology it is not possible to manufacture faultless software 4 Other 1 In this contract all rights and responsibilities of the contracting parties are regula ted Other agreements do not exist Changes are only accepted in written form and in reference to this contract and have to be signed by both parties 2 The jurisdiction for all quarrels over this contract is the court responsible at the seat of HAAGE amp PARTNER COMPUTER GmbH 3 If any single clause of these conditions should be at odds with the law or lose its lawfulness through a later circumstance or should a gap in these conditions appear the unaffected terms will remain in effect In lieu of an ineffective term of the contract or for the completion of the gap an appropriate agreement should be formulated which best approximates within the bounds of the law the one that the contracting parties had in mind as they agreed on this contract StormC User Manual 3 PREFACE 4 Any violation of this licence agreement or of copyright and trademark rights will be prosecuted under civil law 5 The installation of the software constitutes an agreement with these license condi tions 6 I
26. InitModules before the call of main function and to call CleanupModules after main function The advantage of this dynamic concept is the flexible setup of the startup code The resulting program is always as small as possible The thereby available startup code is applicable for all programming projects The large scale and error susceptible selection of a startup code according to compiler options is not necessary any more Constructors and Destructors in ANSI C Functions that are called at initialisation must be named INIT_n_anything void the exit function must be called EXIT_n_anything void For n is a number between 0 and 9 This sets the priority of the function The smaller the value the earlier the initialisation and the later the exit function will be called Anything can be replaced through each arbitrary name which may contain further Constructors and Destructors in C A C compiler creates automatically such fitting functions for each global variable In these functions the construction and destruction of variables will take place Generally the compiler uses the priority 8 for these INIT_ and EXIT_ functions However the exact sequence of the calls that means the priority of the INIT_ and EXIT_ functions may be of importance so there exists that pragma priority You can determine the priority of the global variable of the module Priority list Thereby you should orient your
27. Or AllocMem but can give you a great deal more confidence in the correctness of the program The long symbol names in C provide additional security while linking If a function definition is in any way inconsistent with its prototype declaration the linker will abort with reports of an undefined symbol Switching to C will also give you the possibility to extend your program with modern object oriented concepts as well 130 StormC the professional choice as the use of several smaller C features such as the ability to declare variables anywhere in a statement block Syntax Some SAS C keywords are not recognized by StormC others are supported well but the more picky StormC compiler only allows them in the typical ANSI C syntax StormC does accept anonymous unions but not implicit structs Equivalent structures are not considered identical If you have made use of this feature you will need to insert casts in some places If this feature is important to you you may want to consider moving your project over to C Equivalent structs are nothing but an aspect of inheritance in a different guise Type matching is much more strict in StormC This is especially the case for the const qualifier used on function parameters An example typedef int ftype const int int f int ftype p f Error For such errors you should either insert the necessary casts or and this is always preferable write t
28. StormC that the automatic constructors or initialisation functions are called which will e g open other required libraries That works equal to normal programs so you must not care for the correct initialisation For C programmer the constructors of the global variable are called too 126 StormC the professional choice The Setup of a Shared Library The function LibOpen is called at each opening and it does nothing than to record just this fact It increases a counter which indicates how often the library was opened The function LibClose is called when closing the library and it decreases the counter The function LibExpunge is always called when the operating system wants to remove the library from memory That happens for example at memory shortage The library can be removed only if it was not just opened by a program The counter must stand on 0 so you will note how important it is to close used libraries A task of the function LibExpunge is to call the automatic destructors or exit functions Thereby e g the automatically opened libraries will be closed again At use of C the destructors of the global variables will be called The function LibNul1 does nothing at all and it is reserved for future extensions These five functions are in the linker library storm 1ib You can overwrite them at any time with your own functions Probably you will have to use an assembler for this A meaningful a
29. StormC PPC Professional Version dse Jee l A Save activated text F3 GIGA2 StormC Examples DebugTutorial DebugTut 9 le ext StormWiZARD J File Cod v main c 868 837 address c 2 232 2 768 Vv address h 743 ia address 14 764 storm lib 261 552 amiga lib 203 436 RY lt j gt Start the program normally and get familiar with it First a menu with three items will appear e enter an address e show all stored addresses and e end of program If you wish to enter a new address enter 1 don t forget lt Return gt Then enter a person s last name first name street and place of residence Repeat this two or three times and have a look at the result by choosing menu item 2 Then end the program Because normally you only debug your own programs you should now have a look at the source to get familiar with the function names The main program is in main c It shows the main menu and evaluates the menu input Depending on the input functions from address c will be called Sending signals StormC User Manual 157 ys 7 THE DEBUGGER A breakpoint SS buttonis there for every position in the source where the program can be stopped breakpoints are the positions in the program where execution will stop when it was started with Go and runs at full CPU speed First up in the address c module are some
30. The use of exit is preferred This is where the exec 1library base pointer is stored It contains the same value found at the absolute address 4 but is used to reduce the number of accesses to that memory area Startup Code _exit abort__ STANDARD _SysBase StormC User Manual 187 8 THE LINKER Should you plan to write your own startup code please take care to define these symbols if you want to use the storm lib link library The compiler itself expects certain functions in this library for example those that perform 64 bit integer arithmetic to be defined so you need to link with storm lib if you intend to use that However these functions do not depend on any of the above mentioned symbols The small data model versions will additionally copy the program s static data area to dynamic memory if the program is linked with the options Residentable Program and Write Reloc table For Data To Data enabled This will make the program residentable and usually re entrant so that it can be loaded into memory with the resident CLI command and run several times concurrently In addition to the possibility of defining your own startup code you may also opt to use no startup code at all If you choose to do this you should include as a first source file in the project a small file containing only a minimal function that simply calls the real entry point of the program Example void pre_main in
31. These accesses also have the speed and size advantage over 32 bit absolute addressing Should the Near Code hunk grow larger than 32 Kb StormLink constructs jump chains across single hunks to allow calls to span distances larger than 32 kilobytes Please take due care when using global data contained in the CODE section the linker has no way of telling such data apart from program code It may insert intermediate jumps where a data access was required which could lead to bugs that are extremely hard to find StormC User Manual 209 8 THE LINKER 210 StormC the professional choice Symbols base 125 bias 125 end 126 private 126 public 126 define 72 pragma header 71 114 __COMPMODE__ 115 __cplusplus 115 __DATE_ 115 _ FILE_ 115 _ FUNC _ 116 __inline 109 __LINE_ 116 __STDC__ 116 __ STORM _ 116 __TIME_ 116 _LibNameString 128 _LibVersionString 128 _stub 204 _wbmain 187 A amiga lib 118 156 Authors 2 auto 107 AutoSave 52 C CleanupModules 113 186 Compiler CLI version 130 Options 134 Special features 107 Compiler Options ANSI C or C 137 Assembler source 136 Code model 138 Colours and styles 142 Core memories 144 Index Data model 138 Definition of symbols 136 Error file 142 Exception handling 137 Include files 137 Linker libraries 141 Optimisations 138 Optional warnings 143 Pre compiled header files 144 RunShell 141 Special processors 140 Summary 14
32. a6 stack DO to D7 AO to A6 EPO to Ep7 Current variable window The variable window shows all variables and inspected variables It can be opened at any time by the item Variables in the Windows menu o Variables safia E er El laj Cast Address 7 Sort C Unsorted address lt Address AO gt Ox079597 18 gt 0x0 1E229E 1 NULL ox s lt BYTE 80 stack gt 49 0 7 120 17 24 0 8 28 96 illegal lt LONG D2 gt 0 0x00000000 Every variable is displayed with its name type memory class and value e g counter lt LONG stack gt 42 The type is always displayed in the Amiga typical manner LONG instead of long int and UBYTE instead of unsigned char The memory class rough marks the place where the variable is stored The good optimisation of the compiler will often put variables to the same register or to temporary unable registers So you should not wonde3r when a variable with the memory class DO will always change its value This register is used very often List of memory classes A global variable in the far data model A global variable in the small data model with a4 A global variable in the small data model with a6 A local variable or a function parameter on the stack A variable in the relevant data address or FPU register 174 StormC the professional choice Current variable window The values of these variables ar
33. and EXIT_ functions you should be aware that a call of the function exit from an INIT_ function will call all ExrT_ functions There is no allocation between INIT_ and EXIT_ functions this means that there is no INIT_ function that belongs to a certain ExIT_ function with the same name That applies for each global variable in C also That means that a destructor must work well even if the matching constructor was not processed You can exploit thereby that the memory of the variable is initialised always with 0 if you have not changed initialisation Now you can decide simply whether the constructor of the destructor was processed already or not Particularly in C you should avoid that constructors of global variables do an exception because they can not be enclosed with a Try block Therefore this exception is always treated as unexpected exception which leads to a hard interrupt of the program and the user will not know why the program does not work Use of Shared libraries The AmigaOS is essentially built of several shared libraries These divided libraries offer functions which can be called by each program after opening them To each shared library of the AmigaOS there are some C headers which allow the use of the library Prototypes First there is the file with the prototypes of the functions You will find them in the directory StormC include clib The files are named like exec_protos h
34. and Destructors C cases are set to this priority by default Each global variable whose type has a Constructor or a Destructor creates a call of an INIT_ or EXIT_ function The priority can be changed by pragma priority The functions which were announced with atexit are called Joining Lines It is absolutely alike in C and C where individual lines end But the pre processor must get each instruction exactly in one line Naturally there will be the case that a line becomes very long e g through an extensive macro definition For this case there is the backslash If the is a at the end of a line this is joined with the following one For example define SOMETHING 47081115 114 StormC the professional choice Predefined symbols This is a valid macro definition for 47081115 is pulled here in the preceding line Predefined symbols The pre processor has many predefined macros Some of them are ANSI C standard others are elements of C or particular peculiarities of StormC These macros can not be redefined ___COMPMODE__ It is defines with the int constant 0 in C mode and 1 in C mode __cplusplus StormC defines the macros __stpc__ in C and C mode If you wants to check whether if compiling in StormC is done in C mode this must be made with the macro _ cplusplus __DATE The macro __DATE__ delivers the date of the compilation This is very useful if you want to g
35. by executing avail flush from the CLI That is much complicated than to simply start the new program Besides you can not debug in shared libraries Pay attention that your functions are re entrant That means that several programs can use it simultaneously That forbids in general the use of global or static local variables to store interim results If you want to receive data over several function calls you must work in the certain object oriented way You know that from intuition library You open a window and get back a struct Window With this pointer you can manipulate the window now until you close it Then intuition library receives this pointer at each function call and can work with the data structure Thereby you avoid global variables If you need much data locally e g for a large array you often use static local variables in normal programs In shared libraries you should lay these variables on the stack and if required previously accomplish a StackSwap or store the data short term in the dynamic storage reserved with AllocMem The third possibility is to protect with a semaphore the simultaneous use of the static variable through several programs Which method you chooses is a question of the respective situation Pe size A shared library should not need to use large stack StormC User Manual 129 6 COMPILER PORTING FROM SAS C TO STORMC We have made it a point to equip the StormC
36. by the contents of the last column The line below this holds a text entry field for a DOS pattern string Only those functions are shown whose names match the pattern this can help reduce excessively long function lists to a manageable size This can be used for instance to only show member functions of a particular class by entering the class name followed by To the right of this sits a numeric entry field where you may enter the minimum percentage of running time that a function must take up in order to be shown in the list Functions that make up less than 5 or 10 are often difficult to optimize and even doubling the speed of such a function is hardly worthwhile as the program would not become noticeably faster a mere 2 5 or 5 in this case These optional restrictions aside only those functions are ever shown that are invoked at least once while the program is running Double clicking on a function entry will take you directly to its location in the source text StormC the professional choice Profiler technical information The profiler display is also opened and updated automatically when the program terminates The control window will also remain open Closing the control window will also cause the profiler display to close and the list is forgotten Should you want to have access to this information afterwards make sure you have saved it to file or printed a hardcopy before closing the window Profiler t
37. code position of the StormC the professional choice allocation if this particular OS function is called directly in the program i e if the functions are defined by pragma amicall or pragma tagcall The screen is flashing when there is no corresponding source position for the resource Typical resources without a corresponding source position are memory blocks and shared libraries These resources are reserved by storm lib To avoid unneeded protocol output only theses resource are displayed which reservation was made from the program So resources which are directly reserved by a shared library are not displayed Maybe one can imagine how many memory orders an OpenWindowTags will cause Resources are freed very carefully Commonly resources are pointers to a data structure and can a release by another OS function can not always be recorded So there is a test at first e g whether there is a screen with the given data structure Screen at the time it should be freed before the screen will be closed by CloseScreen In most cases all resources can be freed The menu item Free resources in the Debugger menu frees all resources Window close gadget The window will automatically be closed when the program is ended and all resources are freed Closing the window automatically frees the resources Control Window StormC User Manual 173 7 THE DEBUGGER far data near data near data
38. current addresses in the program in two forms and allows you to enter a new address in one of the two forms and find its position in the source code o Search a Address 0x07 A0C25E Hunk foxoogo Offset Joxooo0Ce Search Cancel Fa This string gadget contains the address in its usual form This string gadget contains the hunk of the program where the address resides This string gadget contains the offset relative to the hunk of the program where the address resides Finds the source code position for the entered address for example the hunk offset pair Closes the requester Every program on the Amiga consists of at least on hunk with number 0 Further hunks have increasing numbers Every address that lies within a program corresponds exactly to a hunk and an offset likewise every hunk offset pair corresponds to an address when you re searching one in a program Many debugging related programs use this form since contrary to a physical address the form hunk offset is the same for every start of a program whereas physical addresses may change each time As soon as you change any of the three values an attempt is made to re compute the other form When you re looking for a particular hunk offset pair for example after your program caused an enforcer hit this is an easy way to find 180 StormC the professional choice the physical address and subsequently the source code position using Search
39. each file whether or not you want to remove it As only a few files are required outside the StormC drawer a manual deinstallation should be no problem The icons for the editor files and project management are removed from the ENVARC and ENV directories The StormScreen Manager is removed from your hard disk s WBStartup drawer Of course the Assignment in your User Startup 26 StormC the professional choice Removing StormC will be removed otherwise you would get an error message during the next reboot of your system that the drawer does not exist anymore Custom files in the StormC drawer Of course StormC will not be removed if the Installer detects custom files in it You will be notified of this and need to move these files somewhere else on your harddisk and delete the Stormc drawer yourself After Installation If you did not fill out the registration card yet this is the best time to do so You should by all means register so that we can inform you regularly about updates and upgrades Troubleshooting the Installation If you have followed the listed instructions you should have no problems during the installation It is however impossible to predict when a file or even a complete disk is damaged If only one or just a few files are damaged the installation may be performed manually Please inform us as soon as possible about the damage We will then send you a replacement disk To allow you
40. editor project manager compiler Later you should read through the other chapters as well to get an overview of the possibilities of StormC 20 StormC the professional choice Installation gt his chapter describes how to install StormC on your hard disk To avoid installation problems you should proceed the installation step by step as described here OVERVIEW EEE E E A 22 Before you install 00 cececessenstenctsteststssetststssssssstesstensssesessees 22 Localization enuon n eee a E R E O 22 Installing with low memory seeseessessessessesresresresreserssrerrsresersererrseeneee 23 Full installation 0ii0csic cuiecieieaditsiedulan acne pilotiegceieieiee 24 NOVICE User he eE E N e E ETa 24 Intermediate User Expert User ccs icecestgevacsecscateceses tesweaesdeysedessvincecenvas counacdivenesgeaeesuestaceusisdsecestecerstees 24 Selecting the installation directory 0 0 0 0 eeseeeteeteeeeeees 25 Installing an Update 000 eeeeeeeeeetenetetetststetstststetenetsnsteeeeenees 26 Removing StormC ti iiiscsisccicicsssscssessesssesseseessssasesssessussseassssissdessavsanaaisessaateate Custom files in the StormC drawer After Installation 0cccecessssssssssccsees Troubleshooting the Installation Correct StormC installation StormC User Manual 21 2 INSTALLATION o You can fing Ff information on the memory usage of the system in a file called Readme on the disk This file als
41. header files The pre compiled header files are always present after you create them once Another advantage of the pre compiled header files is that all files are assembled to one big file which can be loaded faster To tell the compiler where the header files are end and your program starts you must mark it with a pragma header statement One simple way is to put the includes of all headers you didn t write yourself e g OS includes or which will not be changed at the beginning of your source The pragma header statement should follow After that list your own header files and the rest of your program The pragma statement has no effect until you activate Write Header File in the cycle gadget Header Files and start the compilation of any changed modules As soon as the compiler reaches the pragma statements it will stop compiling your source and the pre compiled header file will be written with the given name to the predefined drawer StormC User Manual 71 4 PROJECT MANAGER 72 Before you start the compiler again you should switch the cycle gadget Header Files to Read Header File Next you should enter the path to the pre defined headers into the string gadget below You can use the ASL filerequester for that by clicking on the icon next to the string gadget The compiler now uses the pre compiled header file and looks for the statement pragma header to start further translation Working memory Works
42. in potentially enormous code bloat and deteriorated cache performance As this optimisation may take some time to perform its use is only recommended when compiling at optimisation level 9 and you have either a fast machine or enough time to spare VERSION number Sets the global constant _ _VERSION to the numerical value of number REVISION number Sets the global constant _ _REVISION to the numerical value of number ARexx StormLink has an ARexx port called STORMLINK Although full documentation of this port and its commands could be of interest to some users it is too large for the scope of this manual section This port is not intended for use from Rexx Suffice it to say that StormLink when called from the CLI without arguments goes into ARexx mode Four commands are supported each of which may however give rise to a flood of communications with StormC s IDE CD name Sets StormLink s working directory to the directory named by the argument LINK files o Options Initiates the linking stage with the specified options and object files BREAK StormC User Manual Memory classes VERSION Usage Description REVISION Usage Description CD Usage Description LINK Usage Description BREAK Usage 199 8 THE LINKER Description QUIT Usage Description TYPE FILE FROMFILE TOFILE SYMBOL OFFSET PREFILE Interrupts an ongoing linking stage if possib
43. looks as follows their name always uses the suffix fd so it is placed in the right section FD files of the project FD or fd stands for function description The file is composed of individual lines which begin either with a commentary or with a special command Otherwise the line must contain a valid function description Example base _MyLibBase bias 30 public add_two a b d0 d1 end The command base marks the name of the basis variable whereby the name is indicated as linker symbol with leading _ In your C program you will write this variable without the leading _ character The command bias sets the offset of the function In the function table the functions are standing one after another The first function has the offset 6 the next function the offset 12 the third the offset 18 etc With bias you can set this offset newly indeed you will give them positive values Each function increases the positive offset with 6 for in the function table stands a jmp xxx L That is a assembler instruction which jumps at the real beginning of the function This assembly instruction StormC User Manual 125 6 COMPILER requires just 6 byte Normally you sets this bias on 30 for the first 4 functions are reserved The command public marks the following function as publicly accessible The command private not used in the above mentioned example marks th
44. maxim in that no special version of the program needs to be generated for using the profiler Having the normal debug information generated will suffice This like the ability to start the profiler while debugging is probably unique for compilers on the Amiga If you wish to use the profiler make sure your project is compiled with the Debug option set to either small debug files or fat debug files Select the Use profiler option in the Start Program window The program can then be started as normal Simultaneous debugging is possible but may lead to minor deviations in the profiler s timing measurements After starting the program the profiler window can be opened o Profiler Protocol ce CPU time 00 00 00 13 lala Sort Procentual Time Pattern Min fo Function Usage Complete Time Maximum Minimum _ Calls printstr 5 5 00 00 00 00 00 00 00 00 00 00 00 00 12 writeAddresslist 1 7 00 00 00 00 00 00 00 00 00 00 00 00 2 writeAddressmask 1 6 00 00 00 00 00 00 00 00 00 00 00 00 3 addAddress 0 0 00 00 00 00 00 00 00 00 00 00 00 00 2 allocAddress 0 1 00 00 00 00 00 00 00 00 00 00 00 00 2 copystr 0 0 00 00 00 00 00 00 00 00 00 00 00 00 8 main 0 0 00 00 00 00 00 00 00 00 00 00 00 00 1 Al v f lt f gt The upper left corner updates the profiler display changing all indicated percentage and timing values to reflect the latest results StormC the profess
45. niaii Ee E EO PASES AEEA E sacdedsvtessapeees 141 S mbolic debugger svc scsiecsicvntescvcies Tacse nnne i a i i 141 Copyrights zisne nunnan aa i a ea 141 Warnings and errors ou ccceeeesscesteeetetetstseststststststsestetststseseseeeees 141 Format of the error oUtp t sisse sineiiersriiesesi iiciin iiitide 141 Colours and Styles soere niir a EE AAA EAEE RTE 142 Error file sirrirereasrnnanmiineanna naan riii niani 142 Optional Warnings ccsccsccssscsssesscesscsscesscsssesscsssesscesscsscesscsscesscsssessesssessesesesees 143 Treat Warnings like CrrOrs ssccsssccsssessscssccesscesscsessccesceessccessscesseessscesesonssoees 144 GOFE MOCMOPICS 223 rosiers ireo ieii a TE EC ET OA T EER RT 144 Pre compiled header files sereis a ER is 144 TEIE AAEE AN E A E E E A A 145 106 StormC the professional choice DATA in Registers SPECIAL FEATURES OF STORMC DATA in Registers Each processor manages not only the RAM but has in addition also some internal processor registers in which it stores results of calculations and so on The access to these registers is considerably more quicker than a RAM operation Since the processors of the 68000 family are richly equipped with registers programmers will take the unused registers to archive often used variables into them to increase speed Fortunately you has introduced a flexible and machine independent notation for it in the ANSI C standard The key is a memory class named register w
46. of all kind will be laid to auxiliary variables at code generation and packed to processor registers later At lower level these auxiliary variables will be recycled if possible to keep their number low The expression a b e would create the following intermediate code instruction Code creation 02 03 04 05 06 StormC User Manual 139 6 COMPILER g00 g60 g80 and g81 hl a b hl hit c From level 6 on the auxiliary variables are never used again The generated intermediate code would look like h1 h2 a b hi c In later optimisation step there will be a check whether it makes sense to pack h1 and h2 in the same registers That costs time and RAM because of the increasing number of internal auxiliary variables but it allows to make a good distribution of the registers Code for special processor Also there are always fewer Amiga User which use a normal 68000 processor StormC normally generates code for this processor It is compatible to all further processors of this family Indeed Motorola implemented some new commands to newer processors beginning with the 68020 They will accelerate programs partially i e at multiplication and at array access The following options switch to the code generation for certain processors g00 68000 default g10 68010 g20 68020 g30 68030 g40 68040 g60 68060 In the current version of StormC the options g20 and g30 are ident
47. of the first who s applications will run in PPC native code And then AMIGA IS BACK FOR FUTURE If you don t like manuals Are you somebody who never reads a manual So working with computers must be inborn Congratulations In most cases there will be a problem that you can not solve on your own You could phone us to get the answer but you can also have a look at the manual If you are a beginner you should work through the basics Read the first chapters about the editor project manager and compiler Use the rest as a reference and work through it if you need to If you still have questions you can contact us then This will work best for all of us If you are familiar with C and C In this case you should have a look at the concepts of StormC You will only will get the best out of you programming system by knowing the details StormC User Manual 19 1 WELCOME If you never worked with a compiler nor did any programming in C Then StormC is best for you One of our main goals was to design a development system that makes programming easier So we did an integrated system where you don t need to care about the individual parts You simply type your source into the editor and then hit Run and the rest will be done by StormC saving compiling linking running We recommend that you try out First Steps There you will get the basics of StormC Later you should work through the first chapters of the manual
48. out of range 8 bit data reloc out of range sssccsecsessessccesssessceessscsscsesssessssesssessesessseeseeens Hunk type not Code Data BSS 16 bit code reloc out of range 8 bit code reloc out of range Offset to data object is not 16 bit Offset to code object is not 16 bit Offset to data object is not 8 bit Offset to code object is not 8 bit StormC User Manual 183 8 THE LINKER D ta access to tode seriste eepe eare a a S EEEE TEE ESEE EEA 202 Code access to DOG oiio arenema aE EEA E AAE E TA 202 InitModules not used but not empty ss ssssssssessesssessessesseesressesseessesseeeresseseee 202 CleanupModules not used but not empty sccsccsccescessescessesscessessessessseees 203 File not found serris ieena siecsasestssasescdssneesesagesetashsvisovescarssssenevasiessveessepseds Unknown number format Symbol is not defined in this file c ccecccsccesscsssesscsssescessessesscsssesscsssesscescrsessees 203 Nothing loaded thus no linking ccccccsccescsssesscsssesscesscsscesscsssesscsssesscssseresessees 203 CON NOL WHE file creierii iani rie EE E AERE 203 Program is already linked ssccssscsssscssscesccssssessscsscsessscessscsssesssscessosseseeseoees 204 Overlays NOt SUPPOFte esseeri aA NA Ee NEA EE RE a rai a 204 HUNK is UNKNOWN c0sscisevssesns socisvessisescesodaesasssscaansenessteoedsetoseevodcnonetassasaoecesconess 204 Program does not contain ANY COE csssscesscessccs
49. pages At the upper border of the window you can find a paging gadget With clicks you can browse between the different settings pages Please select the C C Options page Workbench Screen 5 a Storm c Jel DEEI se R c Olla DEF IF 40 X k StormCPP StormWizard Open new project window F4 ormi form Wizar a _Storme Hello World Hello World mje Fie Tode Text 7 oj 7 Hello World 7 storm lib 336936 amiga lib 203436 A x CiC Ci me a Work StormC Hello World Hello World cpp ae laje Elis p oja Preprocessor Options Optimizer warnings RI CH Extra Hunk For Every Function inklude lt iostream h gt J Generate All Templat Don t inline I Tea plates 1 Ignore Exceptionspecitiers void main ST eee El Mesoo0 cout lt lt lt lt endl I NoDebugfiles iC rc J Debugsymbols el Far Code Gl NoAsM output f Cl Far Data Arte ffect j p _ Cancel Make sure that the cycle gadget in the Language group shows C All other settings should be set as shown in the illustration Confirm these settings by clicking on Use or press the lt U gt key Compiling the source code Clicking Make will open the error window and the source code will be passed to the Compiler The compiler and the 40 StormC the professional choise Compiling the source code linker will output sta
50. predefined options for the compiler linker debugger and the standard libraries Of course you have the option of changing all default settings so when creating a new project your preferred settings will be used More information on the definition of project templates can be found in the Own Project Template section of this chapter h y DEBI mi qe roject window F4 If there is no file vs template q in gt PROGDIR StormC uses its default settings for the new project In this case the project will not contain any settings for standard libraries and an error message will not be created StormC User Manual 55 4 PROJECT MANAGER File Code Text 56 Setup of projects When creating a new project a new project window appears on the screen in which the standard libraries can be found storm lib amiga lip Horizontally the project divides into three sections The horizontal section file shows as the first entry the title of the vertical section In our example it is the section Libraries In front of the title you can see a small triangle which points to the bottom The triangle symbolises that this section is not folded so the following entries up to the separating vertical line are part of the Libraries section In our example the names of the libraries are Storm Lib and Amiga Lib On the right beside the file section there is a code size section Here you wi
51. say if the definition of a template is correct or not Maybe you can think of a discretionary function template for a sorting algorithm e g quicksort The type of the element of the vector that has to be sorted is normally a template argument The programmer can solve the problem by implementing the needed function for the datatypes by himself Since you are working with more than one module on a bigger project the compiler can not know which of the not created but needed functions exist as finished ones anywhere within the project The compiler has two different strategies to solve this problem The first one will be activated by choosing the entry Create All Templates The compiler assumes that you didn t write your own templates so it generates all templates which are needed but are not already defined If an error occurs during this process it will be reported Functions that are created but that are not needed will be deleted by the linker later 74 StormC the professional choice ANSI C C Settings Another strategy will be selected if you do not mark Create All Templates In this case all templates will be created too If there an error is found in one of the functions the process will be halted There will be no code generation for the faulty function and the programmer will not be bothered with the error message The compiler assumes that all templates that can not be created without an error are defined elsewhere
52. scratch install an update or remove the old installation Expert User The expert mode gives you nearly full control over the installation This is useful if you don t want to install the full package but just parts of it 24 StormC the professional choice Selecting the installation directory Each time the installer is about to copy something you will be shown a list of files Only the files you select will actually be copied Furthermore this page allows you to change the destination path This is however not advised as it makes little sense The complete installation except for some tools and configuration files will be done in a single directory Drive Stormc and should not be spread around manually to multiple directories This prompt only exists in the Intermediate User and Expert User modes and only if there s already an existing installation including the first StormC Preview and the current demo versions For more information refer to Installing an Update and Removing StormC Selecting the installation directory When installing from scratch you select a drive or directory where the StormC file will be stored Workbench Screen 5j Ram Disk k FA Storm StormWIZARD GIGA2 FA oj StormC_Disk1 97 full 27K free 852K in use Imala GIGA telly l w aa Tirsmich Storm InstallScript 2 done Please select a devi
53. stormc 1ib storm _cerr 40 in hunk 1 lt stormc 1ib storm The first entry of a link is the name of the symbol Then the hexadecimal value follows then the hunk in the program where this symbol can be found the object file it came from and the memory class of the hunk The map file has the same name as the generated program with the ending MAP StormLink looks for multiple occurrances of symbols If something is found the name of the file in which the symbol was defined will be shown The test will be made on libraries as well because names could be multiply used but with different meanings A good example is the C function printf It is in MATH LIB as well as Storm Lib but the one in Math Lib can print floating point values Sets the offset of the data section for the created program to the value first data object number If your program contains a lot of data and StormLink gives you the error message 16 bit Reference Reloc Overflow a base number of 0x8000 could fix the problem If this does not help you must use 32 bit addresses HUGE data model StormC User Manual Link All Objects Write Map File lib gt lib gt lib gt lib gt lib gt lib gt lib gt aA ARR RRR Far Far Far Far Far Far Far Public Public Public Public Public Public Public Protocol Name Conflicts vooroor Offset Of Linker Data base 83 4 PROJECT MANAGER Version Revision Load Logfile
54. the exception handling is switched off px If you would like to use the exception treatment you must turn it on first with px As abbreviation x is allowed too Creation of Template functions It is not always easy for the compiler to decide which Template functions it should create and which not tT corresponds to the strategy All Templates Create at t is pursued the other strategy to create what will be created faultlessly Code creation Data model The option gd switches to NearData a4 and gD to FarData Pre set is FarData With the options gd4 and gd6 you can distinguish additionally whether the data model should be created relatively to the address A4 or to A6 The last one is very interesting at the creation of Shared Libraries Code model The option ge switches to NearCode model and gc to FarCode default Optimisations The additional optimisations are turned on with the option go and off with go Alternatively you can use for go also 00 By default they are off o can be used as abbreviation for go If the optimiser is turned on only the compiler optimises in the supreme optimisation level Instead of switching the optimiser on and off there is the possibility to switch to certain optimisation levels With the option 00 the optimiser will be switched off This is the same as go This switches the optimiser to the first level where basic
55. the professional choice Editor 5 tormED has some special features that makes writing source more comfortable and easy StormED will be used every time the source is displayed This is mostly when editing your text but if you are debugging your source will be shown in the editor as well This will make it easier for you to become familiar with the controls of StormC because they are always the same You will have worked through First Steps by now so you are more familiar with StormED If you are working with it often you will come to appreciate the syntax highlighting because it enable you to recognise errors very quickly The following chapter will tell you everything about StormED You will see it is a wonderful tool to use IN GENERAL ojponncsennaman n a a a aaa 93 New LOX oreo eit eA he ee 93 Controls of windows ccccccsscsssssesssssessessescsssescssssscescsscsssescesssseaseaseases 93 Open Load TeX scsi ccicsicicececsasiecessenettscaes cciendascsonvencnadessniacurecits iouavigetsontans 94 TOOMEY POS sisececnissteccusssceasesescventesstecattindtexusdonvsssaeddvetouecSenacdatdesascadverivaeessebooscavearye 94 Save Text Save Text AS iiiiccccccccccssccssscsssccssscsssccssscessscsscessscssscetsses 94 GOT ONG sais es rae aiae iaei aad EAA aes is EET aAA INTIAA SENES 94 Options of Text 2 0 ene ciiidi dela annie teiiiecensoneeorsrsietes Tabulations and Indent cssccssssessscssccssscessccssscessscsssc
56. to continue working with the compiler system the following list gives you information about the files and their required location Correct StormC installation On the first StormC disk you can find a list of the files of a complete StormC installation StormC Usermanual 27 2 INSTALLATION 28 StormC the professional choice First Steps 3 very C compiler s introduction begins with the Hello World program so will we With this simple example we want to show you the first steps you are waiting for You will learn how to create a simple project to write new source to run the compiler and finally to run the program BEFORE YOU BEGIN ooo ccssessseessesseessessssseesneeneeneesseeneerneens 30 Running the program 0 0 0 0 ce ceesssesecssecesestetsestststsesteeetststenseeeseenees 30 Toolbar access amp 0 ccicsicsieisessssstiserscscsssiensisssssocesdsaseeativasasossusstescnsadaceibcgtvessans 32 Ke board control eerstes iieii ai t anie oE EEEE A EN A 32 The icon bar offers the following functions s sssessesessseeseesesesesseesessserserssessesseese 32 THE CONCEPT OF PROJECTS ou cccseeseeseeseesesnesneenees 33 The simple way 3i4c e i icince iena ena 33 An easier approach through batch files 0 0 eeeteteeeeeeee 33 STORMC S PROJECT MANAGEMENT uuu eeceeeeescnesesesenees 34 Creating a MEW Project oo eeeetseetetseetstetetetststststetststseeteeeees 34 What is a project i ic s 5 cceitiesecccacased cestancai
57. to use such parameters only if you want to bind finished functions which expect their arguments in registers to a program E g the AmigaOS functions or assembler routines which can be ported badly anyway Parameters in Registers As small expansion of the C standard StormC offers the possibility to also submit parameters in registers Sometimes this leads to certain speed increases You simply have to write the symbol register before the parameters of the declaration of the function e g int Inc register int i register int j There are even two possibilities to prescribe the compiler in which registers it should put the parameters Either you rename the parameter variable as a 68000 register e g void f register int d0 register char a2 or you set the desired register name with __ behind the key word register void f register _ d0 int i register _ a2 char s If you are instructing the compiler this way which registers it should use for variables you should consider previously about the things you are doing there For your own C functions this feature is absolutely taboo because you don t know whether the above declared function would become possibly very slow because it needs the register dO constantly but it must store and restore the content of the registers variable every time You should use such register regularise for declaration of imported assembler and system functions only Inline
58. were out of the visible area before When you enlarge window size the new area will NOT be filled with text This saves memory The window can only be closed with the close gadget or by pressing lt Ctrl gt lt gt If WAIT is the only option no close gadget will be available Input Output When you select Files on the upper cycle gadget the string gadgets Output and Input become available You can enter the path and the name of the file where all output data should be stored at Output and the corresponding ones at Input Save Project After you have made all your project settings you can use them for your current project by clicking Use or pressing lt u gt StormC User Manual Save Project INACTIVE NOBORDER NOCLOSE NODEPTH NODRAG NOSIZE SCREEN SIMPLE SMART WAIT h w DE Ola se a window F4 89 4 PROJECT MANAGER You can now save these settings permanently by clicking the Save Project icon on the toolbar or with the menu item Project Save Build your own A project template is a default project that is used when a Project Template new project is created It is stored as template q in the directory PROGDIR If you want to build your own project template you should open a new project and make your individual settings To save this project as your project template you must select the menu item Project Save As Project Template 90 StormC
59. will be removed Select Continue when the installation location is okay Depending on the user level chosen the installation is performed automatically We do not recommend changing the destination for parts of the package Installing an update The installer automatically recognises if there s already an existing version of StormC on your hard disk It will notify you see the illustration on the previous page and offer to reinstall from scratch install an update or remove the old installation completely When updating you of course won t be asked where to install since the old location is already known In Novice User mode the old installation will be overwritten without further inquiry In Intermediate User mode the installer will check before unpacking whether the current file already exists and prompt whether it should be overwritten With parts consisting of multiple files the installer will not ask to replace each file The Expert User mode guarantees full control over the Update installation Files will be temporarily unpacked into RAM and you will then be asked for every single file to be copied Removing StormC We regret if you wish to remove your StormC installation from your hard disk but it will be mentioned here anyway You will of course only have the possibility to remove the installation if the installer detects it Depending on the User level chosen you will be asked for
60. would have been overwritten quickly otherwise This button toggles first the button is lowered and stays that way The program will be frozen until you raise the button again by selecting it once more StormC User Manual 153 ys 7 THE DEBUGGER Especially by vs setting too higha Ss priority for your program you can block the system Please be careful when changing this setting The program will continue to execute The menu item Pause in the Debugger menu also freezes the program Halting the program Next to it is the Kill button This martial action allows you to end program execution at any time The menu item Kill in the Debugger menu has the same result Changing the task priority The Priority group shows the priority of the program and allows you to change it Even though the priority can be changed throughout the whole range of 128 to 127 it should be restricted to the range of 20 to 20 otherwise troubles with other programs or even an unusable system can result The value set at program start normally 1 is really a sensible one because it is one step minor than the priority of the debugger so working with the debugger is always fluently Sending signals The Signals group contains four buttons to send the four interruption signals of AmigaDOS Ctrl C Ctrl D Ctrl E Ctrl F You can very easily control a program while testing by using corresponding Wait statements Much like t
61. would look for words which begin with the key word So ports would be found but not userport This would look for words which end with the key word Userport would be found but not ports This would only look at the first word of a row This would look at the end of the row only Ignore Upper Lower Case This would ignore whether the word is in upper or lower case Ignore Accent This would ignore whether a word contains accents or not Accents would be treated as they were normal letters E g RenE and Rene would be the same Find This starts the search process If there is no matching word you will hear a display beep Find and Replace Text Whole Word From Beginning of the Word From the End of the Word From Start of Line From End of Line StormC User Manual 103 5 STORMED Replace If you choose Replace the function will look at the first match of text and key word Then it would replace this matching text with the key word and continue the search Replace All This would do the same as Replace but it would not stop until it has searched and replaced the whole text The Find amp Replace requester will stay open as long as you are working with it This is a non modal requester You can always close it with the close gadget or by hitting lt ESC gt key 104 StormC the professional choice Compiler 6 espite computers are getting faster and faster you do not wa
62. 04 Overlays not supported 204 Hunk is unknown 204 Program does not contain any code 204 Symbol not defined 204 Symbol renamed to _stub 204 _stub is undefined 205 32 Bit Reference for Symbol 205 32 bit Reloc to Data 205 32 bit Reloc to BSS 205 32 bit Reloc to Code 205 32 Bit Reference for symbol from FROMFILE to TOFILE 205 Jump chain across hunk gt 32 KByte not possible 205 More than 32 KByte merged hunks 205 Illegal access to Linker defined Symbol 205 Fatal errors aborting 206 Hunk_lib inside Library 206 Hunk_Lib not found 206 StormC User Manual 17 TABLE OF CONTENTS 18 Wrong type in Library 206 Predefined values 206 Symbols for data data relocation 208 Hunk Layout 208 Memory Classes 208 Order of Searching for Symbols 209 Hunk Order 209 Near Code Near Data 209 StormC the professional choice Welcome q e thank you for buying this development system Be assured that this was the right decision StormC is the best tool to speed up your software development to make it more comfortable and easy With StormC we give you a tool for the future of the Amiga With the help of StormC you can build applications of outstanding quality that help assure the persistence of the Amiga After working a while with StormC you will never understand how you ever did without it We put all our experience into it and development is still going on Next step is the PowerPC version for the PowerAmiga Then you will be one
63. 20 30 40 60 Programs which do many floating point operations will be sped up by using an FPU Fast Floating Point Unit The option Use FPU will generate special code for the FPU If you switch to 68040 60 optimisation the use of the FPU will be activated automatically This is because both processors have a built in FPU StormLink supports near code In this model pc relative addressing of functions is used to get faster code and smaller programs If the NearCode hunk gets bigger than 32 Kbytes StormLink inserts a jump chain between the single hunks to make a call with more than 32 Kbyte address range possible A program which is created in the small data model has a single hunk which contains the pre initialised data of the program and the uninitialised data BSS Access to this hunk is handled by address register relative addressing These accesses have the advantage of being faster and shorter than 32 bit absolute accesses In the small data or code model only SHORT will be used for an address These are 16 bit or 2 bytes This makes the Program shorter and faster but the program can only be 64 Kbytes in size The short addressing is possible though a trick One register of the CPU normally A4 points at a place _y Ifyou generate vs code for 68020 and above or for an FPU these programs might not run on your old Amiga any more They will certainly crash suddenly Small and huge code model Small an
64. 34 Options 134 Assembler source 136 Pre processor Definition of symbols 136 Pre processor Include files 137 Compiler mode 137 ANSI C or C 137 Exception handling 137 Creation of Template functions 138 Code creation 138 Data model 138 Code model 138 14 StormC the professional choice Table of contents Optimisations 138 Code for special processor 140 Code for linker libraries 141 Debugger 141 RunShell 141 Symbolic debugger 141 Copyrights 141 Warnings and errors 141 Format of the error output 141 Colours and styles 142 Error file 142 Optional warnings 143 Treat warnings like errors 144 Core memories 144 Pre compiled header files 144 Summary 145 7 THE DEBUGGER 149 GENERAL INFORMATION ON RUNSHELL 151 The StormC Maxim 151 A Resource Tracking Example 152 Freeze the program temporarily 153 Halting the program 154 Changing the task priority 154 Sending signals 154 USING THE DEBUGGER 157 The Variable Window 159 Temporary Casts 161 Changing Values 161 Sorting of Variables 161 THE PROFILER 164 Profiler technical information 167 REFERENCE 169 StormC User Manual 15 TABLE OF CONTENTS Control Window 169 Status line 169 Program Stops At Breakpoint 169 Continue Program 169 Program waits for 169 Debugger icons 169 Go to next breakpoint 170 Step in single step 170 Step over single step but execute function calls without stopping 171 Go to the end of the functio
65. 5 Symbolic debugger 141 Template functions 138 Treat warnings like errors 144 Warnings and errors 141 Constructors 113 Copyrights 2 Debug Files 76 Debugger 76 Address requester 180 Breakpoint window 179 Changing Values 161 Control Window 169 Current variable window 174 Display member function 176 Don t inline 171 Example 157 Free Resources 156 Free resources 173 Freeze the program temporarily 153 Function window 178 General information 151 Global variables 160 Halting the program 154 Hex editor 181 Keyboard control 182 Icons 169 Inspect Variables 176 Inspection 160 Kill 172 Local variables 160 Module window 177 Pause 172 Priority 172 Protocol 172 StormC User Manual 211 INDEX Resource Tracking 152 Sending signals 154 Signals 172 Single step 170 Sorting of Variables 161 Task priority 154 Temporary Casts 161 Variable Window 159 Watched variables 160 Destructor 113 E Exceptions 75 EXIT_ 113 117 128 189 extern 107 F FD files 125 H Header Files 71 Hello World 185 history window 178 Homepage 8 Hotline 8 I INIT_ 113 117 127 189 InitModules 113 186 Inline 108 Internet 7 Joining Lines 114 K Kill 154 163 L LibClose 126 LibExpunge 126 Liblnit 126 186 212 StormC the professional choice LibNull 126 LibOpen 126 library_startup o 186 Licensee 3 Linker _exit 187 Compatibility 200 Error Messages 200 First example 185 Hunk Layout 208 Hunk Order 209
66. AM Using so much as a single 16 bit access to a CHIP data element 208 StormC the professional choice Order of Searching for Symbols through the xx ax addressing mode will force the entire Near Data hunk into Chip RAM Order of Searching for Symbols Symbols are looked for first in the Code section then in the Data section and finally in the BSS section If any symbols are not found the log file is inspected to find out which object file defines them Hunk Order All hunks of the same signature are merged together as far as any used options such as SMALLCODE or MAXDATA will allow As StormLink can and will reorder hunks while linking one should not rely on hunks appearing in the executable in the same order as they do in the object file The linker first writes all Code sections then all Data and finally the BSS sections However the order in which StormLink processes its parameters is significant It first makes a pass over the command line to filter out the options and then attempts to load all other arguments as object files Near Code Near Data StormLink supports programming in the Near code model where routines are accessed through PC relative addressing to reduce both execution time and program size Near Data consists of a hunk containing all pre initialised data of the program as well as all un initialised data BSS This hunk is addressed in a base relative fashion i e relative to a base address register
67. ARexx script for the active project or if a section title has been selected for all files in a section These scripts make it possible to invoke external compilers such as eg catcomp to compile Locale files automatically They are called by the project manager whenever the project is to be recompiled Makescripts should have filenames ending in srx Files with this extension to their names are also included in the ARexx section Selecting the Remove translation script menu option will remove the makescript from a project entry or from all entries in a project section The rules for determining whether a project file that has a makescript attached should be recompiled are essentially the same as they are for C source files A file is always recompiled during the first Make after a makescript has been added to it As an example of what a makescript looks like the catcomp srx script is explained below The script s arguments are the file name ie the path to the project entry and the base project path Both are enclosed in quotes to allow the use of spaces StormC the professional choice The argument list must be terminated by a full stop so that any additional arguments that may be passed by future versions of the compiler will be skipped PARSE ARG filename projectname The object filename is constructed from the filename argument This isn t necessarily a file that is going to be linked
68. As value a token is allowed here only that means at d N 17 4 would ignore that 4 Pre processor Include files The path where StormC searches the include files is by default set to StormC Include Through one or several i options you can change this path With the option i StormC inc the drawer StormC inc will be looked for exclusively and at i StormC include i StormC include amiga the pre processor searches successively in the both drawers Compiler mode ANSI C or C StormC can also be used as ANSI C compiler If you do not want to set pragma at the beginning of the source you can use the compiler option pe C is the pre set mode which is the same as the option pp Therefore e like c and p like plus plus this is however completely easy to keep in mind Exception handling Sometimes it is advantages if you translate a classic C program which does not use exception handling in a particular compiler mode Then the key words catch throw and try connected with the exception treatment are recognised no more and in the created code there is no bookkeeping of the necessary destructor calls That will make C programs faster and smaller ANSI C programs will not be affected Compiler mode pc and pp px pX and X StormC User Manual 137 6 COMPILER t and T gd gd4 gd6 and gD gc and gC go g0 and O 00 01 As default
69. C compatible manner of using a logfile for linking Please note that the logfile will be used after the normal linking If you are using normal libraries as well they will be linked first and then the logfile will be executed Please note that if you are using multi selection this list will be inserted alphabetically That means that Amiga Lib will be linked before Storm Lib which could cause trouble StormC User Manual 59 4 PROJECT MANAGER Folding of Sections If a section is not folded the triangle shows to the bottom and all entries are visible The following pictures will show the unfolded and the folded libraries section storm lib amiga lib To fold unfold a section you must click on the triangle next to the section name The same actions will take effect if you double click the section title But there is more functionality in the project manager than to fold unfold sections Showing Sources If you double click a source in the source section it will be opened in the editor During loading there will be a fuel gauge that shows you the progress But not only sources in the Source section can be loaded that way You can load every entry in the following sections into the editor by a simple double click Header files ASM sources ASM header files Documentation ARexx scripts AmigaGuide files FD files Locale catalogues Starting a Program By double clicking an item in the section Program you
70. LPAL HighFRes DBLPAL HighRes flimmerfrei DBLPAL HighRes Interlace DBLPAL LowRes DBLPAL LowRes flimmerfrei DBLPAL LowRes Interlace lt gt f Breite 640 Farben 16 H he J2 E Abbruch ModeID New Open Font Close Delete Storme Choose the appropriate screen mode and depth for your monitor Please keep in mind that a minimum of 16 colours are needed for the StormC screen When using 8 or fewer colours the editor can not correctly display the text in the predefined colours On the right side of the StormScreenManager window you ll find some other gadgets Creates a new standard entry in the public screen list The entry will be appended at the bottom of the list and you can modify the name in the string gadget and modify the other settings with the appropriate gadgets like ModeID and Font You can also open and close it right away Opens the selected screen in the public screen list Screens already opened ie The Workbench screen may not be opened again Opens an ASL font requester for you to choose the font for your screen Closes a screen opened by the StormScreenManager Closes a screen opened by the StormScreenManager and removes its entry in the public screens list In order to save all the changes applied to all the screens you have defined you must select the menu item Save in the Project menu of StormS
71. Memory Classes 208 Memory classes 191 Near Code 209 Near Dat 209 Predefined values 206 _ _BSSBAS 207 _ _BSSLEN 207 ___DATALEN 207 _ _OFFSET 207 _ _REVISION 207 _ _SmallData 206 _ _VERSION 207 _DDTABLE 208 _LinkerDB 206 RESIDENT 207 Startup Code 186 Linker parameters ADDSYM 192 BASE 193 BREAK 199 CD 199 CHIP 190 192 DDREL 197 DEBUG 192 FAST 190 192 FOLDCODE 198 FORCELINK 198 LIB 190 LIBPATH 190 LINK 199 LOG 197 MAP 189 MAXBSS 195 MAXCODE 195 MAXDATA 195 MODEL 198 NEARCODE 196 ONEHUNK 193 OOP 196 OPTIMIZE 196 QUIT 200 RESIDENT 195 REVISION 199 ROMCODE 193 SMALLBSS 195 SMALLCODE 195 SMALLDATA 195 TO 189 VERBOSE 194 VERSION 199 WARNREL 196 M main_ 186 main__iPPc 187 N Nested Comments 73 o Optimiser 84 Optimising 78 P Phone 8 pragma 110 pragma 110 pragma amicall 111 118 156 173 pragma chip 111 191 pragma fast 111 pragma header 71 Pragma instructions 110 pragma libbase 124 pragma priority 112 pragma tagcall 111 156 173 Predefined symbols 115 Preface 5 Problems 7 Profiler 164 protocol list 155 Index Prototypes 117 R register 107 Register parameters 108 Resource Tracking 151 RunShell 151 S ScreenManager 48 Settings 51 Shared Libraries avail flush 129 FD files 125 Important hints 128 Initialisation 127 library_startup o 128 Make your own 123 Project Settings 125 Register Setup 124 Setup 123 Using 117 Source Level Debugger 151 startup o 186 static
72. NAGER cr Menu item SS names followed by 3 points i e _ indicate that this is not a direct function but that more information is needed such as a confirmation or special settings A good example is the menu items Save and Save As Selecting Save will save the file immediately Save As will let you change the name before performing the Save function Never Into original file Into extra file Selecting the menu item Settings Editor the following requester will pops up Fie Font Colors Confirm Autosave CI Into Original File Interval a fis min Max Number Of Backups Make Backups This window can be sub divided in order to separately define the File Font and Colour settings The upper paging gadget lets you swap between the File Font and Colour settings The picture above shows the file settings editor This is where you can define the AutoSave settings and if you want to keep backups of your source files Automatic storage With the cycle gadget within the AutoSave group you can swap between the following possibilities There will not be any automatic storage At this position the storage will be done overwriting the original file The flag indicating file changes will be removed once the storage procedure has completed successfully If the automatic storage is to be done in an extra file a second file will be created with the
73. PU access Depending on screen mode and DMA activity by e g the blitter the processor may be restricted to use only as little as one fourth of the total bandwidth of this part of memory For this reason most Amiga models come with additional so called Fast RAM which is reserved for use by the CPU and which therefore sustains much higher access speeds In addition it is usually run at a higher clock speed than Chip RAM increasing bandwidth even further Program code should therefore preferably be loaded into Fast RAM if available Chip memory should only be used when strictly necessary Fortunately the Amiga OS allows the programmer to specify what type of memory each program section Glossary gt Hunk requires This makes it possible to load a program into Chip memory specifically should this become necessary Usually however only small parts of the program need to reside in Chip RAM They can be compiled assembled separately or StormLink may be instructed to add the necessary directives to these parts of the program should they be missing in the object file Note that StormLink cannot do this as selectively as the programmer could using the pragma chip directive The following options can be used to make StormLink force all data code or BSS sections into Chip or Fast memory respectively Please keep in mind that program code in Chip RAM will run at no more than one fourth the speed it would have in Fast RAM Memory classe
74. StormC The professional choice Users manual ANSI C C Development system for the Amiga COPYRIGHT Authors Jochen Becher Editor Project Manager Debugger Profiler Libraries Librarian ScreenManager Wizard Library Jens Gelhar ANSI C Compiler C Compiler PPC Frontend pOS Compiler Michael Rock Optimizing Linker Patcher FD2PRAGMA PPC Backend Markus Nerding Jeroen T Vermeulen Wouter van Oortmerssen Peter Frans Hollants Georges Goncalves Kersten Emmrich Manual Translation Peter dreamy Traskalik Hartwig Haage Graphics STORMC C C DEVELOPMENT SYSTEM Software and manual c 1995 1999 HAAGE amp PARTNER Computer GmbH All rights reserved This manual and the accompanying software are copyrighted They may not be reproduced in any form whether partically or in whole by any means of procedure sent multiplied and or spread or be translated into another language HAAGE amp PARTNER assumes no responsibility for damage caused by or resulting from malfunction of the program faulty copies or error in the manual are to be led back Copyrights and trademarks Amiga is a registered trademark of its owner Amiga AmigaDOS Kickstart and Workbench are trade marks SAS and SAS C are registered trademarks of the SAS Insti tute Inc The designation of products which are not from the HAAGE amp PARTNER COMPUTER GmbH serves information purpo ses exclusively and presents no trademark abuse
75. StormC the professional choice It is important to know that Amiga Lib contains functions with the same names as functions in the standard ANSI library but there are differences in the parameters When linking Amgia Lib before Storm Lib these functions will be taken from Amiga Lib which could cause your program to crash or otherwise act incorrectly Choosing a program name The last item of the group is for selection of the program name If you didn t choose a name for your program the linker will automatically create a file called a out in the project path when you link your code After selecting the menu item Project Select Executable the ASL filerequester will show up Now you can choose a drawer and a name for your program Please note that there will be a file with the extension link in this drawer when you are using the debugger This file contains data about the modules of the program and their paths Drag amp Drop Of course you may drag files from the Workbench to the project window If you drop an icon into the project window it will be added to an existing section or a new one will be created Controls of the Project Window You certainly have recognised the folding of the project section The small triangle indicates if the following section is folded or unfolded so you can see all its entries Drag amp Drop j Instead of using vs the normal linker eS libraries you can use the Maxon
76. Symbols for data data relocation sccssscssscessscssscsssccssscessscsscsesssessseesssseaeees 208 HUNK LQYOUE Biz teivaisiessicscessascecdsdeessaecescevasseseussiaSstvacsd A E E 208 Memory Classes sereni iii E O EEE EA RA Ra 208 Order of Searching for Symbols oo ee ceceeeceensncsenseesenees 209 Hunk Ordet tsitisite fiossensesce sos cael duseatgs assign otteseovvestasssecdovnnesesestusanabuceesnscaededees 209 Near Code Near Data wou cccccssccssscssccssscsssscssscessseseserssesess 209 184 StormC the professional choice THE LINKER THE UNKNOWN CREATURE The StormC package comes with an integrated linker called StormLink This subprogram does a lot more than merely combine program and library modules as will be explained below It is common practice in high level languages to divide even relatively small projects over several modules As mentioned in the introduction large benefits are to be had here reduced compiler turnaround times and more manageable source files are only two examples Frequently used routines may be combined into libraries and reused at will These libraries may grow quite large however the linker will only glue in the functions that are actually used enabling wide standardisation and reuse of finished code without the need for translating it anew each time it is used A first example Should you be unfamiliar with these concepts allow me to explain them with an example We shall use our well kn
77. a single directory O means that the object file should be stored in the same directory as the source file 1 means that the object file is to be stored in the object file directory StormC the professional choice Passing arguments to makescripts The name of the object file directory quoted like the other paths is passed as the next argument regardless of the value of the previous argument ie even when the preceding numeric argument is 0 The object file directory is only interesting to programs that generate code Source generating makescripts eg catcomp srx will always write their object files to the same directory that the file in the project entry resides in Thus only assemblers and other compilers really need to care about the object file directory Makescripts for assembly source files are an exception in that they take an additional third argument The name of the object file This name must be used when creating the assembler object file The path to the object file directory is already included in this name if necessary The argument list must be terminated by a full stop so that any additional arguments that may be passed by future versions of the compiler will be skipped A complete PARSE statement for makescripts other than one for assembler sources as explained above is composed as follows PARSE ARG filename projectname useobjectdir objectdir For an assembler makes
78. a6 it does the same for a6 Do not use __saveds lightly It should be used exclusively for functions that will be called from outside your program eg Dispatcher functions of BOOPSI classes In the current compiler version it is recommended to use only the large data model when creating shared libraries Remember that the small data model makes yet another register unavailable to the optimizer leaving only a0 to a3 this can quickly nullify the advantage of using the small data model if you re not using a great deal of global variables Like the others this keyword is accepted as a function specifier This means that their usage in a function definition must match the prototype If an __inline function is to be called from several modules its definition not just its prototype should be placed in a header file is not supported Stack checking or automatic stack extension is not available at this time Keywords _ interrupt __asm _regargs _stdarg _ saveds _ inline _ stackext StormC User Manual 133 6 COMPILER CLI VERSION OF THE COMPILER There should actually be people who do not like the integrated development environment Therefore StormC can be used as CLI version too You will only need the program StormC from the drawer StormC StormSys The concept The compiler creates object files from the sources which will be bound to a program by StormLink Without special option the compiler tr
79. acompiler system one rarely works with just a single source text Splitting up a project in multiple parts becomes unavoidable after some time be it to facilitate maintenance or because there is more than one programmer involved An additional reason for dividing a project into several source files is higher compilation speed recompilation after changing a single source file is faster as the other sources need not be processed again After compiling a multi part project the linker is called upon first to combine the parts into a single program and second to glue in the function libraries that high level languages particularly C and C tend to rely upon Two kinds of libraries exist in the Amiga system Shared libraries which are loaded at run time and can be used by more than one program at the same time and link libraries such as the standard ANSI library and the C class library which are attached linked directly to the program THE LINKER THE UNKNOWN CREATURE uo ccccscsecsessesseeteeeesees 185 A first example eneren a thai i a A ANSI C Hello Wo rld raris aneii ii RERA RA Startup Code i c ecnii ei heii a a diel E TE WS AO orain das cedi codes AEA sanded bias ceucecasesipitong OATS Par ametefs anionit irar erai RRE NaS NEES TERENA RETA IRREALE Memory classes oen nanon aean a iai Compatibility 3 5 sc cc05 cc cee a nieta oak be E EEA EN Error Messages Error Messages Unknown symbol type 16 bit Data reloc
80. again ew and eW H h and ho To turn on all warnings by the way a sign for good programming style is some typing work To make it a little easier there is an abbreviation a directly behind that w turns on all warnings You can also switch off all warnings with w but I would not advice this to you A clean program should output any warnings at most a warning are possibly as printout of your personal programming style If you take warnings actually so seriously the following section will be very interesting for you Treat warnings like errors With the option ew warnings are treated like error messages eW switches back to normal mode Core memories Of course StormC allocates the memory for the most internal processes automatically and dynamically but at code generation there must be a coherent memory area This size is 80 KByte by default If there is the message Workspace overflow you should increase the amount with the option w cautiously i e w150 for 150 Kbytes Pre compiled header files StormC can pre compile parts of a program That means that the compiler can store all its internal data like declarations and definitions at a user selectable position At the next run of the compiler this file can be loaded very quickly and so it saves much time This feature is for speeding up program development especially when many header files are used i e the AmigaOS Includes To tel
81. al choise Adding files to the project Adding files to the project To continue please choose Add file s from the Project menu Then enter Hello World cpp as the filename The suffix should be usable to distinguish between ANSI C C and Assembler source files and header files In our example we chose cpp because we want to write a Hello World example in C Workbench Screen Hello World 4 07 02 96 Pattern e Drawer File Hello World cpp Ok Volumes Parent Cancel Automatic Usage of Preferences When you create a new file for use in the project the file s preferences will be taken from the preference icons according to the specified suffix In our example the properties for the new source file Hello World cpp are taken from the preference icon ENV STORMC def_text cpp info For files ending in e the properties would be taken from ENV STORMC def_text c info etc Of course you can modify and set the preferences to your needs The icon s tooltypes contain all settings made in the Editor and Text sections You can access these in the Settings menu When adding vs empty source files gt created with Add file s the appropiate preferences for the given suffix will be taken from the preference icons located in the ENV location aT This illustration IE shows the ASL filerequester where existing files may be selected and new files can b
82. al classes with constructors that perform useful work although the objects of those classes are never used in the program StormLink would attempt to discard these objects as unused which may not be what you intended MODEL FAR NEAR NEAR_A6 To simplify library handling StormLink allows you to ignore certain parts of a library When for instance the MODEL option is used with the FAR argument all parts compiled with the NEAR or NEAR_A6 options are omitted As a result a library may contain multiple versions of each of its symbols obviating the need for a plethora of different versions of each library With this option the linker can be instructed to simply select the desired version of each function FOLDCODE StormLink is able to perform several optimisations on the final executable similar to those performed by a compiler One of these is detection and removal of duplicated code which is enabled by this option When StormLink finds two identical routines where one could be replaced by the other without affecting the result the second routine is removed and replaced by the first one The use of this option may not seem apparent after all you know what is in your program and wouldn t define identical functions The answer is in C template instantiations An executable may contain many identical instantiations of a function template or class template member function 198 StormC the professional choice resulting
83. am is compiled with the Small Data model this allows completely PC relative programming in a high level language The data base register normally a4 is now initialised with lea _LinkerDB PC a4 StormC User Manual Memory classes ROMCODE Usage Description Caution BASE Usage Description ONEHUNK Usage Description 193 8 THE LINKER VERBOSE Usage Description If all other addressing is done using d16 pc or d16 a4 the program will be entirely free of absolute addresses Such programs are fast in loading but are normally non re entrant Combining this option with ROoMcoDE yields a program that can be loaded into some SPECIFIC absolute address using Read File Buffer len and run directly This technique requires that the program contains no absolute addresses whatsoever meaning that the WARNREL option must be enabled if you want to apply it Enables the multiple definition check VERBOSE If VERBOSE is enabled StormLink shows the names of any files loaded and scans them for multiply defined symbols Should one be found it will print the names of the object files that define it The check also applies to libraries as names can be used more than once there but with different meanings Perhaps the best example of this is the C printf function The MATH LIB library defines a second version of this function which is capable of printing floating point numbers The VERBOSE option i
84. and whose filename ends in o but simply the file that is to be created Catcomp happens to create a header file objectname LEFT filename LASTPOS cd filename 1 h All output is sent to a console window say SAY Catcomp Script c1996 HAAGE amp PARTNER GmbH SAY Compile filename to header objectname In order to allow the Project Manager to determine when the file should be recompiled the object filename must be coupled to the project entry If this statement were to be omitted the makescript would be called for every Make A maximum of two object filenames may be given as follows OBJECTS filename objectnamel objectname2 These names are then attached to the entry and the files are checked when recompiling The OBJECTS statement should not be used if the makescript is used for calling an assembler in the section Asm Sources For this section the object names are derived automatically OBJECTS filename objectname This is where the translating program is called Error messages are printed in the console window ADDRESS COMMAND catcomp filename CFILE objectname AS catcomp creates a header file it is advisable to enter this header file into the project The QUIET parameter Makescripts See also the script StormC rexx phxass srx StormC User Manual 65 4 PROJECT MANAGER 66 represses any error messages in case the header file should already be included i
85. anslates all indicated sources and writes the object files The instruction StormSYS StormC main c text c unter c compiles the three sources main c text c as well as unter c and creates their object files Subsequently you must link the object files with the linker to get a finished program If an error appears at the translation a suitable output with a short portion of the source is output along with an output of the kind File filename c line 17 Error Identifier ths not defined Go on with lt Return gt abort with lt A gt Now you can pass over the error with lt Return gt and continue the translation or press lt A gt to abort the compilation StormC is capable of being resident even if some Shells announce a sum error This is harmless in each case even if StormC was made re entrant on a somewhat unusual method Using a semaphore a loaded copy of the program cares for that it does not run twice simultaneously Options All compiler functions are steered through compiler options which are indicated in the command line and begin respectively with a minus character To bring a little order in this extensive jumble the options can be divided using their respectively first letter into different ranges 134 StormC the professional choice Options a Assembler Source Generation b Debugs d Symbol Definitions e Error Messages g Code Generation h Pre Compiled Headers i Pat
86. apter will tell you more about the project manager how it works how to configure it and how to navigate throughout the development system with it OVERVIEW irises oi Sie ctecets audstdtessse artotindstnlaashisteedenepeteoeinlee 47 Some words about the startup 0 0 0 eecseeceeeseseeeeeeeeseeteeseneees 47 Memory usage Settings ORGANISATION OF A PROJECT ou cccccccscssessessessesscsessessessssscsecsessesssseseeseese 55 Creation Of a MEW project oo ee eeetetetetetetetststetsteetstseeteeeees 55 Setup Of projects oo sesectetcnstssetetstststststststststststssststsnstesseeesseees Project Sections 0iiiiccesiesiecedicsettesessesscostsccsssecssasstsbessszsssdborsizssscrersestdhension Adding Files isicisccisissstsdeacssscssaeisstiesecssassas ssebitiavsussesbessessuadzardesadieisateseeisneaes Adding Sources Add WINdOW jevccccssecsstcsicsiescacesesceecastbessdecestentsstacraaveversevacdoncnisestvuanssatesescasesteveeve Adding Libraries sccsecceseesees Choosing a program name Drag amp Drop ceinetan i AEE RAA R O a Controls of the Project Window Folding of Sections Showing Sources Starting a Program Opera Child Project ssena nriran aia ii i a a Keyboard control Cursor keys Return StormC User Manual 45 4 PROJECT MANAGER Deleting Items of a Project 00 0 eee ceceececncssscesesssesssssesseeseees 61 Organising files Of a project eee ecseececseseseeseceesessesesnsnees 61 Makeseripts i sssiiiti
87. art BssStart For those who want to create EPROMsS use this option only if you really know what you re doing The output file will contain only the raw code and data hunks The BSS hunk must be allocated manually at the appropriate absolute address using the AllocAbs function Code and data hunks are relocated to the specified addresses at compile time so there is no AmigaDOS relocation table overhead After the indicated number of bytes of code only the data section follows If your program addresses data relative to an address register the BSS hunk is again assumed to be directly behind the data hunk The BSS thus starts at Address of Data Length of Data The SmallCode SmallData and SmallBSS are set automatically so there is no fragmentation Using the WARNEREL option and corresponding startup code you may produce completely PC relative code here Linker database offset BASE number Sets the linker database s offset value within the program to First Data Object number Should your program contain too much data resulting in a 16 Bit Reference Reloc Out of Range error from the linker setting BASE to 0x8000 may help you out If this doesn t work you will need to switch to 32 bit addressing Generates CODE hunk only ONEHUNK Produces a single CODE hunk containing all Code Data and BSS sections This could be useful for games programmers Any relocation routine now only needs to deal with one hunk If the progr
88. ary functions LibOpen LibClose LibExpunge and LibNul1 If StormC Startup Code is selected the file PROGDIR library startup o will be linked to the program As said before the standard Startup code will be linked to the program when this option is selected The Startup code can be found in the directory PROGDIR Shared libraries will use the startup code library startup o the others startup o Normally only drivers and handlers are linked without Startup Code Here the libraries mentioned in the project will be linked but the Startup Code will not be used 82 StormC the professional choice Path Settings and Linker Modes If this option is selected the string gadget is activated and Own Startup Code you can enter your own object file that should be used as the Startup Code for linking Now all functions and global variables from the object files of the project modules will be linked to the program even if they are not used Of course this does not count for functions in libraries StormLink creates a file which contains all symbols from the generated programs with their assigns in the finished program Here you see part of a linker map _cout 24 in hunk 1 lt stormc lib storm _std_out 32 in hunk 1 lt stormc lib storm _std_in 16 in hunk 1 lt stormc 1ib storm _cin 8 in hunk 1 lt stormc lib storm _clog 40 in hunk 1 lt stormc 1ib storm _std_err 4E in hunk 1 lt
89. ata element 0x8000 this is used by the MaxonC compiler which assumes that BASE is always set to its maximum 0x8000 Mixing object files that assume different BASE settings is possible but the produced executable will crash inevitably 206 StormC the professional choice Predefined values RESIDENT const 1 set when linking with RESIDENT option 0 otherwise __VERSION const variable This is equal to 0 by default but can be set with the VERSION option _ REVISION const variable This is equal to 0 by default but can be set with the REVISION option _ _DATALEN const Length of the data area in longwords one longword equals four bytes of the MERGED hunk _ _BSSBAS label Start of the BSS section in the MERGED hunk _ _BSSLEN const Length of the BSS section of the MERGED hunk in longwords _ _OFFSET const This equals the offset defined by BASE the amount of data placed before the Near Data section of the Data hunk These values are useful when writing a pure resident program It also allows the startup code to determine whether the BSS section still needs to be initialised or whether the program has been linked with the RESIDENT option in which case it must set up a new MERGED hunk For more detailed information please read the provided source to the startup code StormC User Manual RESIDENT Usage Description _ _VERSION Usage Description _ _REVISION Usage Descri
90. ation may result in incorrect code however The optimiser contains a tiny disassembler that recognises only the JSR PEA and LEA instructions It cannot distinguish between code and any data that may be interspersed with it The optimiser is only called for global references ie when references are bound across object modules Performing these optimisations for relocation entries is left to the assembler and the compiler StormLink assumes that all symbols needed for CleanupModules or InitModules can be reached by a single short jump This may lead to problems with very large hunks as this type of jump cannot cover a distance of more than 32 Kb OOP Generates the auto init and auto exit routines needed by a C compiler When enabled StormLink assembles a routine labeled _InitModules and one labeled 196 StormC the professional choice _CleanupModules which call the required _INIT_x_ and _EXIT_x_ routines Here x is a number between 0 and 9 In this case and only in this one the use of multiple symbols with the same name is allowed If the routines are non empty yet never called a warning is emitted The _InitModules routine calls the _INIT_0_ routines first and the _INIT_9_ routines last The order is reversed in _CleanupModules The entries are sorted by number where single digit numbers are multiplied by 100 and two digit numbers by 10 Thus _INIT_1_ is called before _INIT_31_ ensuring compati
91. be coloured by this function 98 StormC the professional choice Colour Settings The settings of colours will be made in the file StormSettings ED For example Only the lower 5 rows of this settings file are of interest The definition has the following setup foreground colour RGB background colour RGB foreground index background index softsyle ok WNP The separation into these values has the advantage that AmigaOS 3 0 and above can use palette sharing The OS function will look to see whether there is the requested or other suitable colour it can use AmigaOS 2 1 and older will use fixed colour indexes That is the reason for both methods used here If you use AmigaOS 2 0 or older the colour used depends on the colour settings you made on Workbench AmigaOS 3 0 and above will try to get the colour you requested or a colour that is close to this one The result might not be as good as you expect but this is a common problem on computers with only a few colours available File Saving Settings Work StormC Examples Colorwheel ColorWheel c ajf Textformatting l Coloring l File I Strip Blanks At End Of Line To prevent the saving of text with spaces at the end of some lines you can turn on the function Strip Blanks At End Of Line Options of Text StormC User Manual 99 5 STORMED Saving the Settings All the settings you made will be saved as Tool Types of your text If you want these s
92. bility with the three digit priority numbers in the SAS C compiler LOG filename Whenever a symbol is referenced that StormLink can t find an ERROR 25 message is generated Before this happens however it tries to find out which file it could load to find the symbol anyway The LOG option loads a log file which contains information about object files and the symbols defined in them It looks like this lt filename gt lt This is the name of the object file lt symbol gt lt Symbols lt symbol gt The filenames start at the first column whereas symbols are recognised by leading whitespace DDREL The abbreviation means Data Data Relocation If there are any fixed 32 bit relocations from Data to Data BSS this option instructs StormLink to set up an internal relocation table for the program so that the startup code can work out the relocations for its own copy of the Data BSS hunks This option is useful only in conjunction with RESIDENT StormC User Manual Memory classes LOG Usage Description DDREL Usage Description 197 8 THE LINKER FORCELINK Usage Description MODEL Usage Description FOLDCODE Usage Description FORCELINK This option forces StormLink to include all Data and BSS hunks from all object files included in the command line Unused hunks from libraries are still stripped from the output file Using this option may become necessary if your program contains glob
93. c library to get a pointer to the control structure of the task and it outputs their memory address The exec library has a particularity to all other libraries It will not be opened by the program because it is always open and the functions can be used immediately This is different if you have a look at e g intuition library Example include include include lt pragma exec_lib h gt lt pragma intuition_lib h gt lt exec libraries h gt external struct Library intuition base void main if intuition base OpenLibrary intuition library 37 DisplayBeep NULL CloseLibrary intuition base NULL This program makes nothing than flashing the screen Maybe it will play the 9th Symphony of Beethoven too if you have reconfigured system beep StormC User Manual In this context T SS one says pragma files or the compiler XYZ knows Pragmas That is very inaccurate for the instruction pragma has nothing to do with the call of shared libraries for it is ANSI C standard Indeed pragma amicall is very important and older compilers on the Amiga knew this pragma only Therefore pragma has become the generalised expression for the direct call of shared libraries 119 6 COMPILER To get it doing this you must open intution library version 37 That means that you must have at least AmigaOS 2 04 installed The function DisplayBeep is ca
94. ce code available again Such jumps back can also happen in link libraries using function pointers or virtual function members in C classes The execution speed of library functions is therefore low Functions of shared libraries will always be executed at full CPU speed At recall of the program from such a library it can not be stopped If the behaviour of a hook function should be tested a breakpoint must be set in the hook function before the call of the library function that calls the hook function Under certain circumstances it is critical to single step Forbid Permit sections The protection is broken after every stop the program sends a message to the debugger and waits for an answer and other tasks can run again When at this time one of the global system lists is not correct the system might crash When the Forbid StormC the professional choice Control Window Permit section is only used to copy the contents of a global data structure e g the list of all waiting tasks of the system it is probable that the result is incorrect Inline functions are normally treated like instructions cause the compiler will insert inline functions directly into the program and optimise it very strong So a allocation between instructions of the program and the source code of the inline function is impossible For testing of a program teh compiler option Don t inline can be set and the compiler will treat ever
95. ce f Fie Code i Text MResource c 340 401 Resource 516 storm lilo 336936 2 p I seman lt o MResource ojoj Pase f Ku f e ja Ctrl C Program launched Ctri D Memory at address 0x078574A8 of size 12 not freed Memory at address 0x07868DA0 of size 10 not freed _Ctri E File Work StormC Examplesillesourceitest not closed Ctri E A The status line shows help texts for elements of the control window and also the status of your program when you re not above any control gadgets The 1I11Resource program now shows that it s waiting the Wait function of exec 1library and also shows the mask of the signal flags that it is waiting for At the moment this reads 0x00001000 which corresponds to a Ctrl C De icons in the Debugger group aren t needed for the moment first we want the program to execute normally The debugger can be activated with the checkmark on the group frame the icons in this group stand for Go Step in single step Step over single step but execute function calls without stopping Go to end of function and Show last found program position These functions will be explained later in the debugger introduction Freeze the program temporarily The Pause button allows you to freeze the program at any time e g when you wish to inspect the contents of a window that
96. ce or a drawer for your installation of StormC lt A drawer named Storm will be created vel automatically c2 DF2 StormC_Disk1 DHI GIGA TG DHe GiGa2 PCo EMPTY Selected Drawer I ORK Storm Proceed Parent Drawer Show Drives Make New Drawer Abort Install Help Click on Show drives if you don t want to install on the currently displayed drive which is the default destination Then click on a drive in the list shown Select Create a new drawer if you wish to create a new drawer inside the directory currently shown However keep in mind that the installer will automatically create a StormC drawer and copy all files there Parent drawer takes you one level back in the directory structure StormC Usermanual 4 The installer will g create a directory o StormC on the selected drive or in the selected path Diskette drives and the RAM disk are not allowed as destinations After selecting vs the destination m path the file Readme will be copied and displayed You should read about recent changes since the manual was printed during the installation process 25 2 INSTALLATION n During an vs update all files you modified e g includes demos and preferences will be over written You should therefore create a backup of your changes prior to updating and restore it afterwards Only files copied during the ET df StormC installation
97. compiler with many important properties of the SAS C compiler ie support for various SAS specific keywords and pragmas Nevertheless there may depending on your programming style be large or small amounts of trouble when porting software from the SAS C compiler to the StormC compiler Please keep in mind that StormC is an ANSI C and C compiler SAS C on the other hand is a C and ANSI C compiler the C precompiler is not likely to have found much serious use meaning that it understands a lot of older syntax that StormC will not accept This is likely to cause trouble when migrating your sources to StormC unless you are used to compiling your SAS C programs strictly in ANSI mode using SAS C s ANSI option Project settings First of all make sure that the project you build around your SAS C sources is in ANSI C compiler mode Try enabling as many warnings as possible and then adapt your programs until no more warnings are given when compiling This will give you the best chance that your program will do exactly what you intend it to Even for pure ANSI C projects switching to C later is recommendable This will have several advantages Prototypes are expected for all functions and implicitly converting a void to another pointer type is no longer legal Although this may necessitate a relatively tiresome rework of your programs especially the latter change which affects a great deal of statements that call malloc
98. creenManager 50 StormC the professional choice Memory usage To finish with the screen manager a single click on the window close gadget will hide it This will only close the program window and this is the equivalent of the Hide menu item of the Project menu If you want to deactivate the program as well as remove it from memory you must select the Quit menu item in the Project menu Memory usage Whenever starting the StormC development system it always tries to load as many program parts as possible in memory to make them resident modules If you are low on memory StormC will still try to start up if there s enough memory to start StormShell and StormED The programs StormC StormLink and StormRun will be started via a Shell for any compilation and will be unloaded afterwards This way turnaround times will be higher Settings Before opening any project or source fundamental system settings should be created and saved Following settings can be made The initial size position display and start address to show HexEditor in the HexEditor window within the debugger can be set here When the ProjectManager is in the empty state youcanset Source text editor the font and paths for the source text editor The other settings such as syntax colourisation and entries linked with source files will be saved in the predifined icon More information about this later StormC User Manual 51 4 PROJECT MA
99. cript this would be PARSE ARG filename projectname objectname useobjectdir objectdir Ready made makescripts The directory StormC Rexx contains several ready to use makescripts You may want to adapt them to different uses and situations Assembler scripts Makescripts for assemblers differ from other makescripts in that they may not contain the OBJECTS statement phxass srx StormC User Manual 67 4 PROJECT MANAGER 68 This script translates an assembler file using the PhxAss assembler This script is really superfluous because the assembler is supported by the StormShell directly but may be useful if you want to use different assembler options oma srx This script translates an assembler source file using the OMA assembler masm srx This script translates an assembler source file using the MASM assembler Other scripts catcomp srx This script translates a Locale catalogue file by invoking the program catcomp librarian srx The StormLibrarian can also be controlled through makescripts A project entry in the Librarian section can be loaded directly into StormLibrarian by double clicking it with the mouse or the linker library can be created simply by double clicking it while keeping the Alt key pressed But if a project should always create a link library the use of makescripts is recommended The list of object files is created in StormLibrarian as usua
100. cssessesesssesssseseseseesees Indent ahead and behind of brackets Dictionaries and Syntax Dictionaries sessist reinoisss Syntax weesessccccsssrecesseees C lour Settings 5 ciesicecastectceceonecassciensecdectecounsccuedvaassdess ssaeseuaceedbecekesueseseesivuveseddese File Saving Settings Saving the Settings Keyboard Navigation CUISOF KEYS csstetechgsecvececncecusdeesentecstncdseesegesusesensunsestenteavesedssvencd osbbestesucseseacterssedes lt Return gt lt Enter gt lt Tab gt Undo Redo Block Operations Mark Cut Copy and Paste The Mouse StormC User Manual 91 5 STORMED amp es a 92 Find and Replace 20 esesssescecsesstessctescsssssceessesssesssssssssessseseseeeees 102 Direction orioa iedeen R REEE ET TAERE EE REFERA 103 Lao l ATER E A E E A E 103 Ignore Upper Lower Case sr erreien iiri eaa EA ER RAOT A 103 l noreAccentatoannng inaa i a a A EEE REE 103 FNA ie a A E A E A I A i NARTO 103 A A Lo LE A EAE E T T E E 104 Replace All cs aicesssesdccciueststscescviueeeesicevecunveccstevastaanscsadeessesveretbcedeadseoscebareseseevensens 104 StormC the professional choice IN GENERAL Before you start with this section you should have learned a little about the project manager You will already know that normally you do not open a text without opening a project first Opening pure text is only recommended if you want to have a quick look at it All sources that belong to a project should be contain
101. d huge data model StormC User Manual 77 4 PROJECT MANAGER Small data model a6 Level 1 Level 2 in the data area of the program and all addresses can be called by an offset to this register Small Data Model a6 is a format that is available in StormC only It is mainly the same as the NEAR format but the base register is A6 instead of A4 In a shared library the program has no elegant method to get the value of the base register but it does get the library base in register A6 Quality of the Optimisation To improve the quality of the code requires a lot of RAM and an increase in the translation time CiC Ci 25 Preprocessor Options Optimizer Warnings l Optimizer enabled at quality 6 This level introduces a completly different algorithm for register usage The register reservation is done as late as possible to allow best optimization The register reservation and eliminating is done after all other optimizations and is as good as poosible The amount of space and time is large Optimising At this time the compiler knows 6 levels of optimisation You may select the level with the slider or by entering the number directly The following optimisations will be done by the respective levels The first level optimises basic blocks A basic block is a sequence of code statements which do not contain any jumps Successive blocks will be joined to make later optimisation easier Un
102. d variables Deletes the variables from the list of watched variables Allows changing the type of a variable The original type will still be shown in the type list of the window the value however will be shown according to the new type By clearing the string gadget you can set it back to the original type The type entered must match the way the debugger writes them Only simple types in Amiga specific form BYTE LONG DOUBLE pointers to these types BYTE LONG etc and all types that are defined anywhere in the module are allowed Numeric types allow direct modification without having to resort to the hex editor The input can be decimal octal or hexadecimal in the usual C syntax StormC the professional choice The module window Strings can be changed too That means a memory area on which a pointer on UBYTE or BYTE shows can be filled with a new string It cannot be checked if the new string is too long that means that the memory behind the reserved buffer of the old string will be overwritten The module window The module window lists all the modules in the program This window can be opened anytime using the menu item Modules in the Windows menu By double clicking a module name in this list the source code for this module will be shown EN Fa C Unsorted main o address o Modules without a debug file will not be displayed in the normal text colour black but in the selecti
103. diese teedieleebdeasteedasiscepeteeteoetasen 35 Make and module dependencies 0 0 0 0 eessessssteteetetetetsteeseeees 35 Saving the project and creating a new directory 0000000 35 Adding files to the project 0 0 0 0 eescscseecscscssecscscasasasscesesesecas 37 Automatic Usage of Preferences 000 0 cescsscscscececesscssscesesecasaes 37 Specifying the program s MAME 000 0 eeeteteteteeeessteeeeeeees 38 Saving the project 0 0 0 0 sseseseeeeeststseetetststsestetetststseststeneneeesenenens 38 Creating a source file 0 eececeeecnetetststenetstststetstststetseeeeenees 39 Adjusting Settings 000 000 eeccetetcessessecssssssessssssssesesesesesssesesesees 40 Compiling the source code 0 0 ec seseecsstetetetsetetetststststststseseseeees 40 Running the translated program 0 00 00 ec eeeeeeecteteteeeeseeeteeeeneees 42 Console Output ienaam ala cea aidan aad 42 StormC User Manual 29 3 FIRST STEPS BEFORE YOU BEGIN The following instructions assume that you have successfully installed StormC and rebooted your system If you didn t please go back and read Chapter 2 Installation Running the program Please start StormC with a double click on its icon see the marginal illustration You can find the icon in the drawer in which you installed StormC After starting you will see a Welcome message which remains until all of StormC s components are loaded If your Workbench has more than 32 colours you will see a Welcome pictu
104. displays the hexadecimal value the memory locations If the address points to an illegal memory area then only minus characters are displayed and every modification is suppressed The memory locations are not read to avoid enforcer hits The ASCII column This column displays the ANSI character for the memory locations If the value is outside the range of displayable ANSI characters a dot is shown likewise for illegal memory addresses The hex editor StormC User Manual 181 ys 7 THE DEBUGGER 182 Keyboard control The four cursor keys move the cursor within a column The lt Tab gt key switches to the next column In the address and hexadecimal columns the keys 0 to 9 and a to f and these also with lt Shift gt i e A to F are allowed In the ASCII column every character that is displayable one way or the other is of course allowed The scrollbar in the hex editor To allow for comfortable operation of the scrollbar the total area covered by it is constrained to 8 Kbytes However if you move the mouse over the top or bottom border of the hex editor display the current address will be moved 4 Kbytes up or down respectively This allows you to also examine larger areas using the scrollbar For really big changes to the address it is always better to directly enter the address because of the large address space of the CPU StormC the professional choice StormLink 3 n
105. do and operands like 11 ee or i Optimisation There will be a warning if there is a declared variable that is Unused Variables never used or if a variable is used but not initialised StormC User Manual 81 4 PROJECT MANAGER Linking Programs No Linking Link as Shared Library StormC Startup Code Without Startup Code Path Settings and Linker Modes The Settings of Linker Options 1 set the defaults of how a program has to be linked Linker om Linker 1 Linker 2 JStormt Tib w7 Load Logfile StormC Libfogfie CI Custom Startupcode JPROGDIF startup o Bl J Link All Objects Offset To Linker Database fe Version i Revision fo 32 Bit Relocs eI Link Program Protocol Nameconflicts Fold Common Code Replace Unknown Symbols With _stub Write Map File Optimize Near Code Model Generation of Programs With the first cycle gadget you will choose the manner of program of the project Link Program will use the standard library If the next cycle gadget says Stormc Startup Code the file PROGDIR startup o will be linked to the program The Linker will not do anything After the compiler run the project will be ready compiled The object and debug files will be stored but no executable will be created The linker creates a function table out of the indicated FD files and imports the standard shared libr
106. dual letter to abbreviate is perhaps no particularly impressive saving In this particular case o has the advantage to be compatible to other compilers Assembler source Perhaps you would like to examine once the code created by StormC or you belong to the people who want to optimise the compiled program by hand With the option a you can get the output of an assembler listing E g StormSYS StormC test c a creates not only the object file test o but also the assembler listing test s The statement a does not abort the translation process before the assembling but creates the source in addition to the remaining actions A pure assembler listing is rather tangled in most cases Therefore there is the alternative as through the statements from the original sources will be inserted at the respectively corresponding positions as commentary in the assembler source To switch off these both options explicit you must use ao Pre processor Definition of symbols With the option d you can define from outside a pre processor symbol Thereby an argument corresponds to d NAME a line define NAME at the beginning of the source A typical application is an instruction like StormSYS StormC text c d NDEBUG if the include file lt assert h gt is used 136 StormC the professional choice You can assign a value to the symbol by setting directly behind the identifier e g d ANZAHL 4711
107. e corresponding attribute in the tooltypes of StormCPP Please open the information window and delete the round brackets at the beginning and the end of the corresponding line to activate this attribute At the next startup of StormC this screen will be opened automatically Now the Tooltypes of the StormCPP icon will be executed if possible The following options can be used 47 4 PROJECT MANAGER QUIET HOTHELP SAVEMEM GOLDED PUBSCREEN The QUIET tooltype will disable the picture show at start The progress window which opens on Workbench screens with fewer colours when not enough colours are available to show the pictures will also be disabled Upon activating the editor window you can press the lt HELP gt key to get context sensitive help from the AmigaGuide docs If you would like to have the program HOTHELP doing this job you must enter the tooltype HOTHELP When memory is low the use of this tooltype offers the possibility to only load parts of the system to save memory SAVEMEM prevents the loading of StormC StormLink StormASM and StormRUN These parts are only loaded when they are needed After beeing loaded these parts will stay in memory as long as there is enough memory The popular editor GoldED can be used instead of StormED It is loaded form the drawer GOLDED As GoldED is used the same way as StormED it is not the control office of the system so it must be loaded memory reside
108. e StormC drawer 27 After Installation 27 Troubleshooting the Installation 27 Correct StormC installation 27 StormC User Manual 9 TABLE OF CONTENTS 3 FIRST STEPS 29 BEFORE YOU BEGIN 30 Running the program 30 StormShell 30 StormC 31 StormLink 31 StormEd 31 StormRun 31 StormASM 31 Toolbar access 32 Keyboard control 32 The icon bar offers the following functions 32 THE CONCEPT OF PROJECTS 33 The simple way 33 An easier approach through batch files 33 STORMC S PROJECT MANAGEMENT 34 Creating a new project 34 What is a project 35 Make and module dependencies 35 Saving the project and creating a new directory 35 Adding files to the project 37 Automatic Usage of Preferences 37 Specifying the program s name 38 Saving the project 38 Creating a source file 39 Adjusting settings 40 Compiling the source code 40 Running the translated program 42 Console output 42 4 PROJECT MANAGER 45 OVERVIEW 47 Some words about the startup 47 10 StormC the professional choice Table of contents Tooltypes 47 The ScreenManager 48 Memory usage 51 Settings 51 Automatic storage 52 Automatic storage of unnamed files 53 Automatic backup copy 53 Selecting text font 53 ORGANISATION OF A PROJECT 55 Creation of a new project 55 Setup of projects 56 Project Sections 56 Adding Files 57 Adding Sources 58 Add Window 58 Adding Libraries 58 Choosing a program name 59 Drag amp Drop 59 Controls of the Project Window 59 Fo
109. e automatic opening mechanism comes into confusion You can use the automatic opening mechanism as well and test the main function at the beginning and terminate the program when required StormC the professional choice The Setup of a Shared Library PROGRAMMING OF SHARED LIBRARIES The creation of an own shared library can be very useful As soon as several programs use equal code or some functions should be available to other programs or programmers it is meaningful to build a shared library instead of using a collection of functions StormC supports you at this task so you must not care about technical details The creation of a shared library will not be more expenditure than a building a linker library Nevertheless you should know about the setup of a shared library to avoid some possible errors and to use StormC optimally The Setup of a Shared Library A shared library exists essentially of a basis structure therefore at least a struct library anda function table in which each function of the shared library has an entry Besides each shared library has a version string which you can query with the command version from the CLI The basis structure is at least one struct library but you can add further elements That is meaningful if the programs which use the shared library are accessing on some data without having to call a library function You should progress to the rule to use public data very sparin
110. e automation to make structuring easier When you do not want the editor to affect the structuring of your texts please select No Indent at the first cycle gadget Then there will be no indention after you typed a bracket On any other selection the cursor will be indented an adjustable amount of characters You can choose if this should happen when typing the bracket or after you hit Options of Text Tabulation C C Bracket Blocks StormC User Manual 95 5 STORMED Indent Brackets Indent behind of Brackets m Ensure that the vs Indent function is G active for these settings to take effect You can check the status by the I icon lt Return gt or lt Enter gt The values of Ahead of Brackets and Behind of Brackets will affect the amount of characters ahead of or behind the brackets You can adjust the values with sliders or by typing into the string gadget The range is from 1 to 16 The value does not always mean single characters because it is effected by the context of the next cycle gadget If it says Indent Spaces it will be real characters But if it says Insert Tabs the cursor takes over the value of Tab Size For example when you set Tab Size to 8 and Ahead of Brackets to 4 the cursor will indent 32 characters and insert a bracket there If you choose Insert Spaces the cursor would be moved 4 characters to the right and the bracket would be inserted here The use of automatic inden
111. e created Please activate the File text entry field with the mouse and enter Hello World cpp as file name StormC User Manual 37 3 FIRST STEPS When using the vs Debugger gt additional files ending in debug will be created for every source file In order to inform the Debugger of which modules the program consists of a file ending in 1ink will be created If you have chosen a different path for the program than the project path this link file will be created there too 38 To save the modified settings use Save As Default Icon in the Project menu You will be asked whether you wish to save the settings to the icon with the settings for the appropriate suffix or to ENV STORMC def_text info which is responsible for the global settings Work StormC Hello World Hello World cpp Save text settings into icon for all files with suffix cpp or to the default icon Special Icon Default Icon Cancel Specifying the program s name We will now specify the program name to be used by the Linker If a project does not contain one it will create a program named a out if you link it at all Please choose Select Executable from the Project menu Workbench Screen Se o Storm Le a olele pedea sel zl Sti EPR StormWizard Open new project window F4 oh ae o StormC Hello World Hello World oje He Te
112. e displayed in the convenient C syntax Many values can be interpreted differently so they will be displayed in more than one kind Integers are displayed decimal and hexadecimal Signed types LONG BYTE are displayed decimal with sign and hexadecimal without it UBYTE and BYTE also unsigned char and char are interpreted as ANSI characters when there is no control character Floating points are only displayed in decimal When they should be showed binary the hex editor must be used Counted types are displayed by their value and the name of the constant Pointers are displayed hexadecimal The address is followed by an arrow gt and the value at which the pointer shows If the pointer shows to UBYTE or BYTE it will be interpreted as a pointer to a string and the first 40 characters will be displayed additionally Structures and arrays are displayed with parenthesis and the included elements To limit the length of a value of a struct or array the numbers are viewed decimal pointers only with the hexadecimal address and nested structures and arrays only with the parenthesis Inspection allows a closer look at the values of these elements In the first line at the top short help texts will show the meaning of the icons Shows all variables and parameters of the current function and also the global variables of the module of this function Shows the global variables of all modules Variables which a
113. e following functions as private The command end terminates the function description Everything that follows in the file will be ignored Before the command end stand the function descriptions These exist respectively of the name of the function the name of the parameters which are comma separated encircled by brackets and finally the list of registers Every parameter is associated with one register The parameter of the register a6 which you may have indicated in your ANSI C function is not indicated here The function description increases bias automatically at 6 You do not have to set bias newly after each function Restraints Under StormC there is momentarily a restraint The command bias can be used no more after the first function description Theoretically it is possible to create a not coherent function table in the FD file e g because the function table contains functions which should be invisible to the user Since the FD file should be used for the creation of a function table it must be coherent The first four Functions Just one word to the reserved first 4 functions These functions are called LibOpen LibClose LibExpunge and LibNull To it comes the function LibInit which is not called over an entry of the function table The function LibInit will be called and initialised after loading therefore at the first open of the library That means particularly at
114. e to stub functions you can use pragma amicall which differs for every compiler There are the following two methods There is a file to each library which describes the calling of each function of a shared library Which parameter must be written into which CPU register is explained particularly The compiler now can call the shared library functions directly without the use of amiga 1ib These files can be found in the directory StormC include pragma and they are named like exec_lib h name of the library with appended _lib h These files will load the prototypes from StormC include clib automatically so one include of the pragmas will be enough You can tell the prototypes to load pragmas as well That is practical if they have an older source which uses only the prototype and contains no includes for pragmas For this the pre processor symbol STORMPRAGMAS must be defined You can define the symbol simply in the compiler settings on Pre processor 118 StormC the professional choice Use of Shared libraries Furthermore nearly every library has at least one include file which describes the data structures which are required for the library Example include lt pragma exec_lib h gt include lt exec tasks h gt include lt stdio h gt void main struct task me FindTask NULL printf The structure has address p n me This program uses the function FindTask of exe
115. ease use e mail if at all possible WWW homepage http www haage partner com On our homepage on WWW on Internet you will find the current information on StormC Here we also have a special support area with hints patches bug fixes and a lot of information about StormC HAAGE amp PARTNER Computer GmbH Schlossborner Weg 7 61479 Glashuetten Germany Tel 49 61 74 96 61 28 Fax 49 61 74 96 61 01 The Hotline is occupied from Monday through Friday from 3 00pm to 7 00pm o clock Please be prepared with the information the support staff members will need This will speed up the solution of your problems We prefer Support in writing because some problems can t be solved by phone so we recommend the use of e mail fax or normal mail 8 StormC the professional choice Table of contents COPYRIGHT 2 STORMC C C DEVELOPMENT SYSTEM 2 Licensee agreement 3 PREFACE 4 Preface 5 We develop to PowerUp the AMIGA 5 Technical support 7 1 WELCOME 19 AMIGA IS BACK FOR FUTURE 19 If you don t like manuals 19 If you are familiar with C and C 19 If you never worked with a compiler nor did any programming in C 20 2 INSTALLATION 21 OVERVIEW 22 Before you install 22 Localization 22 Installing with low memory 23 Full installation 24 Novice User 24 Intermediate User 24 Expert User 24 Selecting the installation directory 25 Installing an update 26 Removing StormC 26 Custom files in th
116. echnical information The LINE A instructions A123 and A124 are used to mark function calls These machine language instructions are unused on all members of the Motorola 68K processor family and trigger an exception This exception is used to update the timing and call statistics The use of exceptions has the relative drawback of reducing the effective CPU speed ie the program will take longer to execute when the profiler is running than it does when the profiler is not activated The difference will be particularly noticeable if the program invokes a lot of short functions However the profiler will still be faster and more accurate than most existing profilers for the Amiga OS The technique also buys the advantage of not having to recompile your code especially for profiling Handling of recursion is limited The longest and shortest execution times will usually be unreliable the total execution time and therefore the relative values also may be incorrect A simple case of recursion where calls shows the correct relative values but in the case of nested recursion where eg calls g which calls cumulates all times onto one of the two functions Function calls leading out of the recursion will still be shown correctly The effect on long jumps is not predictable but in most cases this should only lead to minor distortions of the statistics for the called function Theoretically speaking not al
117. ed g listing is not a gt real program since themain function is missing If you want to try this function simply make an own main function for it Surely it is not vs skilful to open g and close locale structure every time but we want to show the principles 122 lt libraries locale h gt lt pragma locale_lib h gt include lt exec libraries h gt external struct Library LocaleBase char yday 80 include include STRPTR yesterday STRPTR retval NULL if LocaleBase NULL struct Locale locale OpenLocale NULL if locale STRPTR s GetLocaleStr locale YESTERDAYSTR if s strcpy yday s retval yday CloseLocale locale if retval NULL retval Yesterday return retval This function delivers the string Yesterday of the national language chosen at local settings or Yesterday if something goes wrong If you are running AmigaOS 2 04 it is to be foreseen that the program does not deliver the desired result because locale library is provided with AmigaOS 2 1 V38 first Forced opening of a Amiga library If you really want to force opening of the library in a higher version e g graphics library version 39 or if you want to open it anyway there exists of course the possibility to open and close the library by hand Indeed you should note that you have to declare the basis pointer variable e g struct library GfxBase Otherwise th
118. ed within it Opening text will then be easier because you can double click on it s entry in the project manager New text Click on the icon New Text in the menu bar to open a new text window You can now start typing As mentioned before this is not the usual way to work You should open a new project first and then add new text with the menu item Project Add File s You will find more information on this in the chapter about Project Manager Controls of windows You will notice that there is a row of letters at the top line of the editor window Show end of line Show tabs Show spaces Autoindent Overwrite Lock editor Line Column counter Indicator for changes in text lt lt endl If you move the mouse pointer over the text icons you will get an appropriate explanation in the information line at the top of the editor window In the right top corner of the editor window you will find the line and column counters They are active for input and output So if you want to move to a certain line in your source simply click into the line counter string gadget and type the line number you want to New text DEI a Open new project window F4 StormC User Manual 93 5 STORMED o Storme Dll tea DE E Open new project window F4 o Storme l DE O a0 Open new project window F4 go to As soon as you hit
119. eld of a structure is shown individually The 4th button returns from the inspection and the value of the variable list will be the same as before the inspection The 5th button opens the hex editor and puts the cursor at the address of the variable The 6th button adds the variable to the watched variables window This allows you to build a list of variables that you always want to see even if the program is not executing the corresponding module or function The 7th button is only available on the page of the watched variables It deletes a variable out off the list of watched variables StormC the professional choice Temporary Casts The string gadget Cast allows for easy casting of the type of a variable You may enter a type here that is defined somewhere in the module Pay attention to write the type like it is shown in the variable list If the type is found the value of the variable will be interpreted according to the new type E g it might be sensible to make an ULONG a LONG to get the signed value The most often used application is to change the target type of a pointer e g to make Message an IntuiMessage At next inspection of the variable the new type will be used The old type will always we shown in the variable list The new one is only in the string gadget Cast When you want to return to the old type you must only delete the contents of the string gadget and press lt Enter gt If you ente
120. er contains most of the information needed by a linker to operate on it It is almost impossible to alter an already linked file in a meaningful way For this reason StormLink refuses to load such a file at all Overlays not supported There is nothing StormLink can do with an object file that requests an overlay In this day and age when all computers have megabytes of memory overlays are no longer of any use Please use a shared library instead Hunk is unknown There appears to be something wrong with this object file The field that was expected to contain a valid hunk type designator contains nothing that the linker can recognise Program does not contain any code After stripping any unused parts of the program the linker was left with a file that contained no code at all This program can t do anything Symbol not defined A symbol is used for which no definition can be found It was either misspelled or is missing from the used libraries If the message has a HINT parameter attached it points at the last symbol defined before the error which is usually the routine that contains the unresolved reference Symbol renamed to _stub Any references to undefined symbols are automatically diverted to a routine called stub The reason for this is that you may sometimes want to compile large projects before all routines have been written 204 StormC the professional choice _stub is undefined The stub routine si
121. esources using the menu item Free Resources from the Debugger menu or directly close the control window which will automatically close the resources Workbench Screen c o Storme IResource _ meas l SAMHHEE Save activated text F3 oO Examples iilResourcesiilResource T mje Some Resources are still allocated Hie Code Text Free them before closing window lResource c 340 a Fush _DontRush _ Cancel Vv s16 0 Work StormC Examples liResource liResaurce c Imm 7 E t sft off x Be v fis L 28 Storm fi 336836 einclude lt pragna exec_lib h gt include lt praqna dos_1ib h gt s struct Library D0SBase o MResource D void main void I s APTR memi mem2 mem3 gt 2 ee TE OF PTR Wait SIGBREAKF CTRL Ctrl C Program launched oa atiaddressioxo7eaaieotorsize neni AllocMem 12 0 Memory at address 0x078575Bs of size _1 Ctri E Z mem3 AllocMem 10 0 Ctri F I DOSBase OpenLibrary ea I Openc MODE HEWPILE lt j gt ja StormC the professional choice USING THE DEBUGGER Load the project Stormc Examples Debugger Tutorial DebuggerTutorial q The program consists of many modules with one header file just enough to also show some non trivial debugging situations Workbench Screen oj
122. essibility through the icon window makes these functions instantly available A single click on an icon is enough to cause the associated function to be executed As you have certainly already noticed a help line gives you details about these functions This feature is particularly important when you are just beginning to use StormC You will soon ignore the help line more often and remember the functions associated with the icons You will find the help also in other parts of the environment where icons are used Keyboard control The icon s functions are also accessible using the function keys lt F1 gt lt F3 gt are used for the text functions lt F4 gt lt F6 gt for the project functions and lt F8 gt lt F10 gt for the compiler and debugger functions The icon bar offers the following functions New sourcewindow Make and debug Load source Make and run Save source Make o Store Dle ea sel lk porrer Helpline New project Load project Save project 32 StormC the professional choise THE CONCEPT OF PROJECTS Before we start writing and compiling source code I d like to discuss some basic aspects of writing programs The simple way With a traditional compiler system you would start a text editor enter the source code save it and run the compiler Additionally you would perhaps also specify extra options or use the default settings perhaps kept in an environment variable The compiler wou
123. ettings to take effect on every new text you create you must activate the menu item Project Save as Default Icon Keyboard Navigation Most of the actions of the editor can be activated by special keys The following paragraphs will give you an overview about the keyboard navigation Cursor Keys You can move the cursor by the use of the cursor keys and the regular combinations with lt Alt gt and lt Shift gt keys lt Alt gt cursor left right will move it to the beginning of the word before or after the current cursor position lt Alt gt cursor up down will move to the beginning or end of the text lt Shift gt cursor left right will move to the start or end of the line lt Shift gt cursor up down will turn over one page up or down lt Return gt lt Enter gt lt Tab gt When you hit lt Return gt and the cursor stands in a text line the line will be split When you enter lt Return gt at the beginning of a line a spaced line will be inserted before this line When you enter lt Return gt at the end of a line a spaced line will be inserted after this line These actions will be the same when you enter lt Enter gt instead of lt Return gt Using the lt Tab gt key will insert 3 spaces or the value you set in the text settings Using Tabulators will improve the structure of your source so you can read it better Undo Redo One of the most important functions of a text editor is the possibility
124. etto Worta 7 ello World cpp 300 177 ie r Hello World 11072 7 stormlib 336936 amiga 203436 A 0 Work StormC Hello World Hello World cpp a Eis of af re ve ees f i j 0 Hello World aa ESS Program is waiting for signals 0x00001000 to arrive include lt iostream h gt Pause Kill I O Sc void main cout lt lt lt lt endl Ctrl C Program launched Ctrl D f Ctrl E _ctri e ArtEffect The program will still be executed very fast but keep the console window opened Close it by clicking the window s close gadget StormC User Manual 43 3 FIRST STEPS 44 StormC the professional choise Project Manager 4 s you have worked through the beginning tutorials you have heard about the project manager This is something new to Amiga compiler systems but it is a common thing on other computer systems such as the Macintosh or IBM PCs One of the goals of the development environment is to make work easier and more efficient The project manager is a big step in this direction If you look at traditional development environments you will recognise that every effort was made to build tools around the compiler because it was the heart of the system Nowadays this has changed The heart of the system is the project manager It assembles all parts of a project and it navigates and controls every part of it The following ch
125. for the four reasons of the introduction to this chapter StormC has a RunShell It will launch the program similar to a start from the CLI yet it caters for a whole range of ways to control and direct the program A special feature is Resource Tracking which solves problem 3 for example After the program is interrupted or finished all resources that have been allocated but not freed will be shown The resources are then freed by the RunShell Next the position in the source code where the resource was allocated can easily be jumped to Connected to this RunShell is the Source Level Debugger It allows you to execute programs step by step localise errors or inspect variables But also directly control the program and always find the origin of problems in the worst case a crash in the source code Additionally it is possible to halt the program for example in endless loops without having to compile the program in a special way The StormC Maxim The program is in the test phase is equal to the final product To be able to use the source level debugger you need to compile with the corresponding option yet this doesn t influence the generated program This prevents the problem other systems from time to time have bugs that show up when running a program under normal conditions can t be reproduced using the debugger A further special feature is the ability to switch from normal execution to the debugger and to return f
126. functions in one section default Library mode Create an own section for every functions and global variables No optimisation default With optimisations Generate code for 68000 default Generate code for 68020 Generate code for 68030 Generate code for 68040 Generate code for 68060 Do not generate code for FPU use default Generate code for 68881 FPU Generate code for 68882 FPU Store pre compiled header files Load pre compiled header files Do not use pre compiled headers default Set path s StormC should use to look for includes It is possible to use multiple i for adding more paths The default is Stormc include Abbreviation for gL Sets an other name for the object file Abbreviation for go Alternative for go Turns on the optimiser level 1 Turns on the optimiser level 2 Turns on the optimiser level 3 Turns on the optimiser level 4 Turns on the optimiser level 5 Turns on the optimiser level 6 Switches to ANSI C mode Switches to C mode default No exception handling pX With exception handling S Outputs the copyright message and the version number of StormC t Create faultless template functions only T Create all required template functions W XXX Output warnings An arbitrary sequence of characters can follow Big ones will turn on warnings small ones will turn them off There are the following warnings A Assignment Operators appea
127. fyou should not agree with this license agreement you have to return the product to the supplier immediately June 1996 4 StormC the professional choice PREFACE We develop to PowerUp the AMIGA Here it is at last a new compiler system that gives you the ability to develop powerful applications for the Amiga more easily efficient and very fast It is a completely new development system that gives you the tools you have been missing on the Amiga for a long time New concepts and a look forwards into the future Some a 18 months ago we asked ourselves why is there no development system for the Amiga that beats those of other platforms such as CodeWarrior Macintosh or BorlandC These programs make it so easy to create good programs So we started to look for good people who could realise this vision After a short time we found them Jens Gelhar He did the first C compiler for the Amiga in 1992 Now he puts all his experience into the StormC compiler Jochen Becher He is one of the founders of HAAGE amp PARTNER He did his first compiler some years ago Then he programmed a source level debugger for a C compiler and one of the first C Class Libraries for the Amiga He is the Project Manager of StormC and he is the father of StormShell and the project manager Michael Rock He too has been programming on the Amiga for a long time He is responsible for the very fast and very compatible StormLINK StormC s
128. g gadget To disable a special pre processor symbol for the next compiler run you can simply mark it with the mouse It appears in the string gadget below the listview and you can enable disable it by clicking the gadget on the left side The controls for define are nearly the same as those for the include controls in the previous section This will create a new entry in the list and the string gadget will be activated Type in the name of the new definition e g STORMPRAGMAS and press lt Return gt The new pre processor symbol will be inserted in the list now and it is activated If you interrogate ifdef STORMPRAGMAS you will get the value TRUE With Remove you can delete the marked item from the list You can not only define a symbol you can also assign a value to it You can enter any alphanumeric character into the string gadget Unfortunately the compiler only accepts one character per symbol so the entry 11 5 will only take the and ignore the rest More complex definitions will need to be done directly in the source but you can use it for symbol definitions for flags like NDEBUG Even at runtime of the pre processor there can be language constructs that are syntactically and semantically correct but that might be programming errors This warning appears when embedded comments e g This is a comment are found since there might be a missing at the end of the comment Pragma state
129. ge of projects DE era 9 idow F4 STORMC S PROJECT MANAGEMENT Similar to batch files a StormC project contains a list of files and settings This is however created visually which makes it easier to use and to understand A StormC projects unifies all parts belonging to a program so that they can be managed centrally This includes files which do not don t directly affect the creation of a program such as AmigaGuide documents and ARexx and Installer scripts The project manager has similar properties to a Make program and reacts accordingly when multiple source files are used Dependencies between source files and header files are also no problem Creating a new project The most important step to compile a source file using StormC is to create a new project Source files can t be compiled without being associated with a project This may appear to be a limit at first but will save you a lot of trouble later on Creating a project is really simple and helps to keep your programming efforts ordered Please click on New project in the icon bar A new project window will be displayed Workbench Screen a 336936 amiga lib 203436 34 StormC the professional choise What is a project e e What is a project a The illustration A project unifies everything belonging to your program C SS next to this text C and Assembler source files header and object files link shows a new librar
130. gging information i l oj Storme S x r s y Ff JSENMFPEREAL E lt 4 Save activated text F3 StormCPP StormWizard o Examples tiiResourcesiilResource T MResource c 340 516 v sone 338938 include lt pragma exec_lib h gt inclade lt pragma dos_lib h gt s struct Library D0SBase n Resource void nain void Z gt 21 gt Pause n Ctrl C Program launched Ctrl D at address 0x07844160 of size Ctrice Memory at address 007857568 of size Ctri F Dg a0 i APTR mem1 mem2 mem3 BPTR f Wait SIGBREAKF CTRL 6 memi AllocMem 12 0 mem3 AllocMem 10 0 DOSBase OpenLibrary f Open MODE KEWPFILE 237 5 KP lt j gt StormC User Manual 155 7 THE DEBUGGER 156 In a real program you could now start on writing the appropriate code to free the resources Where this should be done of course depends on your program To be able to show the position in the source code where resources are allocated incorrectly one condition must be fulfilled The corresponding OS function must be called directly in the source code This rules out calls from link libraries i e OS functions should not be called via amiga lib and the stub functions contained therein but instead always use the correct pragma amicall and pragma tagcall calls Now free the r
131. gly for the accesses through other programs whether reading or writing can not be record in the library You must also pay attention in future versions of the library that these data will keep the same sense which is not always too simple It is safer and more simple for you to hold the data of the library in normal global variables The access should be by a function even if these are only very small functions which deliver the value of a variable The dos library uses this principle intensely since AmigaOS version 36 e g to make accessing of structure more save StormC User Manual 123 6 COMPILER P If you have vs divided your gt library in several modules pragma libbase should be called in one source only The pragma Libbase The name of the basic structure must be told the compiler at a position in the source This will be done with pragma libbase For example include lt exec libraries h gt struct MyLibBase struct Library library ULONG second_result pragma libbase MyLibBase Register Setup The functions of a shared library receive their arguments from a CPU registers data like int LONG char etc in data registers d0 to d7 and pointers in address registers a0 to a5 You should count data register starting from do and address registers starting from ao But you should forego a5 since this register is used by almost every C function to set up a so called s
132. h Adding Files There are various ways to add a file to a project The normal way is to use the menu item Project Add File s As you will see there are four entries that deal with this matter StormC User Manual 57 4 PROJECT MANAGER A description of g the usage of the ASL filerequester can be found in your Amiga manual Adding Sources Sources are all ASCII files of the project A fine distinction will be made by the file extension When choosing the menu item Project Add File s you will have the option of selecting one or more files to add to your project The ASL filerequester is used for this 66 67 79 16 13 79 16 13 79 pattem fi owe tomo me fosan Ok Volumes Parent Cancel When choosing several items at a time they will be inserted alphabetically If you would like to have them in another order you must select them individually Add Window The menu item Project Add Window is available only if there is an active editor window Choosing this item will add the filename of the text of the activated editor window to the project If you didn t gave a name to your text file before this you will get the opportunity to do it now Adding Libraries To make adding of libraries easier there is a special menu item called Project Add_ Librarie s The ASL filerequester will come up with the library path you selected in project settings so you can add libraries very quickly 58
133. h startup message In order to support ANSI C the storm 1ib library contains standard functions that redirect the calls to main The standard main_ function parses the CLI command line arguments and stores them in an array which is then passed on to a function labeled main__iPPe which is the C function main int char If no such function exists the ANSI C main function is called This function at least must be defined otherwise the linker will emit an error The standard function wbmain_PO9WBStartup simply calls _wbmain which is the ANSI C function wbmain struct WBStartup Should there be no definition of this function the program exits As a result starting a CLI only program from the Workbench will exit quietly instead of causing a system crash These functions are all defined in the storm 1ib library and may be overloaded if desired for instance to make wbmain print an error message if the program cannot be run from the Workbench The startup code module defines the following symbols The ANSI C exit function This will call CleanupModules and subsequently exits the program correctly The abort function used if no alternative has been configured using the signal function It exits the program without calling CleanupModules Exiting a program in this way makes little sense as libraries will not be closed and other resources eg allocated memory will not be freed
134. he appropriate declarations for your functions After all the const qualifier is an important aid in assuring the correctness of your program Rest of line comments as in C are accepted even in ANSI C mode but nested C style comments are not In any case you can enable the warning option that detects these dangerous cases Accents in variable names are not accepted nor is the dollar sign Keywords The use of non standard keywords is generally best avoided at least for programs that you may want to port to another operating system or a completely different compiler someday Syntax nee StormC User Manual 131 6 COMPILER _ aligned _ chip _ far and _ near StormC makes more use of the pragma directives provided by ANSI C for adapting software to the special requirements of AmigaOS eg pragma chip and pragma fast For keywords that may not exist in other compiler systems but are not absolutely necessary the use of special macros is recommended define INLINE _ inline define REG x register _ x define CHIP __ chip These macros can then be easily modified to suit a different compiler environment Some optional keywords not recognized by StormC can also be defined as macros define _ asm define _ stdarg Here s a list of SAS C keywords and how StormC interprets them is not supported There is no simple way to replace this keyword but fortunately it is rarely needed This keywo
135. he program I11Resource that currently waits for a Ctrl C before it allocates the resources Now select the Ctrl C button in the Signals group 154 StormC the professional choice Sending signals The program has now allocated some resources but it didn t free them again The program has finished Workbench Screen i l oj Storme X ms F bly j xy Olele edea sel amp 2 AEN Save activated text F3 StormCPP StormWizard o Examples iiiResource illResource J ft IC Text 7 lResource c 340 401 v A 516 7 storm lib 336936 Aj fed F lt gt lt 7 o Resource 125 Program is waiting for signals 000001000 to arrive Te Pause e oe Ctrl C Ctrl D Ctri E Ctri F Program launched The protocol list shows information about resources that were allocated and not freed This involves memory allocations libraries and a file Double click a line in the protocol list and the position in the source code where the resource was allocated will be shown If the source code wasn t available in an editor to begin with a new window will be opened and the source code will be read Workbench Screen Even though SS Resource Tracking always works and the Runshell always frees the resources the source code position can only be shown if the program was compiled with debu
136. he status line in the control window shows Breakpoint reached after each step When you take a step that takes longer for example when reading input from the console you can also read the Program continues message At some point you ll reach the gets s statement on line 25 When you step through this function you will of course have to type the corresponding input in the console window Please enter lt 1 gt and then lt Return gt In the switch statement you ll now enter the first branch On line 29 you ll find the function call for the function readAddressmask This function resides in the address c module Don t select the step over button but instead choose the second button from the left to execute the program in single steps This way you ll enter the function readAddressmask The source for the address c module will now be loaded and the source code position will be shown Now go step by step through the function Depending on whether you use the second or third of the debugger icons in the control window other function calls will either be stepped through or executed without stopping When needed enter name first name street and place of residence in the console window Before ending the function you can try the 4th button from the left in the debugger group This one will execute the program without stopping until the end of the function is reached and you will return to the main program again
137. her the function was actually generated in a compiler Therefore similar instructions like for the memory class static will apply for inline The declaration sequence inline void f void f is allowed void f inline void f ERROR is not allowed By the way inline is not a memory class like static or external but a function specification The Pragma instructions Despite the ANSI specifications each compiler has its own peculiarities These specific things are introduced with the key word pragma pragma lines will be interpreted by the pre processor like include lines With pragma you can realise compiler specific functions which are not standardised explicitly Compiler mode pragma is a non standard feature switches StormC into ANSI C mode pragma switches the compiler to translate the source in the C mode Data in Chip and Fast RAM The architecture of the Amiga is somewhat unorthodox So there are two or sometimes even more different types of 110 StormC the professional choice The Pragma instructions RAM Normally programmers are only interests in using Chip or Fast RAM because they must care for that graphic data are stored in chip memory StormC therefore offer the pragmas chip and fast All after the line pragma chip declared static datas will be loaded into Chip RAM pragma fast switches back to normal mode Now data will be stored somewhere h
138. hich can be used analogue to extern auto or static Register variables may be declared only within functions Otherwise you can use them freely You may declare as many variables as you want form different types as register the compiler decides later on which files to store in a register Integer and pointer or reference variables may be put into registers whereby numeric types are stored in data and pointer types in address registers However you should be careful not to use registers too extensively because the processor will need at least one register for practically all operations When you are using too many of them for variables it must evacuate them sometimes for a short time on the stack and load them later again Then you can not expect an increase in speed As a rule you should not use more than four integer and two pointer variables as register in one function StormC does not use your statements obligatorily Indeed it takes them only as reference The optimiser of StormC can decide essentially better which variable to which time in which register is to be loaded best Furthermore StormC uses the registers repeatedly in a function which you can not make by using the key word register StormC User Manual 107 6 COMPILER p This does not g corresponds to gt C standard You should insert this feature therefore as carefully as possible since the programs are otherwise no more portable It is best
139. hs for Includes j Paths for Libraries 1 Linker Libraries p Parser s Copyrights wWWarnings and Main Memory Size Options are always global At a line of the form StormSYS StormC x textl c y text2 c z text1l c and text2 c will be compiled equally with the options x y and z In other words The sequence of file names and options is not relevant The sequence of the options mutually is not alike if contradictory options appear in an instruction line For instance you turn on with gO the optimisation and with go off In cases like StormSYS StormC go gO etc the respectively last statement is valid Not only for the optimisation but for almost each feature there are two options one to switch on and one to switch off At first glance that appears superfluously because e g the optimisation is not activated by default and so an option for switching it off is not really necessary At the most switching possibilities the way was chosen that you switch on with an uppercase letter and off with a lower case letter like go and go The most important example is the option b for the creation of debugger files The option switches are defined through appendices of a Zero b0 means therefore No debugger files In some cases abbreviations are introduced also e g o is identically with go A two letter combination through StormC User Manual 135 6 COMPILER a and as an indivi
140. ical Indeed the options g40 and g60 differ drastically from the others Since some FPU functions are not implemented they must be emulated At code generation for 68040 060 processors particular libraries are used to create no FPU commands like it is done in other compiler systems The use of a Floating Point Unit FPU will speed up programs that use many floating point operations float and double With the following options StormC creates code for FPUs g80 without FPU Default g81 68881 140 StormC the professional choice Debugger gg g82 68882 identically with g81 Code for linker libraries If desired StormC can put each function and each global gl gL and L variable in separate hunks As the linker does not takes non referenced hunks into the executable program file this mode suits particularly for linkable libraries With gL or L this option is turned on g1 switches to normal mode Debugger RunShell b creates the necessary debugger files debug and b and bO link b0 switches to original mode Symbolic debugger The option bs creates symbol tables hunks for symbolic bs and bsO debuggers Copyrights The option s outputs the following text at the call of the compiler Programname versionnumber creationdate copyright author Example StormC 1 1 07th05 96 Copyright c 1996 HAAGE amp PARTNER computers Ltd Warnings and errors
141. ies documentation graphics pictures and other Projecten e ted bya simple resources The collection remains easy to manage through lick on the New project separation into different sections The project manager is 0 The project s however also a visually orientated Make preferences can be modified freely and saved as default ttings f jects Make and module dependencies e ee At every compiler run the dependencies between o lh ass asm i and c files of course also ec or cpp will be evaluated and passed to the project manager This allows the project manager to know that a C source file needs to be recompiled when a h header file has changed that is being included in the c source When you click on Make Run or Debug all dependencies will be checked and Make decides which program modules need to be recompiled and which do not The only difference between Run and Make is that Run after successful compilation automatically runs the program Selecting Debug will automatically start the Debugger after compilation Saving the project and creating a new directory Before starting the next step please save the project and create a new directory for it Please click on the Save project icon In the displayed standard ASL file requester please choose the Stormc directory and enter as file name Hello World Hello World StormC User Manual 35 3 FIRST STEPS a The g
142. ill stay open so you can load another one or start typing a new one When text has not been saved before you will be asked to do so or to accept the disposal 94 StormC the professional choice Options of Text Before explaining further functions of StormED you will need to know more about the options of the editor The following sections will always refer to these options because most of the functionality of StormED depends upon it The chapter Project Manager has already explained the global options of the editor so here we will only discuss the text options To get the options requester you must activate an editor window and choose the menu item Settings Text A requester will appear on the screen similar to the one of the project options At the top of the requester you will see paging gadgets with the following titles Tabulations and Indents Work StormCi jor wheel ColorWheel c Textformatting Coloring l File l Sai er CI Indent Behind Bracket Ez Inse Before Bracket W Behind Bracket E 1 i You can change the width of the tab stops with the slider or you can type its value into the string gadget Values between 1 and 16 are allowed Most C programmers use a special structuring of their source to get a better overview There is no standard instruction for this and so there are many possibilities of how this can be achieved We therefore leave this up to you You can configure the options for som
143. in the project I advise you to switch on this option during program development because only in this case will you will get a detailed error message about errors in the template But if you are working with finished template libraries or if you are porting an existing program there might be a need to switch off the generation of templates If you ask asking yourself why you have to care about the right strategy I will tell you how to implement a function template correctly e Do not create templates the first time you compile your code e The linker tries to link the project and generates a list of all undefined functions e Inthe final compiler run all modules that might contain a helpful template definition will be compiled anew With the help of the list generated by the linker it is clear which functions must be generated Such an implementation would not only be very large scale but also very slow because some modules must be compiled twice every time Exceptions Sometimes it is an advantage if you compile a classic C program that does not use exception handling in a special compiler mode The related keywords catch throw try will not be recognised and in the created code there is no book keeping of the needed destructor calls If Use Exceptions is switched off exception handling is not possible any more Using Exceptions StormC User Manual 75 4 PROJECT MANAGER Small Debug Files Fat
144. indow When the text is need the next time the breakpoints are automatically added This way two or more source windows can be used The item Show PC of the Debugger menu has the same effect Pause Stops the program while the button is lowered The program will be removed from the list of running or waiting tasks Processing of signals received while the program was paused is not guaranteed The menu item Pause in the Debugger menu has the same effect Kill The program will be halted abruptly No care is taken that the program isn t executing within a Forbid Permit or hasn t got a screen locked Kill is therefore not safe under all circumstances The menu item Kill in the Debugger menu has the same effect Priority gadgets The program priority can be altered from 128 to 127 it is however recommended to leave the priority in the 20 to 20 range to avoid conflicts with certain OS tasks Normally the priority is set to 1 so it is one time lower than the priority of the debugger and it will run perfectly Signal group The signals lt Ctrl gt lt C gt lt Ctrl gt lt D gt lt Ctrl gt lt E gt and lt Ctrl gt lt F gt can be send at any moment They are useful for simple program control while testing Protocol gadgets The list itself shows all resources for which no corresponding free statement was executed By double clicking a line you can show the source
145. ional choice Sorting of Variables The help line shows the cumulated CPU time This value is the amount of real CPU time used ie it does not include time that the program spends waiting for signals messages or I O or time used by other programs that are running in the background The list below shows the functions including the following information Member functions of a class are displayed using the scope operator syntax class name and member name separated by two colons This counts only the time that the program spends in the function itself or in OS functions called directly from it Any time this function spends calling other functions in the program is omitted This value provides the best hint as to which function uses up the most time The sum of all values in this column will be 99 100 the missing percent is lost in startup code and minute inaccuracies Here all subroutine calls from a function are included in its running time For this reason the main function will normally show a value of 99 These three lines give you a quick overview over the invocations of each function Just how a function can be made faster often depends on whether the invocations generally take roughly the same amount of time to finish small difference between longest and shortest running time or some invocations take noticeably longer to complete than the others great difference In the latter case it may be profitab
146. ironment you can simulate this manner of parameter handling Program cu Commandname J Arguments I I Console Console JEON V201 150 leAUTOS Input Jessa age Output Rea cist ra The CLI command name is the name that is handled by argv 0 Stacksize Taskname Current Directory PROGDIR Command Name StormC User Manual 87 4 PROJECT MANAGER Arguments Width Height Title AUTO ALT BACKDROP CLOSE Here you enter the arguments that will be given to the running program by the development system 1 0 Settings You can choose between Console and Files for Input Output Console will use stdout and stdin Normally a console is opened with con When you want a window to be opened with special attributes you must provide further data You can enter the starting size the position and title of the window The syntax is as follows CON x y width height title options Number of pixels from the left border of the screen to the left border of the Shell window When you do not enter a value the lowest number of pixels will be used Number of pixels from the upper border of the screen to the upper border of the Shell window When you do not enter a value the lowest number of pixels will be used Width of the Shell window When you do not enter a value the lowest number of pixels will be used Height of the Shell window When yo
147. is caused by such constructs as extern long printf printf 0 which is absolutely fatal to the program The VERBOSE option enables this warning Code access to data This error is currently disabled as it would give false alarms continually I have yet to find an assembler that can generate the necessary data references and does not use the same type of reference for code and data all the time InitModules not used but not empty All modules that need any kind of initialisation export a so called constructor and a destructor for cleaning up afterwards 202 StormC the professional choice StormLink automatically generates code to call these routines The program first calls the InitModules routine usually from the STARTUP O startup code which in turn calls all the constructors If this is not done ie if the routine is never called yet does contain code the program cannot be correct unless it would call all INIT_xx and EXIT_xx routines by itself Seeing that the linker knows best just what is in the list of necessary routines and what isn t you shouldn t even try to do this by hand In strict accordance to Murphy s Law one will always be forgotten CleanupModules not used but not empty See error 12 File not found The problem is obvious StormLink can t find any file with the name you specify Unknown number format StormLink has its own parser to recognise and process different numeric notati
148. ive a program an unique version number include lt iostream h gt void main cout version 1 1 from that _ DATE TIME clock n The date has the format month day year e g Mar 18 1997 and time of day will be hour minute second __FILE__ This macros contains the name of the current source file as a string e g include lt stream h gt void main cout That stands in line _ LINE in file FILE n StormC User Manual 115 6 COMPILER The value of the macro __FILE__ is a constant string and can be joined with other strings standing before or behind it __LINE__ The macros __LINE__ delivers the line number in which it is used as decimal int constant __FUNC__ The macro __FuNc__ delivers the identifiers of the translated function Aztec compatible in ANSI C mode In C mode it delivers the qualified function name along with the parameter list __STDC__ This macros delivers in all ANSI C compatible implementations the numerical value 1 This should tell you whether the compiler supports this standard Otherwise __stpc__ is not defined __STORM__ You may want to know which compiler and version one is using Therefore StormC defines the macros named __STORM__ __ TIME _ see __DATE__ 116 StormC the professional choice Build your own INIT_ and EXIT_ routines Build your own INIT_ and EXIT_ routines If you are writing your own INIT_
149. l The makescript then invokes the StormLibrarian which not only automatically generates the library but also declares the linker library as an object using OBJECTS and all object files in the list as dependant files using DEPENDENCIES After the first Make this will cause the linker library to be created anew whenever any of its C or assembler source files has been recompiled The library will also be recreated if its list of object files has been modified using the StormLibrarian fd2pragma srx This makescript translates an FD file into a header file containing the necessary pragma amical1 directives for a shared library This script shouldn t normally be necessary StormC the professional choice Saving of the paths as the linker writes this header file automatically whenever a shared library is linked Saving of the paths When saving a project you will give a filename and a path for storage Before you save a project all files are stored with their full path which is sometimes very long After the save all these paths are shortened to relative paths This means that all files that are stored in the same drawer will be stored with their name only The path is no longer relevant StormC User Manual 69 4 PROJECT MANAGER PROJECT SETTINGS Every project has its own settings for the compiler linker and RunShell Maybe that doesn t sound difficult but there are many settings and connections that should be
150. l lt LONG D2 gt 0 0x00000000 At the first line of the window a short help text is shown which tells you the meaning of the different buttons of this window SS X Below this line is the button line On the left side there are R 4 buttons to select one of the 4 variable pages x m Ls aid StormC User Manual 159 ys 7 THE DEBUGGER 160 e fF p Oxal ge He w The 1st page shows all parameters and local variables of the current function and the global variables of the module that contains this function The 2nd page contains all global variable of all modules The 3rd page shows the variables that should be supervised This can be local variables of functions or even parts of a structure members The 4th page contains the cpu register values Choose the first variable address out of the list of the current variables by selecting its name Next you can also reach other elements of the window Next to the buttons for paging you will find these for actions on the selected variables By selecting the 1st button the source code position where the variable is defined 3will be shown by positioning the cursor there The 2nd button is interesting for C programmers It shows a list of all member functions of the type of this variable This list will be empty because in this example there are no member functions The 3rd button inspects a variable The variable will be looked for very exactly e g every fi
151. l machine code while doing some optimisations The assembler source generated by StormC correspond exactly to the code which is translated to machine code directly So you do not need the help of a re assembler to look at the quality of the generated code If you want to have the corresponding C source as a comment within the assembler source you should select this option Code Generation A hunk will be generated for every global variable and every function during code generation As a result the linker can eliminate every unused function and the code size will 76 StormC the professional choice ANSI C C Settings decrease This is very practical if you want to program a library but it has a price functions of a translation unit can not use identical strings collectively and they cannot call each other via PC relative addressing This can result in a larger slower program Processor Specific Code Generation The proven MC68000 processors are a dying species in the Amiga world 32 bit processors 68020 to 68060 and Floating Point Units 68881 and 68882 have prevailed So programmers have new and powerful machine commands which give them a sometimes astounding increase in speed The 32 bit processors have some important features like the operators for longword multiplication and division and for the handling of arrays and bit fields By using the cycle gadget you can tell the compiler which code it should generate 680
152. l be initialised to a non constant type with a non L value and a temporary object must be inserted As this rule did not exist in the first standard there is no real error message but a switchable warning 80 StormC the professional choice Compiler Warnings An example void dup int amp ir ir 2 void main int i dup i OK long 1 dup 1 ATTENTION As I must be converted from int to Long a temporary object must be inserted The programmer will be surprised because at the second dup call there is a side effect on the argument So the new C rule is very sensible Security If there is no return statement in a function which has Missing Return non void return type then there is certainly something wrong You should always switch this warning on A statement like 69 makes no sense so there is probably Empty Statement something wrong with it A well known error is the call to a parameter less function without an argument list e g test instead of test This option is warning if there is an implicit type change Unsure Statement without CAST from integer to floating point types This is a popular construct if a b It is correct and Suspicious many programmers like it very much but it is a beginner error as well if it is used instead of if a b If this option is active there will be a warning if an follows a logical expression e g if while or
153. l functions can be measured Only functions whose machine code starts with a link or movem instruction are available to the profiler One of these instructions will however be necessary in almost all cases StormC User Manual 167 7 THE DEBUGGER even at the highest optimization levels And fortunately any functions that do not need these instructions will be so small no variables on the stack only the registers d0 d1 a0 and al are altered that optimizing them any further would be near impossible anyway Inline functions generally cannot be measured 168 StormC the professional choice Control Window REFERENCE Control Window The control window is used to direct the program and for resource tracking It is opened automatically at the start of a program Program stopped at Breakpoint gt x Leli eel guni e e E Ctri Program launched Ctri D Ctri E Ctri F Status line Show short help texts about control window gadgets in text colour black and program status messages as important text white Program Stops At Breakpoint The program reached a breakpoint and stops This can also be a breakpoint set by the debugger to make it possible to interrupt between C and C statements that often exists of more than one machine code command Continue Program The program is running Program waits for The program waits at an exec function wait for signa
154. l the compiler where the headers ends and your program begins you must mark this position with the command pragma header It is best to write the include s of the header files you did not do by your own or which you will not change any more at the first place in the source of all units Then the line pragma header follows Next parts are the include instructions for your own header files and the rest of your program 144 StormC the professional choice Without special option or with the explicit switch ho pragma header has no effect If you indicate an option H lt name gt the compiler stops shortly as soon as it reaches the pragma and writes all definitions and declarations into the file lt name gt To accelerate the program compilation now you must choose the option h lt name gt Then the compiler reads the pre compiled headers from the indicated file searches the source for pragma header and continues this work form there Since everything which stands before pragma header is completely ignored it has to stand consequently in the main source file and not in an include file Please keep in mind that the compiler does not check whether the content of the pre compiled header files still corresponds with the original source Therefore I recommend to compile such header files only which will not be changed any more Summary Now a short alphabetically organised summary of all options follows
155. ld then create an object file and you would run the Linker to get an Executable Finished An easier approach through batch files It would be easier if you created a batch file containing the commands you previously entered manually After a change to the source code you d then only need to run the batch file This ease would be clearly perceptible which results in higher turn around times and thus in a higher programming efficiency This approach has no disadvantages as long as you re only working with a single source file As soon as you integrate two or more source files into the batch file every time you call it you would have all source files compiled regardless of whether a source file has been changed or not Thus the turn around times would always stay the same With some little expense it would be possible to check whether a source file is newer than its associated object file but that would be all you could do in a justifiable amount of time Another major aid in this case is a so called Make program which only passes modified source files to the compiler and also supports dependencies For details about Make refer to chapter 4 for a more intensive discussion The simple way StormC User Manual 33 3 FIRST STEPS StormC basically works with gt projects Source files can only be compiled when they re part of a project Read the following introduction step by step and you will learn about the simple usa
156. lding of Sections 60 Showing Sources 60 Starting a Program 60 Open a Child Project 61 Keyboard control 61 Cursor keys 61 Return 61 Deleting Items of a Project 61 Organising files of a project 61 Project specific headers 62 Documentation scripts 63 Makescripts 63 Passing arguments to makescripts 66 Assembler scripts 67 Saving of the paths 69 PROJECT SETTINGS 70 Paths and global settings 70 Include path 71 StormC User Manual 11 TABLE OF CONTENTS Header Files 71 Working memory Workspace 72 Definitions and Warnings 72 ANSI C C Settings 74 Source 74 Template Functions 74 Exceptions 75 Debugger 76 Code Generation 76 Processor Specific Code Generation 77 Quality of the Optimisation 78 Optimising 78 Compiler Warnings 80 Standard of the language 80 Security 81 Optimisation 81 Path Settings and Linker Modes 82 Generation of Programs 82 Library Path 84 Warnings 84 Optimiser 84 Hunk Optimisations and Memory Settings 85 Summarise Hunk 85 Manner of Memory 86 ROM Code 86 Call of the executable program 87 Execute Environment 87 Start From CLI 87 1 0 Settings 88 Input Output 89 Save Project 89 5 STORMED 91 IN GENERAL 93 New text 93 Controls of windows 93 Open Load Text 94 Tooltypes 94 12 StormC the professional choice Table of contents Save Text Save Text As 94 Free Text 94 Options of Text 95 Tabulations and Indents 95 Indent ahead and behind of brackets 96 Dictio
157. le QUIT Remove StormLink from memory Compatibility StormLink is highly compatible with BLink and with SLink from the SAS C package StormLink supports both the SAS C library format as the SAS C constructor and destructor features Combined use with StormC poses no problems so you may use them together Error Messages One design goal for StormLink was proper behaviour under error conditions All error messages consist of several parts First comes either the word Warning or the word Error followed by the number of the error message Then comes a brief explanation with some parameters similar in appearance to a command line This enables you to quickly find the necessary information The following message parameters may occur This keyword is followed by the type of the hunk in which the error occurred ie Code Data or BSS Indicates the object file in which the error occurs As the job of the linker is to combine object files some errors are caused by more than one file In such cases the FROMFILE keyword indicates the file containing the problematic reference and TOFILE shows the object file it points to Shows the name of the symbol involved in the error Shows the file offset at which the problem occurred This parameter is printed only in the case of a multiply defined symbol it shows the name of the file containing its first definition 200 StormC the professional choice Error Messages Foll
158. le to optimize those special cases Sometimes a function makes up a large chunk of the program s running time only because it is called very often but each individual invocation takes up very little time Optimizing such a function is usually a tough nut to crack However it may be very beneficial in such a case to declare the function inline __inline in C inline in C 1 Function name 2 Relative running time 3 Relative recursive running time 4 Absolute running time 5 Longest running time 6 Shortest running time 7 Number of invocations StormC User Manual 165 ys 7 THE DEBUGGER 166 Above this list are several controls related to the profiler display The uppermost line is the help line which shows brief descriptions of the controls Directly below that to the left you see three buttons The first of these updates the list of functions The second button lets you save the profiler display as an ASCII text file A requester will appear to let you select a file name The third button dumps the information to the printer using the PRT device On the right hand side of this line are the sorting controls for the function list The first entry Relative sorts the list by the values in the second column Recursive sorts by the third column and Alphabetic sorts alphanumerically by the function name shown in the first column And finally ca11s sorts the list
159. li aint Manan R R 63 Passing arguments to makescripts 200 000 cess sseeceeeceeerereceeeees 66 Saving of the paths oo eeecetececseeeesceeseeseeessssesesseeesseeeeesaes 69 PROJECT SETTINGS oou cecccccsccsescccssssssessessessssssecsessessssessecsessssesseesecsssessesseeseenees 70 Paths and global settings 000 000 eecteeceecscsescsseeececsssssseeeseees 70 INGHUG path ciccssccvasccostecsttis Geincessascvetigentes recedastesessiavbeossicantednesestedveedtoaedesivoveotates 71 Header Files icctzisccsccssisseessscsiecsssvsneevescavssesvecesssuetgoneseed vasueceversuseuasevsesusesteorsosnesvnees 71 Working memory Workspace ssccsssscssscssscssscessccsscsessscescsssssessesesssseseseeseoes 72 Definitions and Warnings 20 ec ceeteecscecsseesceseescessssssssseseees 72 ANSI C C Settings 3 23 cc csasiea ined die eiiablieiindaitsls 74 SOUP CO ooer A OEE teetuaiversstecscentesstes ETARE 74 Template FUNCTIONS sissors srn tanes eoa Ea E i aoi eaii 74 Exceptions mennie atea A E AT E A E EEEE 75 Deb gger soson a E aE EE E E E ETORRA 76 Code Generation ocne ioiii EE E A a EE RO 76 Processor Specific Code Generation sscssccsssccssscsssccseccesscessscesssessceessscssesenees 77 Quality of the Optimisation 00 0 ececececseeeesecnseessessenseees 78 OPELINISING M E A E A 78 Compiler Warnings 00 eecceeteecceensssessesestsseseststsesseseees 80 Standard of the lANQUAGE cssccsssscssccesscessscessscssscsssscesssessscesssessseeesonssseesone
160. linker Now he is working on the PowerPC code generation as well Besides these guys many others did a good job of suppor ting StormC during development There are assistant programmers beta testers many programmers using the demo version and reporting their wishes to us and the customers who always encouraged us to do a little more We released the International version of StormC to make its power available to every Amiga programmer Now it is up to you to PowerUp the AMIGA with your fine programs We are now working on the next step towards the future the PPC version of StormC for the new PowerAMIGA StormC User Manual Preface PREFACE 6 Now we want to thank our beta testers and all the people who supported us during the development of StormC Thank you very much Olaf Barthel Holger Burkarth Thomas Bayen Bernhard B chter Jan Claas Dirks Mario Kettenberger Alexander Pratsch Michael Rock J rgen Schildmann Stephan Sch erholz Thomas Wilhelmi Heinz Wrobel Special thanks to Jeroen T Vermeulen Particular thanks goes to Gudrun Volkwein Bernadette Becher and Hartwig Haage StormC the professional choice TECHNICAL SUPPORT In case of problems concerning StormC you should 1 Check your installation for completeness and read the ReadMe file Check the installation of your operating system for completeness and verify that all relevant parts contain the right version numbers at lea
161. ll find the size of the output code of compiled or assembled sources linked programs and libraries This section remains empty for header or other files which are not translated by the compiler On the right side of the window you will find the text size of script files e g ARexx and Installer scripts or other ASCII files In our example this section is empty because these are libraries without source so their size is unknown Project Sections If there were no project sections all data of a project would be disorderly You would only recognise the meaning of a file by its extension it it had one To get a better idea of which files are which we included the project sections StormC the professional choice Adding Files All project sections start with a title The following picture of the project sections contains the section Libraries at first So all following lines it is only one in this case are libraries which should be used by the linker Sections Objectcode size Sourcecode size Tan In this picture you will see all possible project sections He but more could be added in Folding switcher alla the future Use the mouse or malls ce the return key to open and close the section Sample h Sample h Sample hh ampk chp Sample asm Sample ass Sample s Sample cd Sample ct read me readme Sample doc Sample dok en readme storm lib amiga lib Anything else lies mich liesmic
162. lled startup o and library _startup o both can be found in the Stormc StormSys drawer You will only need the library _startup o startup code when programming shared libraries it contains certain tables and other data structures necessary for initialising shared libraries such as the _SysBase variable which the LibInit function uses to keep the exec 1library base pointer in This module is used when Link as Shared Library and StormC Startup Code have been selected in the Linker 1 page of the Linker Settings window The normal startup code is more interesting It in turn comes in three flavours One for the large data model and two for the small data model relative to a4 and to a6 respectively However the linker will select the appropriate one of these three automatically All versions of the startup code detect whether your program is started from the CLI or from Workbench and act accordingly In the former case the startup code first calls InitModules then the function labeled main_ this is the parameterless version of main in C and finally CleanupModules In the later case it first receives the Workbench startup message then calls InitModules and next the 186 StormC the professional choice function labeled wbmain_PO9WBStartup this is the version corresponding to wbmain struct WBStartup in C finally it calls CleanupModules and replies the Workbenc
163. lled and the library will be closed at the end You have to not three things thereby 1 Use the right version number because the compiler can not recognise whether you open library version 37 but used a function available from version 38 or later This will crash a computer running an older operating system 2 Only call functions from those libraries that you really opened before Several reasons can prevent opening There is no library on the computer with the indicated name or it exists one with a smaller version number Or there is not enough free memory And there are still many other reasons 3 Close the library at the latest at the end of the program For only then the library can be removed from memory again if AmigaOS need it presupposed no other program uses this library at the same time A further example include lt pragma intuition_lib h gt void main DisplayBeep NULL This program will run too presupposed you have linked it with storm 1ib Hmm did not we just say that you should open libraries before use Yes you should and that is exactly what this program is doing Since StormC is a C compiler too there are possibilities to automatically call functions from libraries on request at the program start and end The library storm 1ib contains such functions which open and close a library on request This means whenever you are calling a function of a special library it will be open au
164. low your mouse movement and the text will be marked and inverted It is the same as using the menu item Edit Mark When you move the mouse cursor to the top of the window while pressing the left button the text will be scrolled in this direction After you release the left button of the mouse the block will still be marked until you click it once more Find and Replace Find and replace is one of the basics features of any editor You will get a requester when you choose the menu item Edit Find amp Replace Find Port Replace Direction Forward I Ignore Case Mode G Text J Ignore Accents Find Replace Replace All Fal Type the word you are looking for into the first string gadget If you don t want to replace it leave the next string gadget unfilled and hit the button Find 102 StormC the professional choice Direction You can choose the direction for the search from within a cycle gadget You can search Forwards Backwards and Whole Text Forwards and Backwards will start from the current position of the cursor Whole Text does not care about the cursor position and looks for your key word through the whole text Mode This option defines how the search word is compared against the text The key word will be searched throughout the text A key word like port would be found in words like userport and ports This would only find words that exactly match the key word This
165. ls The signal mask is shown Debugger icons The group with debugger icons contains a checkmark in the l vi border to switch the debugger on and off When the gt X I gt Pc debugger is on the buttons that control execution are available StormC User Manual 169 ys 7 THE DEBUGGER 170 When the program is started just normal the debugger can be switched on at every time Then the debug information is loaded The program must be stopped by a suitable breakpoint A module must be selected out of f the module window to set the breakpoint in the corresponding source code or a function is selected to set the breakpoint there Go to next breakpoint If you didn t put a breakpoint in your program the program will be executed normally The program will execute at maximum CPU speed until the next breakpoint is found this needs to be set by the user in the editor Because the debugger and the editor run in full multitasking together with the program that is being debugged breakpoints can be set at any time The menu item Go in the debugger menu has the same effect Step in single step This step will always go to the next breakpoint button visible in the source code When present function calls will be entered and breakpoint buttons will be used here similarly as well Functions without available source code will also be executed in single step mode to allow stopping in function calls to code that has sour
166. lude Use Single Object Directory obiects cl V uw roo kB yte l StormC include Use Cancel 70 StormC the professional choice Paths and global settings Include path The pre processor reads the definitions for the standard functions out of the include files You use the pre processor directive include to include these files into your source As you may know there are two possibilities for this You can put the include file name in quotation marks like include this_one and the pre processor will look for it in the same drawer as the source or you can use the angle brackets like include lt this_one gt and the pre processor will recognise them as standard include files and look for them in the predefined directory The predefined directories are listed in the listview you will see at the left side of the requester You can define more than one directory for searching standard include files With a simple click on New you can create a new entryin New the listview You can type the complete path into the string gadget under the New button If you do not know the exact path or simply don t wish to type it you can use the ASL filerequester to look for it by clicking the icon next to the string gadget Click on Remove to delete the selected entry from the list Remove Header Files One way to increase the speed of the compiler is to create and use pre compiled
167. ments are independent of the compiler But if your sources were made for other compilers they might create confusion Normally the compiler ignores every pragma it does not know but a warning will give you the chance to see whether you made a typing mistake If a macro argument extends over 8 lines or 200 expressions the compiler assumes that you have forgotten a closing Enable Disable New Remove Character Warnings Nested Comments Unknown pragma Suspicious Macro Parameter StormC User Manual 73 4 PROJECT MANAGER Create All Templates bracket So there will be a warning and you will not have to look for this error endlessly ANSI C C Settings With these settings you can control code generation and debug output CiC Compiler a Preprocessor l Options Optimizer Warnings l Cl C Extra Hunk For Every Function Generate All Templat Don t inline E Te ay pates 4 Ignore Exceptionspecifiers CI Mes060 ___ J Debugsymbols eI Far Code Gl NoAsm Output f Cl Far Data 2 Fat Debugfiles QI Floating Point Unit Source You can choose between ANSI C and C mode If you are in C mode you can make some additional C settings Template Functions Templates are a very useful and easily understandable construct of the C language but they are not easy to use Essentially function templates have some surprising properties Normally you can not
168. mply doesn t exist 32 Bit Reference for Symbol This message is enabled by the WARNREL option It tells you that a 32 bit reference exists for a symbol that shouldn t be there because of the WARNREL option 32 bit Reloc to Data This warning is also enabled by the WARNREL option 32 bit Reloc to BSS Like warnings 29 and 31 above this warning is enabled by the WARNREL option 32 bit Reloc to Code Like warnings 29 31 and 32 above this warning is enabled by the WARNREL option 32 Bit Reference for symbol from FROMFILE to TOFILE This warning gives the filenames connected by the 32 bit reference to this symbol The WARNREL option tells StormLink it should emit a warning for this case Jump chain across hunk gt 32 KByte not possible A jump chain needs to hop over a hunk that is too large for a single jump Compile the module that causes the problem with the Create Library option More than 32 KByte merged hunks A MERGED hunk uses 16 bit addressing which is limited to a range of 32 Kb 32768 bytes This could but need not lead to problems Illegal access to Linker defined Symbol StormLink defines a few symbols of its own for specific tasks Should any such symbol be erroneously accessed by the user program this error message is displayed Error Messages Error 28 Warning 29 Warning 31 Warning 32 Warning 33 Warning 34 Error 35 Solution Warning 36 Error 37 StormC Use
169. n 171 Show Current Program Position 171 Pause 172 Kill 172 Priority gadgets 172 Signal group 172 Protocol gadgets 172 Window close gadget 173 Current variable window 174 The module window 177 The function window 178 The history window 178 The breakpoint window 179 The address requester 180 The hex editor 181 Choosing the display 181 The address string gadget 181 The address column 181 The hexadecimal column 181 The ASCII column 181 Keyboard control 182 The scrollbar in the hex editor 182 8 THE LINKER 183 THE LINKER THE UNKNOWN CREATURE 185 A first example 185 ANSI C Hello World 185 Startup Code 186 16 StormC the professional choice Table of contents Usage 189 Parameters 189 Memory classes 191 Compatibility 200 Error Messages 200 Error Messages 201 Unknown symbol type 201 16 bit Data reloc out of range 201 8 bit data reloc out of range 201 Hunk type not Code Data BSS 201 16 bit code reloc out of range 201 8 bit code reloc out of range 201 Offset to data object is not 16 bit 201 Offset to code object is not 16 bit 202 Offset to data object is not 8 bit 202 Offset to code object is not 8 bit 202 Data access to code 202 Code access to data 202 InitModules not used but not empty 202 CleanupModules not used but not empty 203 File not found 203 Unknown number format 203 Symbol is not defined in this file 203 Nothing loaded thus no linking 203 Can not write file 203 Program is already linked 2
170. n the project ADDFILE objectname QUIET End of makescript Almost any makescript can be built along these lines Another statement may be useful in some cases DEPENDENCIES filename filel file2 file3 This statement connects the project entry to further files whose dates will be checked to see whether or not the makescript should be called The file named in the project entry itself will always be checked and need not be specified using this statement Using this statement makes sense in cases where the script involves any extraneous files the StormC compiler for instance uses it to declare any header files that a source file includes with include abc h note that this is not done for headers included with include lt abc h gt Makescript settings are ignored for the project section that contains C sources these files are always run through the StormC compiler The section containing assembler source files on the other hand allows the use of makescripts although it will use the built in default rule for StormASM which in turn invokes the PhxAss assembler if no makescript is set Passing arguments to makescripts The script receives the filename that is the path to the project entry and the project path as arguments Both paths are enclosed in quotes to allow the use of whitespace in file or directory names Next comes a numeric argument whose value indicates whether the object files should all be written into
171. n which it is defined next the name of the object file that the symbol originates from and finally its memory class Selects the linker s search path LIB LIBRARY Any object files specified after this option are opened under the names used on the command line if they are not found the linker looks for them in the Stormc LIB directory this may be changed with the LIBPATH option Failing this it will see if that directory contains a file of the same library name but with lib appended Failing this an error is reported LIBPATH With this option you may configure where StormC looks for its library files The default is StormC LIB Sets the memory class for the finished program CHIP Forces the entire program to be loaded into Chip memory FAST Forces the entire program to be loaded into Fast memory this is the opposite to CHIP Attempting to run a program linked with the FAST option on an Amiga that has no Fast memory will result in an AmigaDOS error 103 out of memory 190 StormC the professional choice Memory classes The Amiga architecture defines two types of RAM to wit Chip and Fast memory This distinction is made for reasons of efficiency Any data to be processed by the Amiga s custom chipset eg sound samples or sprite bitmaps must reside in Chip memory This memory is shared between the processor and the chipset which accesses it continually resulting in a significant slowdown for C
172. naries and Syntax 97 Dictionaries 97 Syntax 98 Colour Settings 99 File Saving Settings 99 Saving the Settings 100 Keyboard Navigation 100 Cursor Keys 100 lt Return gt lt Enter gt lt Tab gt 100 Undo Redo 100 Block Operations 101 Mark Cut Copy and Paste 101 The Mouse 102 Find and Replace 102 Direction 103 Mode 103 Ignore Upper Lower Case 103 Ignore Accent 103 Find 103 Replace 104 Replace All 104 6 COMPILER 105 SPECIAL FEATURES OF STORMC 107 DATA in Registers 107 Parameters in Registers 108 Inline Functions 108 The Pragma instructions 110 Data in Chip and Fast RAM 110 AmigaOS Calls 111 The pragma tagcall 111 The pragma priority 112 Constructors and Destructors in ANSI C 113 StormC User Manual 13 TABLE OF CONTENTS Constructors and Destructors in C 113 Priority list 113 Joining Lines 114 Predefined symbols 115 Build your own INIT_ and EXIT_ routines 117 Use of Shared libraries 117 Prototypes 117 Stub Functions 118 pragma amicall 118 Forced opening of a Amiga library 122 PROGRAMMING OF SHARED LIBRARIES 123 The Setup of a Shared Library 123 The pragma Libbase 124 Register Setup 124 Shared Library Project Settings 125 The setup of FD files 125 The first four Functions 126 Home made Initialisation and Release 127 Important hints to Shared libraries 128 PORTING FROM SAS C TO STORMC 130 Project settings 130 Syntax 131 Keywords 131 CLI VERSION OF THE COMPILER 134 The instruction 1
173. nd also in C feasible expansion would be e g to overwrite the function LibNul1 through a function which makes the library useful for ARexx How this will function you must read in suitable literature Home made Initialisation and Release Just because you want to execute additional tasks at loading of libraries or when removing them from memory e g the opening of further libraries or memory reservations that is no reason write the functions LibInit and LibExpunge new Simply use the possibility to implement automatic initialisation or exit functions If you are using C you can do this with global variables whose type owns a constructor or a destructor These will be called automatically in LibInit or LibExpunge The execution sequence can be determine with pragma priority more closely Using ANSI C you can simply name the functions as the linker expects it to call it automatically An initialisation function must be named INIT_n_anything void andan StormC User Manual 127 6 COMPILER exit function EXIT_n_anything void Whereby n is a number between O and 9 This number determines the priority of the function The smaller the value the earlier the initialisation function and the later exit function is called Example struct Library DOSBase struct Library intuition base INIT_3_OeffneBibliotheken void DOSBase OpenLibrary dos library 37 Intuition base OpenLibrary
174. nes iii sisi csississininatelteindcedaiante a RaR 114 Predefined symbols ou ccc esesesesesesesnensteeseseseetensesesseneneneneeeeenens 115 Build your own INIT_ and EXIT_ routines 00 eeeeeeeeeeeeees 117 Use of Shared libraries 200 0 eeesecneeeeeeeeecserecseeceseeeececeeeeterees 117 Prototypes siete teccisecuccssnssesebanivenveststacoergneseessansussveceostacesteteyeensdedbeqseeseeoeesncteveseses 117 Stub FUNCLIONS nicas areas s ae aa Eese aR Raai aa iiaia 118 pr gma amical ciecsvviccscisariccvacsscedestocascansdevanvesesiaserdetcvsndieaaevasesiaaevadeas casesageves 118 Forced opening of a Amiga library ssccssccssssessscessccsseescccsscsesssessesensseeeeeons 122 PROGRAMMING OF SHARED LIBRARIES c ccccsecssssssssessessecsessseenes 123 The Setup of a Shared Library 000 0 ce eeeceeececneecseseeseeas 123 The pragm LIDDGSE sissien oirassa eiaa neira ri se 124 Register SOLU 5 innemen A a E E OE EA 124 StormC User Manual 105 6 COMPILER Shared Library Project Settings cssccssccssccsssscssscsssccssscessscssssessceessssssseeaeees 125 THE SCtUP OF FD files reniri io o AR E E A 125 THE FSU four Functions rsen naina aa E E Eai 126 Home made Initialisation and Release s scccsccsssssscsscescesscsssesscsssesscessesscessenss 127 Important hints to Shared libraries ccssccssssessccssscsssccescsessecssssesssesseseeesones 128 PORTING FROM SAS C TO STORMC ooo eeecsssneeeessne 130 Project setting
175. nscessscscsesescsssscsssessssesssonss 204 Symbol NOE GENET wc sctscscsetsnscessevoasecteaepanesnseesstcessnsansdsssdssytedeeacolasesabesaescbassnaseeed 204 SYMbolI renamed tO _StuD escccssccsssccssccesccsccessscsssesssecesecessscesesesssesssseseseeeeees 204 STUD IS UNACFINE oinnia inini a EES S EEEa TEREE E Eon EARE ESITE 205 32 Bit Reference for Symbol scssccsccsssssscesscsscssscssesscsssesscessesssescessesscessesssesseess 205 32 bit REIOC to Data sineresia E ETRS 205 32 bit Reloc to BSS sessecisccstesesccsssigecaceipesisccsebenteacessosaiesieodaestectivetcessrsaacedevsrsvecsese 205 32 bit Relo to Code essri eesis e a EEE E AR 205 32 Bit Reference for symbol from FROMFILE to TOFILE scccsccsscesscsssesscesseees 205 Jump chain across hunk gt 32 KByte not possible ssccsssccssscsssecsssseseseseeees 205 More than 32 KByte merged hunks scccscsscescsssesscessesscssscsscesscsssessessserssessees 205 Illegal access to Linker defined Symbol cssccesscesssesscesscesscsesessseeseseeesonss 205 Fatal errors abortihg serores airea a ea iat aS NEA SEERNE AES 206 HUNK AID inside LIDIA niisiis iena in 206 H nk Lib not FOUN cecceeessssssssssccccccecceceseessesesesssscsescsecccnsnssssssssccsessscseseseeees 206 Wrong t pe in LIDIONY cicciieccsscccsccecsecesacssstet eveso cvnnsucvedessoececevsdseonacventeontvdasadesess 206 Predefined values oo seecteeetetststetetesstststststststsestststseststeteenees 206
176. nt Please configure GoldED at Config Various Various to resident and save the settings setting With the PUBSCREEN tooltype you can set the public screen name upon which all StormC windows will be opened Like the Workbench the public screen is shared among all programs and can be used as a target screen for another application The creation of public screens is handled by a program that is independent of StormC and which is started separately During installation process if you have allowed the installation of StormScreenManager a little program is copied in your WBStartup drawer to do this job The ScreenManager The StormScreenManager is a little commodity which will be automatically started after each reboot It will wait on background a public screen request and will react upon such a call 48 StormC the professional choice Of course the StormScreenManager must know the names and the settings of the screens to open Otherwise the public screen requests will be ignored and StormC and every other program which asks for a public screen will open their windows on the Workbench Workbench New StormC 688 400 6 0x19004 helvetica fonti1 1 off Open Modeld Font Close Delete j Shanghai w AutoPopup A Y Etorme An entry for StormC is already defined in the StormScreenManager To use this public screen you just have to remove the parentheses on the same name entry in the StormCPP ic
177. nt to forego on a fast compiler This does not only mean speed at compiling but speed which benefits through used optimisation to speed up programs StormC offers both in an excellent way It is a very fast compiler with outstanding optimisation C sources will be compiled to machines code in one pass Pre compiled header care for tremendous compiler speed at large projects You will learn more about special features of StormC in this chapter SPECIAL FEATURES OF STORMC ou cceecssseecssecssesesseeesssessesesseee 107 DATA in Registers oiiiiisiccssiscsssecdsstisascssssscssasiestsssasisesesassbasgrebonesdsatosissscdianos 107 Parameters in Registers 00 00 00 ccccececeeeetstetstetenstsestsestenststeeeenees 108 Inline Functions 3323236 6 8 aah ie Reich titeh en chats caer A 108 The Pragma instructions 00 ee ctcceeeeeencncnesessesssesssssssesesees 110 Data in Chip and Fast RAM ccscccssccsssscssccesssesccessscsssesssscssssesssessesenssseseeens 110 AmigaOS GOS 5 isciccusccsedcercscesnscnceontiecsincasvcetasesescoeadeadiecosadenkisesvsondeatns couaseoieeses 111 The pr gmd tagcall siinne ens ei ai Eies 111 The pragma priority 000 00 eececcteteeeesenessssessesesesrseeseeees 112 Constructors and Destructors in ANSI C sscssccsssscssscesssceccessscessessscessesseennes 113 Constructors ANd DeStructors iN C cicssccsssccssccsssccssscesssceecssescesssesssessssesseeeees 113 Priority listeri ea A E AAR A EEEO a RN Se 113 Joining Li
178. o contains information about recent changes since the manual was printed OVERVIEW To guide you through the installation Commodore s Installer will be used It has become the standard application for this purpose You should have no problems using it Before you install StormC is shipped on a set of disks or a CD Please put the first disk into your disk drive or the CD into your CD ROM drive Before you install make sure that there s enough space on your hard disk for StormC Otherwise the installation can be interrupted After you insert the disk or the CD double click the drive s icon and a window similar to the following illustration is shown on your monitor Amiga Workbench 1 897 968 graphics mem 5 014 168 other mem 5j FA Ram Disk FA StormC_Diskt StormWiZARD GIGA2 FA StormC_Disk 97 full 27K free 852K in use GIGA z ley E eal gx ngai Stormc HD Mesmich A ngerungen V2 0 guide telly 3 sal ar Instali StormC HD english Changes V2 0 guide to 7 Fa z uy 2 Prefs Leggimi Install StormC HD ital Aggiornamento 2 0 guide Tools Al a Depending on which language you prefer you can decide whether the installation should occur in the German or English language This setting does not affect StormC s localization settings Both choices offer you the possibility to install one
179. olute addresses So you should use 32 Bit Reloc in any case A program which should be resident in memory has high requirements in the runtime system A global variable must not be declared the way another instance of the program could use it Principally a resident program has a small data model and it copies all data at every invocation and works with the copy It is important that the program does not contain any absolute addresses because they always point to the original Create Single Hunk Resident Programs StormC User Manual 85 4 PROJECT MANAGER Write Data Data Relocation Creating ROM Code When the g program uses the gt data relative to an address register the BSS hunk will be assumed to be after the data hunk The address for BSS is the address of the data length of data The options for SmallCode SmallData and SmallBSS will be set automatically so there will be no fragmentation With the additional option 32 Bit Relocation and corresponding Startup Code you can write totally PC relative programs data segment These accesses can not be redirected to the copy The option RESIDENT will switch these warnings on If there are fixed 32 Bit Relocations of data to Data BSS you can tell StormLink to create an internal relocation table for the program so that the Startup Code can compute the relocation for the copy of the Data BSS hunk on its own Manner of Memory You can select S
180. on of the start of StormC You will certainly already have started the system but the understanding of what happened and the function of the controls may still not be clear You have launched the development system but the its behaviour and the settings to be made are still open and are subject to change Some words about the startup The system is started by a program called StormCPP This is a loader and its only duty is to start the other parts StormC StormED StormLink StormRun StormASM and StormShell As this could take a little while a nice startup picture will be shown if you are running an Amiga with less than 32 colours on the Workbench screen there will only be a small window that shows you the progress On an Amiga System with less than 32 colours on workbench screen a little window opens to tell you the different programs being loaded Tooltypes The attributes of a program will be stored in its icon To change it please click on the icon StormCPP and select the menu item Icon Information The following requester will open o Work StormC a StormCPP Project TPT StormC StormSYS7St ormCPP CPUBSCREEN StormC gt CQUIET TRUE gt CSAVEMEM TRUE gt CHOTHELP TRUE gt lt GOLDED TRUE gt Cancel StormC User Manual Default Setting After the installation of StormScreenManager a public screen named StormC will be defined but it will not be used You have to activate th
181. on colour blue 1 Z Loads the module source code into the editor Displays all functions of the module in a new window Member functions are displayed with their qualified name that means the name of the struct or class to which the Fa function belongs will be displayed with two leading colons before the function name e g String left At the beginning the modules are displayed unsorted that Sorting means they are in the order they appear in the project With this option they can be sorted alphabetically StormC User Manual 177 7 THE DEBUGGER The function window The function window is similar to the module window but instead shows the functions in a module or the member function of a C class C Unsorted A KA similarly a double click in this window will show the source code only now the cursor is positioned at the start of the function This is a comfortable way of setting breakpoints on functions The history window The last actions of a program are recorded in the history window So you can have a look at the course of your program in the source e g when an unexpected behaviour appears and you do not know why main c line 14 main c line 13 main c line 11 The history window can also be opened by the item History in the Windows menu 178 StormC the professional choice The breakpoint window P A double click on an entry will display the source code in the
182. on tooltypes To do this click once on the StormCPP icon and select the menu item Information on the Icon menu of the Workbench screen Once you have the Information window click on the PUBSCREEN tooltype the string gadget will be filled with this tooltype Then you can remove the parentheses and press return to validate the changes You can now start the development system by double clicking this icon Now a new screen is opened and all the StormC program windows will be shown there To modify the screen settings you have to bring up the StormScreenManager window Press lt Control Alt s gt and the window will popup as shown on the previous page Choose the StormC entry to modify its definitions The name will be displayed in the string gadget and can be edited Tooltypes a After the StormC SS installation process you have to reboot your system in order to be able to use the StormScreenManager To bring up its window press the hotkey lt Control gt lt Alt gt lt s gt Youcan define SS your own hotkey definition to bring up the StormScreenManager window by modifying the appropriate tooltype Please refer to the Commodities chapter of your Amiga Workbench user manual StormC User Manual 49 4 PROJECT MANAGER there To change the screen mode click on the gadget O StormScreenManager coni Workbench MT StormC 688 400 6 0 19004 he 42024 10Hz 42024 15H2 DB
183. ons such as decimal octal and hexadecimal numbers in two different formats This parser is also smaller than its STORM LIB equivalent Hexadecimal numbers may begin with either 0x or This error message is displayed when a number contains a character that doesn t belong there Symbol is not defined in this file StormLink is also capable of reading index files from the MaxonC compiler which calls them LOGFILE If this file should state that some symbol is defined in a particular object file that hasn t been loaded yet but no definition for it is found in that file this error is displayed Correct the LOGFILE file Nothing loaded thus no linking The command line arguments contain only options and no object files Therefore StormLink can t create an executable Can not write file For some reason this output file couldn t be written to Error Messages Error 13 Error 14 Error 15 Error 16 Solution Error 17 Error 19 StormC User Manual 203 8 THE LINKER Warning 20 Error 21 Error 22 Error 23 Error 24 Error 25 Warning 27 Redefinition of symbol in file FILE first defined in file PREFILE StormLink has found a new definition for a symbol that has already been defined As this can lead to errors that are difficult to track down it is advisable to rectify this as soon as possible Program is already linked Once a file has been linked it no long
184. or more localization catalogues 22 StormC the professional choice Installing with low memory Installing with low memory Starting the installation Even if there s only a little space left on your hard disk you Double click one of the can still install StormC In this case run the Installer in icons Soon the installer s Expert Mode You will then be asked to confirm the window will open installation of every part of the package The following components are required for StormC and i should be installed 11 Include dir Normal Installer Icon all Includes except for the Proto and Pragmas LELI drawers Lib dir l ae Storm lib Amiga lib Selected Installer Icon StormSYS dir Appmanager library StormC StormCPP StormEd StormEdGUI wizard StormLink StormShell StormShellGUI wizard StormRun StormRunGUI wizard LIBS dir wizard library You don t necessarily need to install the run time system and the debugger However this also gives you the possibility to run and debug your programs right out of the compiler environment You may of course leave off the entire environment and proceed with an even smaller installation The StormSYS drawer should then contain these programs StormSYS dir StormC StormLink StormC Usermanual 23 2 INSTALLATION 2 If there is already m an old installation on your Amiga it will be replaced in novice mode with
185. or which is usually black This allows you to find careless mistakes while entering your text and avoids unnecessary compiler runs To demonstrate the error window this simple mistake should be included in the source As soon as the compiler finds the mistake the appropriate error message is shown in the window Of course a double click on the error message is enough to cause the project manager to load the source code and show the error line in the Editor You can then correct it and run the compiler again StormC User Manual 41 3 FIRST STEPS Running the translated program After successful compilation and linking you can click on the Run button which was previously ghosted or the Run icon to start the program You can also press the function key lt F9 gt instead If you click on the Run lt F9 gt instead of the Make lt F8 gt icon the project manager first checks whether all modules have been compiled If not the compiler will be run for all untranslated modules After successful translation the program will be automatically run Console output If you have already started the program you will have noticed that the program s output could only be seen for a short while and disappeared almost immediately The program is very short and thus runs very fast To see the output window also after the program has finished we need to specify the x y width height title options parameters when opening the console
186. ot changed thereby You declare simply inline int max int a int b if a gt b return a else return b Then you can use max like a normal function The difference lies solely in the generated code With inline the content of max will be copied every time into the calling code A lot will be saved thereby There must neither be a JSR into the function nor a RTS back There must be no storing and restoring of the contents of registers The function must not arrange its own data frame on the stack The result not given back in register do And the compiler will still have many possibilities for optimisations An inline function is not created once only but in many copies for each call a separate one It is obvious that inlining will blow up programs tremendously and you should use it carefully The compiler however may ignore that inline StormC User Manual 109 6 COMPILER StormC handles this in a better way what you want to be inlined will be inlined Still there can be situations in which an inline must be created on completely usually manner e g if you take the address of a such function if it is used already before it was declared if an inline function is recursive All this is allowed because you can use an inline function exactly as each other function If an inline function is created of one the above reasons it naturally has internal linkage So other modules will not notice whet
187. out further information Full installation After starting the installer s window appears with information about its version number and date At the bottom you can see two gadgets Click on Continue and the next page of the installation will appear where you can choose settings concerning the installation process A click on Abort installation and answering Yes at the Are you sure prompt will quit the installation These two gadgets will guide you on every page of the installation process Workbench Screen 5j FA Ram Disk X FA StormC_Disk1 StormWIZARD GIGA2 FA oj StormC_Disk1 97 full 27K free 852K in use mlaj GIGA1 a il es Tirsmich Storm InstallScript 0 done 1S Welcome to the installation of the new r lt C C standard Storm 2 Version 2 0 of 07 Dec 98 Prefs This script copies all the files of StormC 96 97 HAAGE amp PARTNER Computer GmbH R Proceed Abort Install The second page allows you to set parameters affecting the entire installation process Novice User In this mode everything is automated After selecting the drive to install to a complete installation will be performed You will only be asked to change disks if necessary Intermediate User This mode gives you more control over the installation The installer detects a previously existing installation and asks you if you want to reinstall from
188. owed by a number this parameter indicates an invalid HUNKTYPE object file Most of these errors are not fatal and will not cause the linking stage to be aborted They are however of importance with regard to the produced executable as they indicate that something has gone wrong at the place indicated in the error message Running such an executable will most likely result in a system crash If you are certain that the symbol involved is never used then doing so is nevertheless still possible e g in the debugger Error Messages Unknown symbol type This is a symptom of an incorrect object file it contains a Error 0 symbol with a type designator that StormLink doesn t know 16 bit Data reloc out of range This error can occur when SmallData hunks get too large If Error 1 BASE is already set to its maximum 0x8000 then you have a problem The program contains too many data for the small data model 8 bit data reloc out of range See error 1 this error has the same cause but should be more Error 2 rare Hunk type not Code Data BSS This object file is corrupted if it is an object file at all Error 3 16 bit code reloc out of range Similar to error 1 but for code rather than for data Error 4 StormLink encountered a 16 bit reference spanning too long a distance 8 bit code reloc out of range See above Error 5 Offset to data object is not 16 bit The distance to an imported data object is too large E
189. owever Fast RAM is the preferred place AmigaOS Calls The AmigaOS functions are called with the pragma amicall This declaration exists in the essential of four parts e The name of the basis variable e The offset as positive integer e The function name which must be declared already For reasons of the definiteness this function name may not be overloaded e The parameter list represent through a corresponding amount of register names in parenthesis An example pragma amicall Sysbase 0xlla AddTask al a2 a3 pragma amicall Sysbase 0x120 RemTask al pragma amicall Sysbase 0x126 FindTask al Normally you will never have to write such declarations by your own since everything is included within the Amiga Libraries The pragma tagcall At some OS calls so called TAG lists will be submitted as function parameters These are not really OS functions but STUB functions which are declared with ellipse You are using these functions since the submission of TAGs as function parameters is to be programmed very simply The use of an array would be of course be a good way too but it causes more work on typing StormC User Manual 111 6 COMPILER i Whether stdio g will be initialised or not will not depend on startup code but if the program uses printf or similar 1 0 functions An example The pragma definition of the function CreatGadgetA from the Gadtools Library looks as follows
190. own example program in ANSI C ANSI C Hello World include lt stdio h gt int main void printf Hello World n return 0 The text output function used here is called printf Now if you create a project ANSIWORLD q and add only a file containing this little program let s call it ANSIWORLD C you may compile and run it in the familiar way The program will print Hello World yet the printf function has not been defined anywhere in your code So where does this function come from and what does its code look like A first example StormC User Manual 185 8 THE LINKER Actually the programmer need not concern himself with that The function printf with many others belongs to the standard ANSI library that we have already programmed for you and included in the compiler system In most compiler systems each program must eventually be run through a linker which finds and includes any routines that the programmer may have used to produce a working executable How this is done internally isn t normally of any interest What matters is how to make your wishes known to the linker and how to configure the linking process to your needs Startup Code Some internal tasks that need to be performed by any program upon startup and some cleanup work when exiting are handled for you by startup code that is included automatically by the linker StormC comes with two varieties of this module ca
191. pace The compiler will need some free RAM for code generation and assembling but StormC does not know how much in advance so you must choose a value for workspace If the workspace is not large enough the compiler will stop and give you the error message Workspace Overflow A value of 100 KB will be enough for most of your programs But if the compiler gives you an error message you should raise this value and start compilation again Definitions and Warnings With these controls you can choose pre processor warnings and you can select the predefined pre processor symbols CiC Compiler ay Preprocessor Options Optimizer Warnings l w7 Nested Comments Unknown pragma INLINE INCLUDES Suspect Macro Parameter A V New Remove w INUINE_INCLUDES Token define In this list you can predefine pre processor symbols Every item in this list will be treated the same as if you had entered a define line at the beginning of your source An example You have inserted several assert calls in your program and you included the file lt assert h gt To disable these calls you must add define NDEBUG somewhere at the beginning of your source before the include StormC the professional choice Definitions and Warnings lt assert h gt line Or you may simply insert NDEBUG into the list of predefined pre processor symbols and mark the gadget in front of the strin
192. ps a the will known novice error You can inhibit such a warning by an additional brackets i e if a b instead of if a b C Conversion Uncertain type conversion without cast i e double gt int E Empty statement Instruction has no code i e 36 F Function prototypes Function called without a prototype only meaningful in C as in C it is an error N Nested comments A emerges in a comment O Old Style Complaining about parameter lists in the old K amp R style only meaningful in C as in C this is an error P Pragma Unknown pragma R Return Function with return value has none return statement T Temporary Temporary object was introduced to initialise a non const reference which is an error in C since standard 2 0 V variable Local variable is used never or used but never initialised M Macro An argument for a pre processor macros extends over more than 8 lines or 200 tokens It is obvious that there is a closing bracket missing By default wEPRT is activated I e to switch warnings at missing prototypes on and off such at unknown pragma you can simply use the option wFp or alternatively both options wF wp StormC User Manual 143 6 COMPILER Please note that w v does NOT gt mean that the warning v is turned on in addition to the current but that completely all warnings are switched on and subsequently v off
193. ption SmallData Symbols Usage Description Usage Description Usage Description Usage Description 207 8 THE LINKER Description _DDTABLE label Description Symbols for data data relocation _DDSIZE const Length of table in bytes Had this length been measured in longwords the following would no longer work Start address of table This table is attached to the first Code hunk If there is only one code hunk _DDTABLE _DDSIZE points to the end of the hunk If no DDREL option has been set _DDSIZE equals zero Hunk Layout Aggressive hunk merging is pursued to make the generated executables as small as possible Memory Classes For the purpose of hunk merging StormLink assigns a signature to each hunk This signature contains Hunk type Code Data or Bss Memory Class Public Chip or Fast Addressing Mode Near or Far Naturally one may also use hunks that have already been marked with the Chip or the Fast bit In that case priorities are as follows CHIP maximum FAST PUBLIC minimum regardless of memory class Setting the Fast bit isn t very polite as it requires the presence of Fast RAM in the system CHIP data should be declared as Far if at all possible Assembler programmers should address CHIP data with 32 bit addressing only This allows StormLink to merge such data into a single CHIP DATA hunk This way the Small Data hunk is free to be allocated in expansion R
194. r Manual 205 8 THE LINKER Error 38 Error 39 Error 40 Error 41 _LinkerDB Usage Description __SmallData Usage Description Fatal errors aborting This indicates the occurrence of such serious problems while linking that StormLink can t handle them anymore Trying to proceed under these conditions would only cause more problems which the linker prevents by aborting the process No output file is generated Hunk_lib inside Library A file that has already been identified as a SAS library contains another such identifier within the library contents StormLink doesn t understand this and exits Hunk_Lib not found An important part of a file that has been identified as a SAS library is missing This indicates a corrupted library Wrong type in Library Symbols are represented differently in SAS library than they are in standard object files Types simply added in the normal way confuse StormLink Predefined values StormLink defines constant symbols for the linker database and for the length of the Data and BSS hunks Notation is compatible with that used by BLink 6 7 however BLink will not show all of these symbols _LinkerDB label Points to the first data element BASE With BASE set to 0 this is the default this points to the first element of the Near Data hunk If the SMALLDATA option is used there may well be something before this _ _SmallData label Points to the first d
195. r to load the file out of the standard include drawer or from the same drawer as the source The following line will cause stdio h to be loaded from StormC Include by the compiler If it does not find it at this location all alternatives will be tested before an error report appears 62 StormC the professional choice include lt stdio h gt This line include address h causes the compiler to look in the same drawer as the source for address h As a result you should not use a special drawer for project specific header files It is better to store them in the same drawer as the source You should not store them in the standard include drawer either First of all this does not help you keep your files in good order and it also prevents the project manager from knowing about the dependence between source and header files Header files which are in angle brackets lt gt will cause no automatic re compilation if they are changed in the editor However the dependency of header files which are stored in the source directory and which are enclosed with quotation marks will be regarded That means that after a change of these header files the sources in which the headers are included will be recompiled automatically Documentation scripts You should use separate drawers for documentation AmigaGuide files Installer and ARexx scripts if there are more then two files per section You don t have to keep thi
196. rd forces a data item into the ChipMem hunk of the object file Note that this keyword like all other memory class specifiers and other qualifiers must precede the type in the declaration _ Chip UWORD NormalImage 0x0000 correct UWORD _ chip NormalImage 0x0000 error The latter syntax is not accepted as it is not consistent with ANSI C syntax In StormC the use of pragma chip and pragma fast is preferred Take notice however of the fact that __chip affects only a single declaration whereas pragma chip remains in effect until a pragma fast is found are not supported There is no easy way to replace these keywords but they are rarely needed 132 StormC the professional choice is not supported At the moment all interrupt functions a rarely needed class of functions anyway must be written in assembler are not supported and not needed If you wish to have function arguments passed in registers declare the function with the ANSI keyword register or modify the individual parameter declarations with the register keyword or a precise register specification eg register __a0 Otherwise the arguments will be passed on the stack Has an effect similar to SAS C s __saveds This keyword has no effect when using the large data model in the small data model relative to a4 it saves a4 on the stack and loads it with the symbol __LinkerDB in the small data model relative to
197. re as shown below Workbeni e AMIGA Professional Work NY Loading StormLink HAAGE amp PARTNER ArtEffect g9 The following programs which belong to the compiler environment will be run StormShell The StormShell unifies the different parts of the compiler environment It is responsible for important jobs such as project management without which programs consisting of multiple modules would not be possible 30 StormC the professional choise Running the program StormC ail Due to the The compiler is the heart of the StormC developing integration in the E environment The compiler accepts both ANSI C and C compiler P sources and performs optimisations as well It supports environment YOON 3 current ANSI standards and all features of the AT amp T version Otice that it consists of 3 0 compiler systems CFRONT multiple programs The communication between StormLink the parts occurs using an ARexx port which as This amazingly fast linker is the interface to other compiler gnother benefit offers very systems It is able to process link libraries from the SAS C and flexible interfaces to other MaxonC compiler environments This feature allows you programs to use all common libraries in your programs StormEd We are sure that you will soon appreciate our editor s two major features Colorization of strings comments constants etc helps you
198. re only defined extern are not displayed Shows all watched variables This list can contain any variable or elements of an inspection However the value of them is not always valid e g register variables are only valid in certain areas of the function and variables which are on the stack are only valid as long as the program is in this function Help Sf g g Ne StormC User Manual 175 ys 7 THE DEBUGGER Cast Value 176 Oxal Wek e Shows the definition of the selected variables in the source code The source code will be loaded and the cursor is positioned on the variable definition Displays the member function of the selected variables in a new window In C only variables with a struct or class type can have member functions Inspects the selected variable Therefor the current list of the variable which can be an inspection itself is replaced by a list of the elements of the variable If the variable has a struct union or class type all members are displayed If it has an array type the single fields of the array are showed If it has a pointer type the type of this pointer is shown At a nested inspection the previously set inspection is displayed newly Otherwise the variables that were shown before the inspection are displayed current global or viewed ones Opens the hex editor and positions the cursor on the address of the selected variable Puts the variable to the list of watche
199. red a wrong type the screen will flash and the former contents will be restored Changing Values When you have selected a number variable here for example the third variable illegal you can directly modify the value of the variable in the Value string gadget without having to bother with the hex editor When you selected a variable which type is a pointer to UBYTE OF BYTE also called a string you can change the text at string gadget value Pay attention not to enter more characters than is reserved for that string Sorting of Variables First the list of variables is unsorted Now you can select the sorting method with the cycle gadget Sort The alphabetical sorting will use the names of the variables for sorting so you can find a certain one quicker in a big list Last Changed will put the variable on the top that was changed last This sorting will be updated after every program step The debugger recognises every change even changes of single struct fields or variables which are changed through pointers The sorting method can be selected separately for every of the 3 variable pages Temporary Casts StormC User Manual 161 ys 7 THE DEBUGGER 162 Now execute some statements of the program by selecting the middle icon in the Debugger group In the editor window you ll see how the program executes one printf function after the other with the output appearing at the same time in the console window T
200. requirements of the run time system Global variables must be kept for each instantiation separately so no other invocation of the same resident program can reach or alter them A residentable program is essentially a program with the small data model that creates a new copy of its entire data section on each invocation and uses the copy exclusively Above all it is vital that the program reference no absolute addresses These would point to the original data section and Memory classes SMALLCODE SMALLDATA SMALLBSS Description See also MAXCODE MAXDATA MAXBSS Usage Description RESIDENT Usage Description StormC User Manual 195 8 THE LINKER WARNREL Usage Description OPTIMIZE Usage Description NEARCODE Description oop Usage Description cannot be redirected to the copy With the RESIDENT enabled a warning is emitted for such cases Warn of 32 bit relocations WARNREL Causes StormLink to emit a warning if the program contains 32 bit Relocs This option is not to be confused with RESIDENT Use this option when creating position independent code In that case one should use the ONEHUNK option as well OPTIMIZE When OPTIMIZE is enabled StormLink makes an optimization pass over the object code If a 32 bit reference to an object within the same hunk is found StormLink will attempt to replace it by a PC relative reference saving 4 bytes by freeing up a reloc entry This optimis
201. rom the debugger to normal execution if the program was compiled using the debug option StormC User Manual 151 7 THE DEBUGGER 152 A Resource Tracking Example Open the project IllResource q in the Stormc Examples I11Resource drawer This program allocates some resources without freeing them Workbench Screen c o Storme c 1 A F ely Peeler DEI oo xx lt lt A Save activated text F3 StormCPP StormWizard o Examples illResource lilResource m Fie Code Text ir liiResource c 340 401 WliResource 516 E storm lip 336936 Termite art ArtEffect Start the program using for example the function key F9 Subsequently the program will then be compiled if necessary and then run Other ways of launching your program are selecting the button in the toolbar with the walking man on it selecting the menu item Start from the Compile menu double clicking the entry for the program in the project window or directly after compiling by hitting the Start button in the error report window StormC the professional choice Freeze the program temporarily After compiling the Runshell control window will be opened This is your control board for the program Workbench Screen c o stormt E olele eaea we 2 Save activated text F3 StormCPP StormWizard o Examples iilResourcesiilResour
202. rror 6 See error 1 StormC User Manual 201 8 THE LINKER Error 7 Error 8 Solution Error 9 Solution Error 10 Error 11 Error 12 Offset to code object is not 16 bit This error should never occur If such a situation occurs StormLink will build a chain of short jumps to span the same distance Only if even the jump out of the hunk is too long can this still be a problem Offset to data object is not 8 bit This error is analogous to error 6 with the difference that the maximum allowed distance is limited to only 8 bits Find the corresponding symbol in the map file and set the BASE value manually between 127 and 127 If errors of this kind still occur getting the program to link is next to impossible The only solution is to change the source code causing the problem Offset to code object is not 8 bit The usual cause for this error are object files created by an assembler that contain a directive of the form bsr s _external_name This error should not occur with object files created by StormC as it doesn t and mustn t use such constructs The indicated object file apparently contains a reference to a code object that cannot be resolved Rewrite the source code causing the problem Data access to code Object files can state whether a reference should point to a data object or into the code area If StormLink discovers a violation of this restriction it rings the alarm This error
203. rs in condition Perhaps the will known novice error C Conversion Uncertain type conversion without cast i e double gt int E Empty statement Instruction has no code i e 44 F Function prototypes Function called without a prototype only acceptable in C because in C it is an error N Nested comments in commentary M Macro An argument for a pre processor macros extends over more than 8 lines or 200 tokens It is obvious that there is a missing closing bracket o Old Style parameter lists in the old K amp R style only acceptable in C because in C it is an error P Pragma Unknown pragma R Return Function with return value has no return T Temporary Temporary object was introduced to initialise a non const reference this is an error since that 2 0 standard vV variable Local variable is never used and or used but never initialised By default wEPRT is activated wN Sets the interim compiler workspace on N Kbytes Default is 80 Kbytes which should be enough for most cases wt Output all warnings W Output no warnings X Abbreviation for px Summary StormC User Manual 147 6 COMPILER 148 StormC the professional choice Debugger gg gt fter the first successful compilation of a program the test phase starts Of course you could simply run the program from a CLI or a Shell yet this can cause some typical Amiga problems
204. s StormC User Manual 191 8 THE LINKER CHIP Usage Description FAST Usage Description ADDSYM Usage Description DEBUG Usage Description Enables CHIPCODE CHIPDATA and CHIPBSS CHIPCODE CHIPDATA CHIPBSS These force the OS to load the indicated program sections into Chip RAM For example CHIPDATA may be needed when some graphical objects fail to appear on the screen This option is to be used with caution as it causes all data to be loaded into Chip RAM Enables FASTCODE FASTDATA and FASTBSS FASTCODE FASTDATA FASTBSS These options are really only provided for sake of completeness as using them forces the specified sections into Fast RAM and the resulting program cannot be run if none is available They may be useful in some cases though as the OS will attempt to flush unused libraries from memory if necessary to free up Fast RAM rather than simply load the program into Chip RAM These options were included for no other reason Create symbol hunks HUNK_SYMBOL data ADDSYM This option copies symbol information from the object file into the output file so that labels seen in a debugger will have meaningful names StormLink also includes global symbols so in some cases the name for a particular address may be included twice DEBUG Generates a LINK file needed by the StormC system to run the program through the debugger 192 StormC the professional choice ROMCODE CodeStart DataSt
205. s 80 SOGUIILY eiert E AAEE AEE C E EEAO N E AEE TE 81 Optimisation soseen anei ii ERE EE eais 81 Path Settings and Linker Modes oui seescecssecscececsserssecesaees 82 Generation of Programs sevicissecississcesderccocrscovestescscoteonsisosteossccsodbodecesassesvecensessosesd 82 LIDPATY Path issiria n a N R ea i iiai aiek 84 Warnings resisa i EE E E E aE E S 84 OPtiIM SEP ieccssccesiiassccssavarscstereocndeasseonsvstesstvesCoensnacesensesesteteessrossuetageeveteecetnens enntyenss 84 Hunk Optimisations and Memory Settings 0 00 0 eee 85 Summarise HUNK 0c cccccccttcesscaresntcateveteccesecsssccusdescnentusoedssuacdeceutectesouediveestedusessevanes 85 Manner Of Memoty o e eniste irii E E REA E a 86 ROM Code cisoiriroosriioirdbererigrsiiai aiie ip risiedi doedeostiuacdieass 86 Call of the executable program 000 cece ceceeesecscecscsserssecseaes 87 Execute Environment Serseri eteris tives ri Ainso S r aa at aaien Te 87 Start From CLl Toren iaa E NE E O EEEE EREE EEE Ea T Ee ESEESE 87 MOSettings niiair repanse EE e rase aiee ENESE eraa Ee ETR An Eee ariin 88 Inp t Outp t ccsssccasiasiecvesevestscaoetintevivetinnssssoisastendevaccsusateabsibie ovate civecassecsvadcovievtess 89 Save Project icici ccsucidinicinewinansuieainaddinliieindaunaied 89 46 StormC the professional choice Some words about the startup OVERVIEW Before we start with the project manager I will tell you some basics of the system One point will be a precise descripti
206. s disabled for filenames following the LIB keyword so that the program may still overload library symbols SMALLCODE SMALLDATA SMALLBSS These options are superfluous under normal circumstances as StormLink can independently decide what to do with a hunk In some cases however this may not be what you intended which is why these options allow you to influence how the linker combines the hunks These options take priority over and disable their respective MAXCODE MAXDATA and MAXBSS counterparts 194 StormC the professional choice Forces creation of only a single Code section Specifying any of these options causes only a single hunk of the corresponding type to be generated It will obey the strictest of the memory class constraints for that hunk type Memory classes MAXCODE number MAXDATA number MAXBSS number StormLink normally merges all hunks of the same type e g all NEAR hunks all PUBLIC CODE hunks and so on into one hunk for each type Using these options you may fragment the program i e create several smaller hunks of the same type StormLink will merge as many hunks as will fit into the size specified Specifying MAXCODE 1 will prevent any CODE hunks to be merged so each one will appear as a separate hunk in the executable Hunks marked MERGED are an exception these will all be merged into a single hunk regardless RES RESIDENT A program that is to be kept resident in memory makes some special
207. s oisiisiisciiccsissssieibcssiaesscsesssstatsestanssdssniedosbosepivssssossdiesevsesicases 130 Synta ene aor ie E E E EEE O OE a A AO EE 131 Ke words aonne ean iR A ER A Aa 131 CLI VERSION OF THE COMPILER cccccccssssessecsecsesssessessessecsecsecsecessenees 134 The instruction o oooeneecienennn en aai A AES 134 OPTIONS ridono soni naa ERE E ARR EN ie 134 ASSCMDICFSOUICE cssccsicvscssecesssiniesssacdiccetveccdecesuaseisssesvycbeebensosedenssdetieesnsencusnevates 136 Pre processor Definition Of symbols sssccssscessccesscesescesscesescssssessseesssesesonss 136 Pre processor Include files cccesscssscscssscsscessesscesscsscessesssesscsssesscessesscessesesessees 137 Compiler mode 3 c 5 5csceeieeciecccks esas sdedegbeleons tenets dessestansliasndstieestcteds 137 ANSI G OF CHE wisestecisteccssscoccssnceusetevetiteapeorevvsecdvstsestvssstesdeads saedoetesabessasesevcabereete 137 EXCOPtiOn NANIING moreeni en east i a i a ENRE 137 Creation of Template functions ssssssseesseeseesreeeseeresseseesesseseesrereseeseesrsreseeresees 138 Code creatio eenei onroro E ARAE E ERN 138 D tamodel noinine a ida i 138 COG MOE oine EREA A E ETEA EE ETR 138 OPTIMISQUONS 2 cscevss sdsicnssstessesdssbsssscteste ea ra I RENTET REO E EA I T Ea eaS ERAS 138 Code for Special Processor serrent inini ia iai 140 Code for linker libraries rizsesrasaroota i aaee anA E ARRE 141 Debugger ceea eai lien heeded eases neue ees 141 Runshell peiiini
208. s order because the project manager will show everything very clearly divided in sections But from time to time you will look at your old projects and then you will see the advantage of good structure The more you work on the structure of your project the easier it will be to find the files in old projects Makescripts The rules behind a Make are essentially very simple First of all all files in the project are checked to see if they need to be recompiled In the case of a C source file this means that the file dates of its object and debug files are compared to that of the source text and of any header files that it may include If any of Makescripts StormC User Manual 63 4 PROJECT MANAGER 64 these is newer than either the object or debug file the source file needs to be recompiled The source file also needs to recompiled if one of the header files has been changed by some other action by the compiler This may be the case for instance when the catcomp program is used to generate a header file from a Locale file Once it has been determined which files are to be recompiled or re linked each of them is handled by sending the corresponding ARexx commands to the StormC compiler and the StormLink linker These commands are then executed in turn Makescripts are used when other files than just C and assembler sources need to be translated The Select translation script menu option lets you enter an
209. saekitineas E E E E 172 Priority gadgets sisisi iig hat iiiad ii iiir 172 Sigal groupie enesesse iaa EAE AA AEEA EREE RE 172 Protocol gadgets ssni orgnr E ER a r i ia 172 Window close gadget ccccsccsccssscsssesscsssescesscsssesscssscsssesscsssesscessesscssscsssessesssesses 173 Current variable window 00 eseeeeseseeeeseeeeeeeecacseeeeecaeseeeeees 174 The module window 0 seeseseseseeseeesceeeceeeecsseceecssasseeescaessseeesaees 177 The function window oui ee eeesseceeesceeteseescscecsecesssseseeasseeeseeeeaees 178 The history window ounces escecscececscasscscacscasasacasasasssasasscesesssaes 178 The breakpoint window ssessessessesresresressrsserrssesressrerreresresrsrneesses 179 The address requester ee eesessssesresresresressrsreerrereressrssrsrnrrneenreneeneee 180 The hex editor ionns aeai nia eai e 181 GhOOSING the CISPIOY c cecsiescvisivccescsncevstessesedavecvsesesaceusieverdchitveosssidavevdivosvezens coves 181 The Address String Gadget simsii ansieae siaaa 181 Th address COLUMN sessirnir a aia iaeia 181 The hexadecimal column iieis asese 181 The ASCII COMIN se siiiccccvsasscisccecaceceticcesectccetnecvsastasesvedsaebesianedesteussestatesenceoateass 181 Keyboard control onon iaa E ER EAE TERR 182 The scrollbar in the hex editor scccssscsssccssscsssscessccssccesseessscessssssscesecssesenseoees 182 150 StormC the professional choice The StormC Maxim GENERAL INFORMATION ON RUNSHELL It is
210. self on the following list of the priority This tells you the use of the priorities in storm lib This priority is reserved for functions which initialise the StormC library particularly data structures of the library If you want to initialise a data structure e g a jump table that does not access to any OS resources you should use priority 0 also StormC User Manual Priority 0 113 6 COMPILER Priority 1 Priority 2 Priority 3 Priority 4 Priority 5 Priority 6 Priority 7 Priority 8 Priority 9 The most important shared libraries are opened dos library version 37 utility library version 37 All shared libraries which are necessary for the function of the program are opened The program is aborted if the opening fails Here all libraries are listed which are delivered since AmigaOS V2 04 V37 Here all libraries are listed which are delivered since AmigaOS V38 or later or these that do not belong to standard delivery of the system You do not know whether these libraries exist the concrete system These libraries are opened with the minimal version If the opening should fail it outputs no error message With malloc or new reserved memory will be freed Further library resources are reserved and freed e g global and temporary files There are some cleanups before the resource are freed e g flushing of file buffers etc Unused free for usage Constructors
211. since ten messages would not fit into a normal Shell window Colours and styles The however somewhat boring text output can be made more clearly There is the possibility to show the real error messages in bold with the switch eB eb switches back to basic attitude The option een brings colour in the game at least if you use a numeral for N The screen colour number N is used to differ between the source section of other outputs ec1 corresponds to the standard text colour and ecO is theoretically the background colour Since you could not read the text any more in the more last case SO ecO outputs the source in colour 2 but the error position in an other colour than ec2 Error file For the linking of StormC in foreign environments it can be useful to reroute all error messages in a file That is done by a statement like ef lt name gt Thereby all error messages and source positions are written in the indicated file The difference to a simple output routine is that ef works in addition to the normal screen output and secondly it does not appear as a status messages in the file 142 StormC the professional choice Warnings and errors Optional warnings You turn on a optional warning by pacing their character as w BIG ones behind that w while a small letter switches it off These are the warnings and their characters A Assignment The operator appears in a condition perha
212. sing there is no file name and you have not defined the place to save it Every project should have its own drawer Naturally you can store more than one project in a drawer but you shouldn t do this as then you will not know which header files and documents belong to each specific project The first step after creating a new project is to save it Even if you did not add anything to it this is the best way to give your project a name and its own drawer You can do it with one step Hit the Save Project icon on the toolbar An ASL filerequester will appear Now type in the name of the new drawer and the name of the project e g New Drawer My Project Now you have created a drawer called New Drawer and a project called New Project q The extension q will be added automatically As soon as you hit lt Return gt you will be asked if you want to create a drawer named New Drawer Confirm it with OK and press lt Return gt or click Save Project specific headers Class and structure definitions that are used in several modules should be collected into a common header file In our example debugger tutorial there is a project specific header file called address h When you look at the source to main c and address c you will see that these header files are called with quotation marks and the standard headers with angle brackets lt gt Looking at the quotation marks on include the compiler decides whethe
213. sions etc Workbench Screen rm o StormC PPC Professional Version o address c z Program stopped at Breakpoint oee eE ee a aeons gt gt I gt Pe Pause Kill ji E o GIGA2 StormC Examples DebugTutorial DebugTut File Code Text 5 Ctri C Pewee launched l main c al all Ctr D I address c o Variables o z address h 7 a asle El andress Cast Address storm lib Value E Sort C Unsorted f amiga lib i address 0x0 3 0x0 1E229E1 NULL o GIGA2 StormC Examples DebugTL lt BYTE 80 stack gt 49 0 7 120 17 24 0 8 28 96 ETS pi ofn illegal lt LONG D2 gt 0 0x00000000 do A x T gets s em lt gt gt Ey switch 3 0 case 1 address readAddressmask stdin dd if address NULL mi addAddress address Al J lt gt The current program position is always in the editor shown using a white bar that marks the whole line horizontally The Variable Window Subsequently the window with the variables is opened This always shows all variables that are available to the program at this time o Variables m asle EA Cast Address MJ Low fo High fo Sort Gl Unsorted address lt Address AO gt 0x07959718 gt Ox01E229E1 NULL Ox lt BYTE 80 stack gt 49 0 7 120 17 24 0 8 28 96 illega
214. st OS 3 0 Check programs that are running in the background There might be some software running on your Amiga that will interfere with StormC In particular some tools and patches which are loaded in the Startup sequence can considerably affect the mode of opera tion Try starting your Amiga without these programs to be sure that they are not the cause of the trouble Please keep your Registration number handy Write down the version number of StormC About window and the version numbers and build dates of components Storm Library StormC StormCPP Stor mEd StormLink StormRun StormShell You get them by typing the command version file name full in CLI or Shell Please note your hardware and software configuration too If you think that your problem is caused by an error of StormC then please try to narrow down the error to the smallest possible piece of your code and send it to us by mail or e mail You can tell us your problems through many channels Internet storm support haage partner com Contacting us by e mail is most convenient to handle for us We can forward your problems to the developers very easily If you could send us a code segment containing the error this would certainly speed up the process of fixing the StormC User Manual Technical support PREFACE bug tremendously Via e mail we can respond to your message very easily or send you an individual patch or advoice Pl
215. static functions for use by the other functions Then all the address handling functions follow The header file address h contains the struct Address data structure and the prototypes of all functions that do something with addresses particularly input and output These functions are implemented in the address c module and are called by the main c module When so far everything is clear start the program again only now in the debugger i e with F10 or the corresponding icon in the toolbar Other ways to debug a program are the menu item Debug in the Compile menu double clicking the program name in the project window while simultaneously holding the lt Alt gt key or directly after compiling in the error window by selecting the Debug button Again the control window is opened first only now with activated debugger controls The program will automatically execute to the first position in the program for which source code is available If you haven t already loaded the main c source it will happen now The editor window now looks a bit different a column of breakpoint buttons is located to the left of the text In this column you can set or clear a breakpoint with the mouse This column also shows how far a single step takes you since often a step in C takes you more than one line 158 StormC the professional choice The Variable Window ahead for example skipping comments declarations long expres
216. stead of lt Return gt or lt Enter gt the function will be terminated and after the next input of lt Return gt or lt Enter gt the cursor will be placed in the following line just under the bracket If all these explanations seem to be confusing please take some time to use the functions yourself This way you will see that all these settings are actually very simple in use Dictionaries and Syntax When you chose this settings page you will see two lists of gadgets The first group is called Dictionaries the second Syntax Textformatting Coloring File _ Preprocessor C Comments x7 CiC Symbols C Comments Z J CiC Library Functions String Constants _ AmigaOS Types _ _ Char Constants _ _ AmigaOS Functions _ _ Number Constants _ _ User Dictionary 1 _ User Dictionary 2 _ User Dictionary 3 Dictionaries In this group you will find a list of gadgets to control the use of dictionaries for text colouring The dictionaries are stored in the drawer StormC StormSYS Dictionary and you can load them with the editor Pre processor Preprozessor dic Here you will find all the defines of constants that means everything that starts with define C C Symbols C Symbols dic This dictionary contains the C type definitions like auto sizeof C C Libraries C Library dic Options of Text Text colouring StormC User Manual 97 5 STORMED C
217. suffix can also be entered manually by pressing lt ALT gt lt P gt The q suffix is automatically appended and signifies that this file is a StormC project Workbench Screen DOl DE erat EE Tar Open new project window EEE unnamed Drawer StormC Hello World does not exist Create it storm lib amiga lib Create Cancel o Save Project S 3 Patten 41 Termite Drawer StormC Hello World File Save Volumes Parent Cancel aA When you have entered the file name as shown above into the text gadget and pressed lt Return gt you will be asked if you want to create a new drawer In order to keep a better overview you should create a new directory for every project and proceed as shown After confirmation of the create a new drawer requester you can click the OK gadget in the ASL file requester and your project will be saved in the new directory You may wonder why the empty project needs to be saved even if the project is empty it is recommended to specify a clear project path at the start The names of the source files and other resources can then be integrated and saved relative to the project s path otherwise the absolute path would be used Another advantage is that when adding new files to the project the ASL file requester already contains the project s path so you won t have to enter it manually 36 StormC the profession
218. suffix 0 The AutoSave will still be performed in the same file The M flag will not be changed It means that the secure file will be more recent than the original file after a possible crash After a restart if you load your original source a 52 StormC the professional choice Settings requester will pop up to tell you that the AutoSave file is more recent than your original file Automatic storage of unnamed files If a file is still unnamed at the automatic storage timeout a requester will pop up to give you the chance to enter a name unnamed This text is still unnamed Please save it now otherwise autosave can t be done Save Cancel An ASL filerequester will let you enter a name for this file If you cancel the ASL requester it will pop up again after the AutoSave timeout Automatic storage will only be performed if the text has really been modified Of course whether any changes have been made can be seen by the M flag in the status bar of every window If you have checked the Confirm AutoSave gadget a requester will ask confirmation before saving the file Automatic backup copy If you have checked the Make backups gadget in the Backup group as many copies as selected will be performed The files will have the suffix 1 to 9 depending on the selected copies number For instance setting the number of backup copies to 2 the first time a file is saved manually or automaticall
219. t char void my_startup register _ d0 int cmdlinelen register __a0 char cmdline pre_main cmdlinelen cmdline The first source file in the project should contain no more than this The necessity for this really quite pointless function is that the order in which functions are defined in the object file need not match the order in which the source file defines them and the executable file may put them in yet another order The only guarantee that StormC makes here is that the first file in a project will be the first one to be passed to the linker provided of course that you link without startup code 188 StormC the professional choice which will use the first code hunk in this file as the entry point of the executable Larger source files than the one shown above with multiple functions and perhaps global variables whether static or not and include files could have the code for the functions in a different order than you may expect eg the INIT_ and EXIT_ functions for global variables in C are often put at the start of the object file But even in ANSI C the compiler will sometimes generate such INIT_ functions e g to initialise complex data structures Usage The user normally doesn not see the linker as it is called by StormC s integrated development environment Started from CLI StormLink will evaluate its command line and if it contains only a single parameter AREXx attempt to
220. t takes effect only if you activated the indent function of the editor Otherwise the cursor will be placed in the first column after hitting lt Return gt or lt Enter gt When you set the option Indent Brackets a bracket will be set according to the value set at Ahead of Brackets An amount of spaces or tabulators will be inserted in front of the bracket and the cursor will be placed behind it To activate automatic indent according to Indent behind a Bracket you must hit lt Return gt or lt Enter gt behind a bracket According to the value of Behind of Brackets the cursor will be moved a certain amount of spaces or tabulators to the right This will be done relative to the position of the cursor For example when the cursor is in column 10 and you type a bracket the cursor will be placed in the next line in column 12 if you set Insert Spaces and Ahead of Bracket to 2 Indent ahead and behind of brackets The option Indent ahead and behind of Brackets is a combination of Indent Brackets and Indent behind of Brackets If you type a bracket a certain amount of spaces or tabulators will be inserted The bracket will be set and the cursor will be placed behind it If you enter lt Return gt or lt Enter gt afterwards the cursor will be placed in the next line and it will be moved the indicated amount 96 StormC the professional choice of spaces or tabulator to the right If you enter one or more characters in
221. tack frame If a shared library uses a5 as a parameter you will probably get problems when a function is called by pragma amicall In this case you should write a stub function for this function in assembler and forego the pragma call Despite this restraint the address registers a0 to a4 are available and that should suffice for nearly each function To be able to access to entries of the basis structure a pointer to the basis structure in register a6 must be indicated as a parameter This parameter is set automatically at the call of a function of the shared library An example ULONG add_two register __d0 ULONG a register _ d1 ULONG b register __a6 struct MyLibBase base ULONG retval a b base gt second_result retval return retval 124 StormC the professional choice The Setup of a Shared Library Shared Library Project Settings To create a shared library you must create a new project which contains of at least one source code with some ANSI C functions a FD file which describes the register use of the functions and an entry for the program name which always has the ending library In the settings of the project you choose at the page C C options Large Data Model and at Linker Options 1 naturally Link As Shared Library Besides you can determine the version and revision of the library Linker Options 1 has two fields for this The setup of FD files The FD file
222. tandard Chip RAM Fast RAM and configurable You should use Standard so the program can choose the best settings according to the available hardware With these settings you can force the entire program or single hunks to be loaded into Chip or Fast RAM ROM Code When you want to burn an EPROM you must use these settings The output file contains pure binaries of the code and data hunks The BSS hunk should be located at a certain address with AllocAbs Code and data hunks are relocated to the pretended address The AmigaDOS overhead of reloc hunks etc are not added After the code there is only data in the target file 86 StormC the professional choice Call of the executable program Call of the executable program Stacksize W feo kByte Taskname Current Directory J ol Procol caf Use Resource Tracking Protocol eI Start Debugger In Single Step Mode Execute Environment The string gadget or the slider can be used to adjust the stacksize for the program which will be reserved by the RunShell You can enter the name of the Exec task here You can enter the name of the directory that will be the current one for the program You can enter the name of the home directory of the program Start From CLI When started from a Shell you can supply arguments which will be evaluated by C by the parameters arge and argv At program startup from within the development env
223. thought about before compiling a new project First there are some principle settings e g default paths for Includes and linker libraries standard definitions and the settings for the program start Next the more complicated settings for code generation The global settings for a project whether the compiler will run in C or ANSI C mode can be changed for every source file Many of these settings will be set to a default if you create a new project Some of the settings are project specific and must be set according to the needs of the project As an example before starting the linker you must decide whether to build a driver or a shared library If you want to create a shared library but the settings are for a normal program the result will not be satisfying but you can correct this very easily by changing the settings and starting the compiler again The following sections will explain the individual controls of a project You should open a new project and choose the menu item Settings Project Environment The following requester has a cycle gadget to change between eight different pages The gadgets OK and Cancel will accept or cancel all these settings You should use OK to accept all these settings or click Cancel if you don t want them to be accepted or if you just wanted to have a look at them Paths and global settings The first control is the settings for the includes Environment me StormC Inc
224. to quickly and efficiently locate and remove bugs The included lexicon covers all functions and structure names used on the Amiga Because of the colorization you will notice immediately whether an entered function name is correct Another feature is the Editor s usage for debugging purposes When you start the debugger already open windows and functions will be reused You can continue working with the Editor as usual Only the breakpoint column at the left and the brightly rendered display of the program counter will remind you that you re currently debugging your program StormRun StormRun contains the Source Level Debugger and the code necessary to allow your programs to run from within the development environment It is also responsible for Resource Tracking StormASM StormASM is not a complete Assembler but an interface to an external Assembler PhxAss Its demo version and documentation are included StormC s major controls will be displayed as soon as it is loaded The icons allow for access to the compiler s most important functions StormC User Manual 31 3 FIRST STEPS a 5Ome Sun SS Mouse tools may cause problems when the help line is rendered To fix this bug we have supplied the program MagicMenuFix During the installation you will be asked whether you wish to install it in your WBStartup drawer Refer to the Readme file for more information Toolbar access Their acc
225. to undo other functions like editing or deleting text Redo is the reverse function of Undo So if you typed a text and entered Undo it disappears When entering Redo it will appear again StormED offers unlimited Undo Redo 100 StormC the professional choice For example Type the following small program into the editor window while sleep sheep Hit the keys lt Right Amiga gt lt Z gt this is the same as the menu item Edit Undo The text will disappear character by character Now hit lt Right Amiga gt lt T gt this is the same as the menu item Edit Redo The text will appear again Block Operations With the help of block operations you can move or copy small or large parts of your text These functions are very important in an editor A block is an area of the text that is marked The fundamental block operations are Mark Cut Copy and Paste To execute a block operation you must first mark a block Choose the menu item Edit Mark and move the cursor The area between the starting point of the cursor and its current position will be inverted This shows you that this area is marked All block actions will effect this area only If you choose the menu item Edit Mark again the marking of the text will disappear Cut will cut out the marked block of the text and copy it to the clipboard The block is no longer visible Copy will copy the marked block to the clipboard It will remain visible
226. tomatically and closed at the end of the program The linker library storm 1ib knows all OS 120 StormC the professional choice Use of Shared libraries libraries up to version 39 Thereby two different strategies are pursued how to treat a failure at opening 1 Libraries of Kickstart version 37 are opened with just this version and cause an error message and cancellation of the program if the opening fails 2 Libraries of later OS versions e g locale library are opened with the smallest version here locale library version 38 and the program is continued when the library can not be opened You are responsible for calling no functions which are not available on the used OS and you must not call functions from libraries which could not be opened The following two code fragment will help you testing this include lt exec libraries h gt include lt graphics ratsport h gt include lt pragma graphics_lib h gt include lt graphics gfxmacros h gt external struct Library GfxBase void setoutlinepen struct RastPort rp ULONG pen if GfxBase gt lib_Version gt 39 min OS 3 0 SetOutlinePen rp pen else SetOPen rp pen This code distinguishes between AmigaOS 3 0 and older versions to set the pen number for the borders correctly Older OS version have a macros for this only but as from V39 there exists a function StormC User Manual 121 6 COMPILER 4 The print
227. ts Changing Values oon eeesesececnenseeesesnenenesecsnesenesesssecesasesasesesasasans Sorting of Variables 2 eesecestenetetseeteeetenstseetetenensneeetenens StormC User Manual 149 7 THE DEBUGGER THE PROFILER or a rr een eee EE EEA 164 Profiler technical information 000 0 eeeteeeeeeeeteneeeeaeeeeeeeee 167 REFERENCE 3 icc i ie es es Os 169 Control Window ounce seeeenseeeeeeceeeeeeessscseseescsessseeseseeeeeesaceseeneeees 169 Status ING aeeie i E E EA O T e E 169 Program Stops At Breakpoint ssssssessessseseesessesssesseeseessesserseessesseessessesseesseseees 169 Continue Program gt vcoccesesseseonnssiucetecustosessecesecdvevesentesisateceessdecvandeeseadesesateeesece 169 Program waits fOr s e Arene aa e aA a a aE a Ra a G Ei 169 Debugger ICONS irnne sni a Ri EE a Ri 169 Goto next DreGkPOINt sib cssseeiessscscsscecedsecuasenvscssedstovessdncedesovedcevnioesvesesassuecenseseess 170 Step ii SINGlE SlOD sc vsisscisvcvescasvsceudeceestiasiesedevesscentecsvedentevess doenstsesasanddetesddestbeeds 170 Step over single step but execute function calls without stopping 171 Go to the end of the function scssscsssccsnccesccesscesscceseeessscesssessssesssceseseseoees 171 Show Current Program Position cssccsssscssscessssssscessccnecessscssesesssessesensseeneees 171 PAUSE siccvsveceicocciccscteceqetecducnceseveveceuevec cendestscatesacedcesuetesvinscbiedsiasvsndeesGacetevsteversaee 172 KD s
228. tus and progress reports in the error window Workbench Screen k o Storme o Project StormC Hello World Hello World m y Y b al z BE lt a yo J error s found Make project F8 Error Preprozessor command expected 0 _ Storm Hello Worla Helio World TENTS E T out at ae Fie Code Text cout g lt Hello World lt lt endl 7 Error Binary GEA lt lt used on illegal arguments 131 Line 8 _cout lt lt Hello World amp lt endl Error Identifier endi not defined Line 8 cout lt lt Hello World lt lt endi Hello World storm lib 336936 amiga ib 203436 A pi A o Work StormC Hello World Hello World cpp E T 8 J OUR inklude lt iostream h gt void main cout lt lt lt lt endl A xj lt j gt jal ArtEffect If the compiler finds an error it will be reported in the display below You will find a very detailed error description the line number and the source file where the error was found In our example we intentionally made a mistake in line 1 Instead of include we wrote inklude This is a very silly mistake you should have noticed when you entered the text If you have colorization enabled in the editor the word include will be rendered in a special colour As soon as you change only a single character the color changes to the standard col
229. u do not enter a value the lowest number of pixels will be used This defines the Shell window title The parameters of the options must be separated by a slash The window will be opened automatically if the program needs data or wants to provide output After the Shell window is open you can enter data immediately When you click the zoom gadget the window will be resized and repositioned according to the values given This window will be located behind all Workbench windows You can not put it in the foreground so you must change all other windows to have a look at this one The window will get all standard symbols including the close gadget 88 StormC the professional choice The window will be opened but it will not become the active one The window will not have a left or bottom borders There will only be zoom fore background and close gadgets The window will be opened without a close gadget When console window is opened with AUTO there will be a close gadget automatically added The window has no fore background gadget The window can not be moved There is zoom and fore background gadget but no drag gadget The window has a fore background gadget only The window will be opened on a public screen which must already exist You must enter the name of the public screen after the key word SCREEN When you enlarge window size the new area will be filled with text so you will have a look at parts that
230. used blocks which are not jumped to will be deleted This step will be repeated until the code can no longer be improved The joining of successive blocks and the deletion of blocks never used will also occur in higher levels Useless statements such as assigned variables that are never used will be detected and deleted 78 StormC the professional choice Quality of the Optimisation Automatic registerisation of temporaries and variables will be used if possible Assignments to variables that are never used will be deleted and the whole program will be checked again until no redundant assignments can be found An example At this useless function void f int i int j i 1 int k 2 j the second assignment will be recognised as useless From level 4 on the code will be checked again so the first one will be deleted too During M680x0 code generation redundant MOVE commands will be elimated So move 1 8 a0 d2 add 1l1 d2 _xyz will become add 1 8 a0 _xyz During expression evaluation temporary variables will be created at code generation for provisional results of any kind They may be put into processor registers later Temporary variables from lower levels will be recycled if possible to keep the number under a certain boundary The expression a bt tc will become intermediate statements like h1 h1 a b hi c From level 6 on these temporary variables will not be re used principall
231. verify whether you really want to delete this section or not Cancel Organising files of a project The biggest advantage working with a project manager is the order of all the parts of your project This will normally be Keyboard control r If you are vs deleting a file the gt way described here this will not really delete the file It will only delete its appearance in the project manager The file will still be available on your hard drive Of course you can delete files or complete sections in the project manager You might select the menu item Edit Delete or you can press lt DEL gt or lt Backspace gt StormC User Manual 61 4 PROJECT MANAGER simple click on SS the Save Project icon on the toolbar is enough to save your project As an alternative you can select Save or Save As from Project as well Please note that vs you have to enter gt lt Return gt first Unfortunately a click on the Save icon will not test whether you want to create a new drawer The options of ET SS the standard include drawer will be described in the following sections done automatically but I will show you some methods to do it even better As you know it is very easy to create a new project You only have to click on the icon New Project on the toolbar and a standard project template will be opened This project has all settings that are needed to start but one thing is mis
232. xt 7 0 Da storm lib 336936 amiga lib 203436 o Select Executable Hello World cpp 6 CEZA EZA Hello World 7186 80770279 i l v Termite Pattern F Drawer File faout ok _ art ArtEffect Volumes Parent Cancel The displayed file requester will show the contents of the project s path You can enter a file name in this path or change it to suit your needs Saving the project Next is an introduction to the text editor Before proceeding you should save the project again Since the last time you saved you have followed the steps Adding files to the project including creating a new drawer and Specifying StormC the professional choise Creating a source file the program s name Though it would not be very tragic it would be annoying if these steps were destroyed by something unpredictable such as power failures etc To save the project just click on Save project or press the function key lt F6 gt Creating a source file We will now proceed to the real programming Open the previously created source file by double clicking its name in the project An empty editor window with the title Hello World cpp will appear Before you begin to enter text please have a quick look at the editor s controls This illustration may help you Workbench Screen c a Storme c X r s y
233. y So there will be code like StormC User Manual Level 3 Level 4 Level 5 Level 6 79 4 PROJECT MANAGER Missing Prototypes Old K amp R Parameter Reference to temporary Variables hl a b h2 hl c In a later optimisation step a test is made to see if it makes sense to put h1 and h2 into the same register Because an increasing number of temporary variables can cost a lot of time and RAM this can be an expensive optimisation but it helps make the best use of the CPU registers Compiler Warnings C C Compil n Preprocessor l Options l Optimizer Warnings w7 Missing Prototype x7 K amp R Parameters w7 Reference To Temporary Variable w7 Missing return w7 Empty Statement x7 Unsave Conversion x7 Suspect w7 Unused Variables Some constructs and expressions are syntactically and semantically correct but they are a little strange and might be the consequence of a programming mistake so there are eight warnings which can be switched on and off as personal preference These are the warnings Standard of the language If a prototype is not declared for a function there will be a warning in C mode In C this is an error K amp R means Kernighan amp Ritchie the Pre ANSI pseudo Standard With this option you will get a warning if a function is declared in this old style According to the C 2 0 Standard it is an error if a Reference wil
234. y will rename the original It will have the 1 suffix and a new original file will be created The next time that file is saved the file with suffix 1 will renamed with the suffix 2 The original file as before will be renamed with suffix 1 A new original file will be created The third time it will react exactly as described before Selecting text font In the general editor settings window choose the Font position for the paging gadget StormC User Manual 53 4 PROJECT MANAGER The editor iva window can only gt display properly with monospaced fonts This means that only non proportional fonts where the width of all the characters is the same may be used The font selected here will be used for all the editor windows With the cycle gadget in the Text font group you can choose between the screen font and a custom font The default settings of StormC will use the screen font This is the font you selected with the font preferences of the Workbench for Default text font Clicking on the cycle gadget until Custom font is shown will let you select the font and its size Clicking on the pop up gadget to the right of the string gadget will pop up an ASL font requester to choose the font and its size This requester will only display the non proportional fonts Workbench Screen c a Storme mje
235. y inline function like a normal one So inline functions can be single stepped The menu item Step in in the Debugger menu has the same effect Step over single step but execute function calls without stopping This step will always go to the next breakpoint button visible in the source code but function calls are executed at full CPU speed If there is a breakpoint the program will naturally be halted The menu item Step over in the Debugger menu has the same effect Go to the end of the function The program will be single stepped until the current I gt function returns to its caller Function calls are executed at full speed The menu item Go to end of function in the Debugger menu has the same effect Show Current Program Position This is the position after the last step or after reaching a breakpoint When the source code position in th eeditor is Pc lost e g by viewing the source code position of a variable definition it can be displayed by this button Normally the debugger displays all source sin the same editor window At every change of it the old on will be removed out of memory and the new one is loaded so the number of open windows can be minimised StormC User Manual 171 ys 7 THE DEBUGGER 172 In cases a source is used very often it is sensible to keep it open permanently So it must be opened by a double click on its entry in the project and not on the one in the module w

Download Pdf Manuals

image

Related Search

Related Contents

EPM MUELLER® Modular Extractor System 2 - epm  commade é distance controllo remoto remote control  User Manual of MATrix-II  Double Auto Reverse Cassette Deck  Manual de usuario v.3.2.2 Noviembre 2014    Aiwa XD-SPM823 DVD Player User Manual  IBM Windows Srv Standard 2012 2CPU/2VM Add. Lic. ROK - Multi  Manuel d`utilisation (MSZ-FE09-12NA)  TW-500R  

Copyright © All rights reserved.
Failed to retrieve file