diff options
author | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-10-15 20:51:15 +0100 |
---|---|---|
committer | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-10-15 20:51:15 +0100 |
commit | 92ad493aaec8325637a467903b506ec22c49f485 (patch) | |
tree | 41a20e36bdb2eb46790b4b999167a0e8df582e87 /meadow2018.s | |
download | Arm_Programming-92ad493aaec8325637a467903b506ec22c49f485.tar.gz Arm_Programming-92ad493aaec8325637a467903b506ec22c49f485.tar.bz2 Arm_Programming-92ad493aaec8325637a467903b506ec22c49f485.zip |
Initial Commit
Diffstat (limited to 'meadow2018.s')
-rw-r--r-- | meadow2018.s | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/meadow2018.s b/meadow2018.s new file mode 100644 index 0000000..dbcd513 --- /dev/null +++ b/meadow2018.s @@ -0,0 +1,55 @@ + B start + + +verse DEFW 4 +menmow DEFB "went to mow\n",0 +mowdow DEFB "Went to mow a meadow\n",0 +men DEFB "men",0 +man DEFB "man",0 +comma DEFB ",",0 +nl DEFB "\n",0 +space DEFB " ",0 +and_dog DEFB "and his dog, Spot",0 + + + ALIGN +;4 men went to mow\n +start MOV R1, #0 +main ADR R0, verse + SWI 3 + ADR R0, space + SWI 3 + ADR R0, men + SWI 3 + ADR R0, menmow + +;Went to mow a meadow\n + ADR R0, mowdow + SWI 3 + +;4 men, X men, + + + + ADR R0, mowdow + SWI 3 + + ADR R0, verse + SUBS R0, R0, R1 ; SUBS + ADD R1, R1, #1 ;increase the substract value + SWI 4 + + BHI #0 print_plural + BEQ #0 singular + + SWI 2 + + +singular + + + B main + +plural + + B main |