diff options
Diffstat (limited to 'Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD1.S')
| -rw-r--r-- | Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD1.S | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD1.S b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD1.S new file mode 100644 index 0000000..fec499f --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD1.S @@ -0,0 +1,21 @@ + AREA gcd1, CODE, READONLY ; name this block of code
+ ENTRY ; mark first instruction
+ ; to execute
+start
+ MOV r0, #1 ; Set up parameters
+ MOV r1, #2
+ BL gcd ; Call subroutine
+ SWI 0x11 ; terminate
+
+gcd
+ CMP r0, r1
+ BEQ end
+ BLT less
+ SUB r0, r0, r1
+ BAL gcd
+less
+ SUB r1, r1, r0
+ BAL gcd
+end MOV pc,lr
+
+ END ; mark end of file
\ No newline at end of file |
