ô >32bittest ô 3ô Short example to go into 32 bit mode, set the (4ô Z flag, and return to a conditional based upon 2 ô this. <ô F9ô Downloaded from http://www.heyrick.co.uk/assembler/ Pô Z d;ô We need to ensure the required hardware is present... n‹î … È™ "OS_PrettyPrint", "Sorry, you'll need a RiscPC or later, with a 32 bit capable processor in order to use this software." : ñ : à xÈ™ "OS_Memory", 6 ‚ Œî … ñ ö$+" at "+Ã(ž/10) : à –  Þ code% 1024 ªñ "Assembling code" ´ã l% = 0 ¸ 2 ˆ 2 ¾ P% = code% È [ OPT l% Ò6 ¢ 1 ; Enable ExtBASICAsm Ü æ3 \ Preserve our R14 and then enter SVC mode ð STMFD R13!, {R14} ú SWI "OS_EnterOS"   ADR R0, entering  SWI "OS_Write0" " SWI "OS_NewLine" , 6S \ Turn off all interrupts, because RISC OS won't be expecting 32 bit mode! @ SWI "OS_IntOff" J T \ User32 code ^ MOV R0, #%10011 hJ MSR CPSR_all, R0 ; Select CPSR mode, clear all the bits r MOV R0, R0 | †/ MRS R0, CPSR_all ; Read CPSR 9 BIC R0, R0, #&F0000000 ; Clear the flag bits š9 BIC R0, R0, #&1F ; Clear the mode bits ¤3 „R R0, R0, #1<<30 ; Set the Z flag ®3 „R R0, R0, #%11 ; Set SVC26 mode ¸, MSR CPSR_all, R0 ; Do it!  MOV R0, R0 Ì Ö) \ Turn interrupts back on again. à SWI "OS_IntOn" ê ô ADR R0, exiting þ SWI "OS_Write0"  SWI "OS_NewLine"  3 \ If Z set, print Z set else print Z unset & ADR R0, zunset 0 ADREQ R0, zset : SWI "OS_Write0" D SWI "OS_NewLine" N X \ Return to º mode b BIC R14, PC, #3 l TEQP R14, #0 v MOV R0, R0 € Š \ And get out of here. ” LDMFD R13!, {PC} ž ¨ .zunset ²: EQUS " Z flag is not set (this ain't right!)" ¼ EQUB 0 Æ ALIGN Ð Ú .zset ä1 EQUS " Z flag is set (as expected!)" î EQUB 0 ø ALIGN    .entering D EQUS " About to enter 32 bit mode, cross your fingers!"   EQUB 0 * ALIGN 4 > .exiting H3 EQUS " Returned to 26 bit mode. Phew!" R EQUB 0 \ ALIGN f ] pí z „ñ "Executing code" Ž Ö code% ˜ñ "Finished" ¢ ¬à ÿ