2ô Tells you what the current processor mode is ô 'ô by Richard Murray 26th April 1999 (ô 2:ô Downloaded from: http://www.heyrick.co.uk/assembler/ < FÞ code% 256 P Zã loop% = 0 ¸ 2 ˆ 2 d P% = code% n [ OPT loop% x ‚ MOV R0, #3 Œ € R0, R0, PC – CMP R0, #3   BEQ svc ª ´ CMP R0, #2 ¾ BEQ irq È Ò CMP R0, #1 Ü BEQ fiq æ ð CMP R0, #0 ú BEQ usr  3 \ only two bits, so we won't get to here...  " .svc , ADR R0, bgn 6 SWI "OS_Write0" @ ADR R0, stx J SWI "OS_Write0" T B end ^ h .irq r ADR R0, bgn | SWI "OS_Write0" † ADR R0, itx  SWI "OS_Write0" š B end ¤ ® .fiq ¸ ADR R0, bgn  SWI "OS_Write0" Ì ADR R0, ftx Ö SWI "OS_Write0" à B end ê ô .usr þ ADR R0, bgn  SWI "OS_Write0"  ADR R0, utx  SWI "OS_Write0" & B end 0 : .bgn D0 EQUS "The processor is currently in " N EQUB 0 X EQUB 0 b l .stx v EQUS "SVC mode." € EQUB 0 Š EQUB 0 ” EQUB 0 ž ¨ .itx ² EQUS "IRQ mode." ¼ EQUB 0 Æ EQUB 0 Ð EQUB 0 Ú ä .ftx î EQUS "FIQ mode." ø EQUB 0  EQUB 0   EQUB 0   .utx * EQUS "USR mode." 4 EQUB 0 > EQUB 0 H EQUB 0 R \ .end f SWI "OS_NewLine" p SWI "OS_NewLine" z MOV PC, R14 „ Ž ] ˜í ¢ ¬ Ö code% ÿ