Sprotne naloge 3, 4
This commit is contained in:
commit
a0af5764eb
2
sprotne_naloge/naloga_03/vaja_01.s
Normal file
2
sprotne_naloge/naloga_03/vaja_01.s
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
mov R1, #128 @ se prevede v 0xe3a01080
|
22
sprotne_naloge/naloga_03/vaja_02.s
Normal file
22
sprotne_naloge/naloga_03/vaja_02.s
Normal file
|
@ -0,0 +1,22 @@
|
|||
.text
|
||||
.org 0x20
|
||||
@spremenljivke
|
||||
|
||||
stev1: .word 0x12345678
|
||||
STEV2: .byte 128
|
||||
.align
|
||||
STEV3: .hword 0xF123
|
||||
|
||||
.align
|
||||
.global _start
|
||||
_start:
|
||||
@program
|
||||
|
||||
adr r0, stev1
|
||||
ldr r1, [r0]
|
||||
|
||||
adr r0, stev2
|
||||
ldr r1, [r0]
|
||||
|
||||
adr r0, stev3
|
||||
ldr r1, [r0]
|
14
sprotne_naloge/naloga_03/vaja_03_16bit.s
Normal file
14
sprotne_naloge/naloga_03/vaja_03_16bit.s
Normal file
|
@ -0,0 +1,14 @@
|
|||
.text
|
||||
.org 0x20
|
||||
|
||||
STEV1: .hword 0x0201
|
||||
STEV2: .space 2
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
|
||||
adr r0, STEV1
|
||||
ldr r1, [r0]
|
||||
|
||||
adr r0, STEV2
|
||||
strh r1, [r0]
|
14
sprotne_naloge/naloga_03/vaja_03_32bit.s
Normal file
14
sprotne_naloge/naloga_03/vaja_03_32bit.s
Normal file
|
@ -0,0 +1,14 @@
|
|||
.text
|
||||
.org 0x20
|
||||
|
||||
stev1: .word 0x04030201
|
||||
stev2: .space 4
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
|
||||
adr r0, stev1
|
||||
ldr r1, [r0]
|
||||
|
||||
adr r0, stev2
|
||||
str r1, [r0]
|
16
sprotne_naloge/naloga_03/vaja_03_8bit.s
Normal file
16
sprotne_naloge/naloga_03/vaja_03_8bit.s
Normal file
|
@ -0,0 +1,16 @@
|
|||
.text
|
||||
.org 0x20
|
||||
|
||||
stev1: .byte 0x01
|
||||
stev2: .space 1
|
||||
.align
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
|
||||
adr r0, stev1
|
||||
ldr r1, [r0]
|
||||
|
||||
adr r0, stev2
|
||||
strb r1, [r0]
|
||||
|
15
sprotne_naloge/naloga_04/vaja_01.s
Normal file
15
sprotne_naloge/naloga_04/vaja_01.s
Normal file
|
@ -0,0 +1,15 @@
|
|||
.text
|
||||
.org 0x20
|
||||
stev1: .word 0x00000001
|
||||
stev2: .word 0x00000002
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
|
||||
adr r0, stev1
|
||||
|
||||
ldrh r1, [r0]
|
||||
ldrh r2, [r0, #4]
|
||||
|
||||
str r2, [r0]
|
||||
str r1, [r0, #4]
|
16
sprotne_naloge/naloga_04/vaja_02.s
Normal file
16
sprotne_naloge/naloga_04/vaja_02.s
Normal file
|
@ -0,0 +1,16 @@
|
|||
.text
|
||||
.org 0x20
|
||||
|
||||
tabela: .space 5
|
||||
|
||||
.align
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
|
||||
adr r0, tabela
|
||||
|
||||
mov r1, #0xffffffff
|
||||
|
||||
str r1, [r0]
|
||||
strb r1, [r0, #4]
|
35
sprotne_naloge/naloga_04/vaja_03.s
Normal file
35
sprotne_naloge/naloga_04/vaja_03.s
Normal file
|
@ -0,0 +1,35 @@
|
|||
.text
|
||||
.org 0x20
|
||||
|
||||
tabela: .space 6
|
||||
|
||||
.align
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
|
||||
adr r0, tabela
|
||||
|
||||
ldr r1, =0x04030201
|
||||
str r1, [r0]
|
||||
|
||||
ldrh r1, =0x0605
|
||||
str r1, [r0, #4]
|
||||
|
||||
@ zamenjaj 1. <-> 6.
|
||||
ldrb r1, [r0]
|
||||
ldrb r2, [r0, #5]
|
||||
strb r2, [r0]
|
||||
strb r1, [r0, #5]
|
||||
|
||||
@ zamenjaj 2. <-> 5.
|
||||
ldrb r1, [r0, #1]
|
||||
ldrb r2, [r0, #4]
|
||||
strb r2, [r0, #1]
|
||||
strb r1, [r0, #4]
|
||||
|
||||
@ zamenjaj 3. <-> 4.
|
||||
ldrb r1, [r0, #2]
|
||||
ldrb r2, [r0, #3]
|
||||
strb r2, [r0, #2]
|
||||
strb r1, [r0, #3]
|
22
sprotne_naloge/naloga_04/vaja_04.s
Normal file
22
sprotne_naloge/naloga_04/vaja_04.s
Normal file
|
@ -0,0 +1,22 @@
|
|||
.text
|
||||
.org 0x20
|
||||
|
||||
stev1: .word 0x01020304
|
||||
|
||||
.align
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
|
||||
adr r0, stev1
|
||||
|
||||
ldrb r1, [r0]
|
||||
ldrb r2, [r0, #3]
|
||||
strb r2, [r0]
|
||||
strb r1, [r0, #3]
|
||||
|
||||
ldrb r1, [r0, #1]
|
||||
ldrb r2, [r0, #2]
|
||||
strb r2, [r0, #1]
|
||||
strb r1, [r0, #2]
|
||||
|
Loading…
Reference in New Issue
Block a user