User guide

2: Software Development for the ICP
DC 900-1338I 37
For programs written in assembly language, the
freeway/icpcode/proto_kit/src directory
includes the files
sysequ.asm, with OS/Impact system call macros, and oscif.asm, with
assembly language definitions of OS/Impact data structures. These files are in a format
compatible with the CrossCodeC assembler, but can also be modified for use by other
assemblers.
2.4 Motorola 68xxx Programming Environment
The Motorola 68xxx CPU is a 32-bit microprocessor with 32-bit registers, internal data
paths, and addresses that provides a four-gigabyte direct addressing range. If your
application code will be written in assembly language, you will find the MC68000 Fam-
ily Reference Manual (Motorola) indispensable. It contains information on the general-
purpose and special registers, addressing modes, instruction set, and exception process-
ing. When programming in a higher-level language, most aspects of the processor are
relatively transparent. The following sections present some general information to help
you understand the 68xxx programming environment.
2.4.1 Processor Privilege States
The 68xxx supports two privilege levels: user and supervisor. On the ICP, OS/Impact
operates in supervisor state, as do all interrupt service routines and certain sections of
the application code. All tasks (including the system-level timer) operate in user state,
where certain operations are not allowed. See the MC68000 Family Reference Manual
(Motorola) for additional information.
2.4.2 Stack Pointers
The 68xxx special registers include three stack pointers: user (USP), master (MSP), and
interrupt (ISP). When the M-bit in the status register is set to zero, only the USP and
ISP are used. The ICP always operates in this mode, and user code must never set the
M-bit to one.