DICE C Compiler - from installation to first "hello.c"
The first question that Joe Average would ask (where the word "DICE"
makes one think of a random number generator cube with eyes) would be: what actually is DICE? DICE
is an ANSI-C development system that was written by Matt Dillion entirely for and on the Amiga. But
DICE is even more:

DICE is a 68000 compiler and, provided you download the source, can be compiled on any platform
you choose. DICE is easy to install - in any case much easier than Unix-like GNU-C. DICE is
admittedly not perfect, but is the perfect solution for those who want to develop a pair of small
tools and want to avoid a GCC installation, nor can raise the considerable sum of money required for
a commercial compiler. DICE is for people who are not so familiar with C++ and need to first learn
the ANSI-C standard. DICE is now Freeware.
DICE is perhaps not every man/woman's thing, especially those used to clicking on windows, who
will need to be first re-acquainted with their keyboard. But don't worry - this workshop is meant
exactly for these type of people. This will be a style of manual, and so I won't detail every single
step. Later on, everyone should by then have the ability to experiment further and broaden their
knowledge.

Ok let's start. Drop down to the sites listed below, and download the good
bits - the abundant docs and corresponding archives. Fortunately, there is not much to download, and
you will have a simple overview.
Why should you really use DICE and not some other compiler? Firstly, DICE runs on every Amiga
(starting with an Amiga 500/1MB), and secondly, DICE compiles somewhat faster than GNU-C. What is
DICE made up of exactly? Well, there's...
Compiler 'DCC' (übersetzt den Code)
Debugger 'DEBUG' (noch nicht ganz ausgereift)
Linker 'DLINK' (fügt Objektdateien zusammen)
Profiler 'DPROF' (wie tut unser Programm so?)
Assembler 'DAS', 'A68k' (komfortabler als 'DAS')
Online Help 'DiceHelp' (Info auf Knopfdruck)
'VMake', 'VOpts' (wer ungern MakeFiles selber macht)
Development Tools (Objektdateien und Libs manipulieren)
Make Utility 'DMake' (wer gern MakeFiles macht)
Editor 'DME' und andere (besser CygnusEd oder GoldEd)
Source Code Management Tools
Romable Code Generation Tools
Libraries & Source Codes
|

Installation
Decompress the DICE archive from the Aminet. Then read the file ReadMe.1st under
"Installation" to see which assigns the program needs. Or if you're feeling lazy, just
simply enter
assign DCC: <where it is installed>/DICE
assign DLIB: DCC:dlib
assign DINCLUDE: DCC:include
path DCC:bin/ ADD
|
in the s:user-startup file. Then copy the dicecache.library to LIBS:. Next we
need the AmigaOS includes (not actually for "Hello World!", but perhaps later for a
program with a GUI). In case you have the Developer CD V1.2, do the following:
MakeDir dinclude:amiga31
MakeDir dinclude:amiga31/fd
Copy ADCD_v1.2:ndk/ndk_3.1/includes&libs/include_h/#? dinclude:amiga31/ all
Copy ADCD_v1.2:ndk/ndk_3.1/includes&libs/fd/#? dinclude:amiga31/fd/
|
Or the following if you have V1.1:
MakeDir dinclude:amiga31
MakeDir dinclude:amiga31/fd
Copy Amiga_Dev_CD_v1.1:NDK_3.1/Includes&Libs/include_h/#? dinclude:amiga31/ all
Copy Amiga_Dev_CD_v1.1:NDK_3.1/Includes&Libs/fd/#? dinclude:amiga31/fd/
|
So, a little browsing in the various ReadMe files never hurts, and I'm sure everyone will find
their own way around quite easily. It is really not so difficult, and you will probably notice that
some files are somewhat old, but don't be so disconcerted with that.

Our first program
There is a nice little workshop to be found in the docs directory
(BEGINNER_README.DOC) that explains everything precisely. When you read this and follow it
through, nothing should really go wrong. Ok good, I think to myself, and type away...
Neuer Shell-Prozeß 11
11.Ram Disk:> dcc
DCC 1.12 (24.12.95)
Copyright (c) 1992,1993,1994 Obvious Implementations Corp., Redistribution & Use under DICE-LICENSE.TXT.
11.Ram Disk:> t:
11.Ram Disk:T> ced test.c
|
Whereby test.c looks like:
#include <stdio.h>
#include <stdlib.h>
main()
{
puts("HEllo World!");
return(0);
}
|
And now...
11.Ram Disk:T> dcc test.c -o test
DLINK: "" L:0 C:0 Error:41 Unable to find dlib:amigas.lib model <>
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _LVOAllocMem (amiga/c)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _LVOSetSignal (amiga/c)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _LVOFreeMem (amiga/c)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _LVOForbid (amiga/c)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _LVOReplyMsg (amiga/c)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _FindTask (T:main)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _Open (T:main)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _CurrentDir (T:main)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _AllocMem (T:malloc)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _IsInteractive (T:isatty)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _Seek (T:lseek)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _Seek (T:write)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _Write (T:write)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _SetSignal (T:chkabort)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _DeleteFile (T:fclose)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _Close (T:close)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _FreeMem (T:free)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _Wait (T:free)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _LVOWaitPort (alib/wbmain)
DLINK: "" L:0 C:0 Error:36 Undefined Symbol: _LVOGetMsg (alib/wbmain)
Exit code 20
|
Oooops, what's happening here? Ah, you have to establish which libraries are to be used. We'll
have that in a moment...
11.Ram Disk:T> dlib:
11.Fox:dice/dlib> dir
amiga20l.lib amiga20pl.lib
amiga20rl.lib amiga20rpl.lib
amiga20s.lib amiga20sp.lib
amiga20sr.lib amiga20srp.lib
amiga31l.lib amiga31pl.lib
amiga31rl.lib amiga31rpl.lib
amiga31s.lib amiga31sp.lib
amiga31sr.lib amiga31srp.lib
autol.lib autos.lib
c.o cl.lib
cpl.lib crl.lib
crpl.lib cs.lib
cs.lib.free csp.lib
csp.lib.free csr.lib
csrp.lib c_pi.o
c_pr.o ml.lib
mpl.lib mrl.lib
mrpl.lib ms.lib
msp.lib msr.lib
msrp.lib muil.lib
muirl.lib muis.lib
muisr.lib reqtoolsl.lib
reqtoolsrl.lib reqtoolss.lib
reqtoolssr.lib roml.lib
romrl.lib roms.lib
romsr.lib ucs.lib
ucsr.lib x.o
|
As I have OS3.1, I enter the following:
11.Fox:dice/dlib> setenv dccopts -3.1
|
And try again...
11.Fox:dice/dlib> t:
11.Ram Disk:T> dcc test.c -o test
11.Ram Disk:T> test
HEllo World!
|
Yep, that works quite well now, and to make it resident in memory compile it so:
11.Ram Disk:T> dcc test.c -o test -r
11.Ram Disk:T> test
HEllo World!
|
Finito
That's it, The End. The rest you should all be able to work out easily for yourself. There are a
couple of nice tutorials in a good Amiga ex-magazine (CU
Amiga) on Amiga Intuition programming. The Amiga RKMs and the developer CDs are a good tip, also
the Amiga Guru Book by Ralph Babel and various other literature sources. I have a large amount of
books about C on the Amiga here at home in case anyone is interested. I can't read them all anyway,
so e-mail me.
|