EasyManua.ls Logo

Commodore Amiga A2000 - Page 17

Commodore Amiga A2000
380 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
NOTE
The offset values of the registers are the addresses that the Copper must use to talk to
the registers. For example, in assembler:
INCLUDE "exec/types.i"
INCLUDE "hardware/custom.i"
XREF custom ; External reference
Start: lea _custom,a0 ; Use a0 as base register
move.w #$7FFF,intena(a0) ; Disable all interrupts
In C, you would use the structure definitions in hardware/custom.h For
example:
#include "exec/types.h"
#include "hardware/custom.h"
extern struct Custom custom;
/* You may need to define the above external as
** extern struct Custom far custom;
** Check you compiler manual.
*/
main()
{
custom.intena = 0x7FFF; /* Disable all interrupts */
}
The Amiga hardware include files are generally supplied with your compiler or assembler.
Listings of the hardware include files may also be found in the Addison-Wesley Amiga ROM
Kernel Manual "Includes and Autodocs". Generally, the include file label names are very
similar to the equivalent hardware register list names with the following typical
differences.
o Address registers which have low word and high word components are generally listed
as two word sized registers in the hardware register list, with each register name
containing either a suffix or embedded "L" or "H" for low and high. The include file label
for the same register will generally treat the whole register as a longword (32 bit)
register,
and therefore will not contain the "L" or "H" distinction.
o Related sequential registers which are given individual names with number suffixes in
the hardware register list, are generally referenced from a single base register definition
in the include files. For example, the color registers in the hardware list (COLOR00,
COLOR01, etc.) would be referenced from the "color" label defined in "hardware/custom.i"
(color+0, color+2, etc.).
o Examples of how to define the correct register offset can be found in the hw_examples.i
file listed in Appendix J.
- 8 Introduction -

Table of Contents

Other manuals for Commodore Amiga A2000

Related product manuals