This commit is contained in:
Gašper Dobrovoljc 2023-12-12 17:19:11 +01:00
parent f14b5c4907
commit 5aee58cb4a
No known key found for this signature in database
GPG Key ID: 0E7E037018CFA5A5
5 changed files with 147 additions and 0 deletions

32
naloga_08/vaja_01.s Normal file
View File

@ -0,0 +1,32 @@
.text
.org 0x20
stev1: .space 4
stev2: .word 123
stev3: .word 456
.global _start
_start:
@ stev2 -> r2
adr r0, stev2
ldr r2, [r0]
@ stev3 -> r3
adr r0, stev3
ldr r3, [r0]
@ r2 = r3
mov r2, r3
@ r2 > r3
cmp r2, r3
bhi dalje
mov r1, r3
dalje:
@ r1 -> stev1
adr r0, stev1
str r1, [r0]

32
naloga_08/vaja_02.s Normal file
View File

@ -0,0 +1,32 @@
.text
.org 0x20
stev1: .space 4
stev2: .word 123
stev3: .word 456
.global _start
_start:
@ stev2 -> r2
adr r0, stev2
ldr r2, [r0]
@ stev3 -> r3
adr r0, stev3
ldr r3, [r0]
@ r2 = r3
mov r2, r3
@ r2 < r3
cmp r2, r3
blo dalje
mov r1, r3
dalje:
@ r1 -> stev1
adr r0, stev1
str r1, [r0]

32
naloga_08/vaja_03_a.s Normal file
View File

@ -0,0 +1,32 @@
.text
.org 0x20
stev1: .space 4
stev2: .word 123
stev3: .word 456
.global _start
_start:
@ stev2 -> r2
adr r0, stev2
ldrs r2, [r0]
@ stev3 -> r3
adr r0, stev3
ldrs r3, [r0]
@ r2 = r3
mov r2, r3
@ r2 > r3
cmp r2, r3
bgt dalje
mov r1, r3
dalje:
@ r1 -> stev1
adr r0, stev1
str r1, [r0]

32
naloga_08/vaja_03_b.s Normal file
View File

@ -0,0 +1,32 @@
.text
.org 0x20
stev1: .space 4
stev2: .word 123
stev3: .word 456
.global _start
_start:
@ stev2 -> r2
adr r0, stev2
ldrs r2, [r0]
@ stev3 -> r3
adr r0, stev3
ldrs r3, [r0]
@ r2 = r3
mov r2, r3
@ r2 > r3
cmp r2, r3
blt dalje
mov r1, r3
dalje:
@ r1 -> stev1
adr r0, stev1
str r1, [r0]

19
naloga_08/vaja_04.s Normal file
View File

@ -0,0 +1,19 @@
.text
.org 0x20
.global _start
_start:
zanka:
cmp r1, r2
blo l1
beq l2
sub r1, r2
b zanka
l1:
sub r2, r1
b zanka
l2: