ra/sprotne_naloge/naloga_03/naloga_03.txt
Gašper Dobrovoljc 2e8dab904d
Vaja 03 popravki
2023-11-08 15:18:50 +01:00

79 lines
773 B
Plaintext

1. mov R1, #128 @ se prevede v 0xe3a01080, R1 = 0x80, PC = 0x4
2.
.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]
3.
32-bit
.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-bit
.text
.org 0x20
STEV1: .hword 0x0201
STEV2: .space 2
.global _start
_start:
adr r0, STEV1
ldr r1, [r0]
adr r0, STEV2
strh r1, [r0]
8-bit
.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]