; *********************************************************************** ; * * ; * Header File for ELEC2041 Experiment 5, First Version * ; * * ; *********************************************************************** ; Author: John Zaitseff ; Date: 28th May, 2003 ; Version: 1.2 ; This file contains definitions (constants) needed for ELEC2041 ; Experiment 5. In particular, the files flash-v1.s and boot-swi-v1.s ; make use of this file by using the ".include" assembler directive. ; ; Files of this sort (that only contain definitions using the ".set" or ; ".equ" assembler directives) are often called header files, since they ; are used for the same purposes that header files are used in C. ; ; The main reason for using header files is that all of the definitions ; are brought together into one place, instead of having to be repeated in ; each source code file. This also makes it easier to change the ; definitions at a later date. ; ----------------------------------------------------------------------- ; ARM Processor definitions ; The following lines define some of the bits in the Current Processor ; Status Register and the various Saved Processor Status Registers. .set ARM_PSR_i, 0b10000000 ; I bit in CPSR/SPSRs .set ARM_PSR_f, 0b01000000 ; F bit in CPSR/SPSRs .set ARM_PSR_t, 0b00100000 ; T bit in CPSR/SPSRs ; The bottom five bits of the CPSR/SPSR define the processor mode; the ; following lines define the values that can appear in these five bits. ; The ARM_PSR_mode_mask is used to "mask off" these bits, and is used when ; reading and/or writing to the CPSR/SPSRs. .set ARM_PSR_mode_mask, 0b11111 ; Processor modes mask .set ARM_PSR_mode_usr, 0b10000 ; User mode .set ARM_PSR_mode_fiq, 0b10001 ; Fast Interrupt mode .set ARM_PSR_mode_irq, 0b10010 ; Interrupt mode .set ARM_PSR_mode_svc, 0b10011 ; Supervisor mode .set ARM_PSR_mode_abt, 0b10111 ; Abort mode .set ARM_PSR_mode_und, 0b11011 ; Undefined mode .set ARM_PSR_mode_sys, 0b11111 ; System mode ; ----------------------------------------------------------------------- ; DSLMU Microcontroller Board-specific definitions ; The following lines contain definitions specific to the Komodo ARM ; environment running on the DSLMU Microcontroller Board. .set portA, 0x10000000 ; Microcontroller Port A address .set value1, 0b11111111 ; Value to turn the LEDs on .set value2, 0b00000000 ; Value to turn the LEDs off ; Please note that you must NEVER include the ".end" assembler directive ; in a header file: doing so will cause the GNU Assembler to stop reading ; ALL files at that particular point, meaning that the assembler will ; never even see the rest of your code. This leads to unusual error ; messages and difficult trouble-shooting, often at the linking stage!