; *********************************************************************** ; * * ; * Trivial User Mode Code * ; * * ; *********************************************************************** ; Author: John Zaitseff ; Date: 28th May, 2003 ; Version: 1.2 ; This file contains a trivial User mode program: all it does is increment ; a software-based counter in register R0. This code represents the "real ; work" that a program might want to do instead of spending its time ; polling hardware devices. .text ; Ordinary program code follows .global main ; Make this label visible to other modules main: ; Main program, running in User mode mov r0, #0 ; Initialise a trivial counter in R0 count_loop: ; Main program loop add r0, r0, #1 ; Increment the counter; this gives the main ; program something to do... nop ; Waste a machine cycle doing nothing b count_loop ; Do this forever (or until stopped) .end