diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD2.S | |
| download | Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.gz Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.bz2 | |
Diffstat (limited to 'Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD2.S')
| -rw-r--r-- | Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD2.S | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD2.S b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD2.S new file mode 100644 index 0000000..8fbc660 --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/GCD2.S @@ -0,0 +1,17 @@ + AREA gcd2, 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
+ SUBGT r0, r0, r1
+ SUBLT r1, r1, r0
+ BNE gcd
+ MOV pc,lr
+
+ END ; mark end of file
\ No newline at end of file |
