diff options
author | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-10-16 18:28:43 +0100 |
---|---|---|
committer | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-10-16 18:28:43 +0100 |
commit | d7e482e0ffb57c1086908fc9279a8c6f653905b0 (patch) | |
tree | 104ff175dafb754021fffea2a9a826df5d2c0d77 | |
parent | Start refractor (diff) | |
download | Arm_Programming-d7e482e0ffb57c1086908fc9279a8c6f653905b0.tar.gz Arm_Programming-d7e482e0ffb57c1086908fc9279a8c6f653905b0.tar.bz2 Arm_Programming-d7e482e0ffb57c1086908fc9279a8c6f653905b0.zip |
commit
-rw-r--r-- | 05.s | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/05.s b/05.s index a1b5719..3ac556f 100644 --- a/05.s +++ b/05.s @@ -13,11 +13,12 @@ and_dog DEFB "and his dog, Spot",0 ALIGN -;4 men went to mow\n start MOV R1, #0 MOV R2, #4 -main ADR R0, verse ; change to R2 +;4 men went to mow +main SUB R2, R2, #1 + ADR R0, R2 SWI 3 ADR R0, space SWI 3 @@ -33,21 +34,26 @@ main ADR R0, verse ; change to R2 ; R2 is the number from 4 to 1 ADR R0, R2 SUB R0, R0, R1 - ; down to here it makes sense CMP R0, #1 ;i need 2 counters ADD R1, R1, #1 ;increase the substract value SWI 4 - + BEQ singlr + + ADR R0, men + SWI 3 B main ADR R0, mowdow SWI 3 - CMP ; we need to compare n of iterations - smaller than 3 - BLT main - + CMP R2, #4 + BST main SWI 2 + +singlr ADR R0, man + SWI 3 + + B main |