; *********************************************************************** ; * * ; * Software Interrupt Handler for the Flash Program, First Version * ; * * ; *********************************************************************** ; Author: John Zaitseff ; Date: 28th May, 2003 ; Version: 1.2 ; This file contains the software interrupt handler for the first version ; of the Flash program (flash-v1.elf), as used in ELEC2041 Experiment 5. ; ----------------------------------------------------------------------- ; The following code will be placed into the ".ospage" section, NOT into ; the ".text" section. The GNU Linker will place the ".ospage" section at ; address 0x1000. ; Notice that the file boot-swi-v1.s also contains code that is placed ; into the ".ospage" section; see Figure 8 in ELEC2041 Experiment 5 to see ; how the GNU Linker handles this situation. .section .ospage, "awx" ; For "operating system" code .global swi_handler ; Make this label visible to other modules swi_handler: ; Software Interrupt handler ; This handler runs in Supervisor mode ; This very simple SWI handler expects the caller to initialise R0 to the ; "protected port" address and R1 to the byte to be written to that ; address, prior to the invocation of SWI. Nothing useful is returned. strb r1, [r0] ; Write the byte in R1 to "protected port" R0 movs pc, lr ; Return to caller (end of exception) .end