Files
RTS10_labs/lab1.1/listing1
2025-09-05 16:03:05 +02:00

37 lines
1.1 KiB
Plaintext

paste folowing code in first address for lazy typers:
2008490860082055060049076008200049066008230f031b4a053a01d1fd40586008e7f9383040020c0040020c14400258540014
0x20000000: 2008
0x20000002: 4908
0x20000004: 6008
0x20000006: 2055
0x20000008: 0600
0x2000000A: 4907
0x2000000C: 6008
0x2000000E: 2000 -> MOVS.N R0, #0 // set R0 to value 0
0x20000010: 4906 -> LDR.N R1, [PC, #24] // load PC + 24 (address 0x2000002c) into R1
0x20000012: 6008 -> STR.N R0, [R1, #0] // store address from R1 into R0
0x20000014: 230f -> MOVS.N R3, #15 // set R3 to value 15
0x20000016: 031b -> LSRS.N R3, R3, #12
loop
0x20000018: 4a05 -> LDR.N R2, [PC, #20] // load PC + 20 (address 0x20000030 <delay>) into R2
wait
0x2000001A: 3a01 -> SUBS.N R2, #1
0x2000001C: d1fd -> BNE.N [PC, #-2] // jump to wait if zero flag
0x2000001E: 4058 -> EORS.N R0, R0, R3
0x20000020: 6008 -> STR.N R0, [R1, #0]
0x20000022: e7f9 -> B.N [PC, #-10] // jump to loop
.word
0x20000024: 3830
0x20000026: 4002
.word
0x20000028: 0c00
0x2000002A: 4002
.word
0x2000002C: 0c14
0x2000002E: 4002
.word delay
0x20000030: 5854
0x20000032: 0014