| M68K Ada Technical Summary: For mission-critical applications on Motorola M68000 family computers | ||
|---|---|---|
| Prev | Chapter 4. User Interface and Debugging Facilities | Next |
For Ada 83 and Ada 95 the predefined program library is located in a standard place, which is target dependent. The location is /opt/m68k-ada-1.7/lib/gcc-lib/m68k-coff/2.8.1/adalib/.
Ada source files are always compiled in the context of a program library. While M68K Ada does not have a closed library as some other Ada compilers do, it does generate and use library file information. By default this goes in the current directory. Library files use the .ali (Ada library) suffix. Also M68K Ada requires each Ada compilation unit to be in a separate file with the file name the same as the unit name. There must be a file extension which is .ads for a package or subprogram specification and .adb for a body.
Where a source file contains more than one compilation unit, then the program m68k-coff-gnatchop may be used to divide the file. This program will write the output files in the current directory, or (more usefully) into a named directory.
For example:
The compiler accepts several command line options to control the format of listings. By default, no listing is generated at all.
Output full source listing with embedded error messages.
Verbose mode. Full error output with source lines to stdout.
Keep going despite syntax errors.
bash$ m68k-coff-gcc -gnatlqv ackermann.adb
XGC Ada m68k-ada/-1.7/
Copyright 1992-2002 Free Software Foundation, Inc.
Compiling: ackermann.adb (source file time stamp: 2001-04-25 16:57:54)
1. function Ackermann (m, n : Integer) return Integer is
2. begin
3. if m = 0 then
4. return n + 1;
5. elsif n = 0 then
6. return Ackermann (m - 1, 1);
7. else
8. return Ackermann (m - 1, Ackermann (m, n - 1));
9. end if;
10. end Ackermann;
11.
11 lines: No errors
The assembler can also generate a listing, as follows:
bash$ m68k-coff-gcc -Wa,-a -O -c ackermann.adb 1 .file "ackermann.adb" 2 gcc2_compiled.: 3 __gnu_compiled_ada: 4 .text 5 .even 6 .globl _ada_ackermann 7 _ada_ackermann: 8 0000 4E56 0000 link.w %a6,#0 9 0004 2F0A move.l %a2,-(%sp) 10 0006 226E 0008 move.l 8(%a6),%a1 11 000a 206E 000C move.l 12(%a6),%a0 lots of output...
The objdump program can also generate a listing by disassembling the object code.