naloga_06

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

48
naloga_06/naloga_06.txt Normal file
View File

@ -0,0 +1,48 @@
1. naloga
.text
.org 0x20
.align
.global _start
_start: @ stanje zastavic register nepred. pred.
movs r0, #0 @ N = 0, Z = 1 0x00000000 0 0
subs r0, r0, #1 @ N=1,Z=0,C=0,V=0 0xffffffff maks -1
adds r0, r0, #2 @ N=0,Z=0,C=1,V=0 0x00000001 1 1
end: b end
2. naloga
.text
.org 0x20
.align
.global _start
_start: @ stanje zastavic register nepred. pred.
movs r0, #1 @ N = 0, Z = 0 0x00000001 1 1
subs r0, r0, #1 @ N=0,Z=1,C=1,V=0 0x00000000 0 0
subs r0, r0, #1 @ N=1,Z=0,C=0,V=0 0xffffffff maks -1
end: b end
3. naloga
.text
.org 0x20
STEV1: .hword -10
STEV2: .byte 0x64
STEV3: .byte -2
.align
.global _start
_start:
adr r0, STEV2
ldrsb r2, [r0]
adr r0, STEV3
ldrsb r3, [r0]
add r2, r2, r3
adr r0, STEV1
ldrsh r1, [r0]
sub r1, r2, r1
strh r1, [r0]
end: b end

11
naloga_06/vaja_01.s Normal file
View File

@ -0,0 +1,11 @@
.text
.org 0x20
.align
.global _start
_start:
movs r0, #0
subs r0, r0, #1
adds r0, r0, #2
end:
b end

11
naloga_06/vaja_02.s Normal file
View File

@ -0,0 +1,11 @@
.text
.org 0x20
.align
.global _start
_start:
movs r0, #1
subs r0, r0, #1
subs r0, r0, #1
end:
b end

24
naloga_06/vaja_03.s Normal file
View File

@ -0,0 +1,24 @@
.text
.org 0x20
STEV1: .hword -10
STEV2: .byte 0x64
STEV3: .byte -2
.align
.global _start
_START:
adr r0, STEV2
ldrsb r2, [r0]
adr r0, STEV3
ldrsb r3, [r0]
add r2, r2, r3
adr r0, STEV1
ldrsh r1, [r0]
sub r1, r2, r1
strh r1, [r0]
END:
b end