change the params order of copy

This commit is contained in:
trisz404 2018-05-02 16:00:53 +02:00
parent 21a30bbf41
commit 3b3c579961
4 changed files with 10 additions and 10 deletions

View File

@ -9,10 +9,10 @@ _start:
// First, we'll need to move ourselves _out_ of the target area. // First, we'll need to move ourselves _out_ of the target area.
// We'll copy down into the start of the IRAM. // We'll copy down into the start of the IRAM.
ldr r0, =post_relocation ldr r0, =START_OF_IRAM
ldr r1, =START_OF_IRAM ldr r1, =post_relocation
ldr r2, =intermezzo_end ldr r2, =intermezzo_end
sub r2, r2, r0 sub r2, r2, r1
bl copy bl copy
// Jump to the start of RAM, which should now contain the post-relocation code. // Jump to the start of RAM, which should now contain the post-relocation code.
@ -24,8 +24,8 @@ _start:
post_relocation: post_relocation:
// Next, we'll copy our payload down to the appropriate relocaiton address. // Next, we'll copy our payload down to the appropriate relocaiton address.
ldr r0, =LOAD_BLOCK_START ldr r0, =RELOCATION_TARGET
ldr r1, =RELOCATION_TARGET ldr r1, =LOAD_BLOCK_START
ldr r2, =LOAD_BLOCK_LENGTH ldr r2, =LOAD_BLOCK_LENGTH
bl copy bl copy
@ -36,16 +36,16 @@ post_relocation:
// //
// Simple block copy. // Simple block copy.
// r0 = source address // r0 = destination address
// r1 = destination address // r1 = source address
// r2 = length in bytes // r2 = length in bytes
// Destroys r3. // Destroys r0-r3.
// //
copy: copy:
// Copy the word... // Copy the word...
ldr r3, [r0], #4 ldr r3, [r1], #4
str r3, [r1], #4 str r3, [r0], #4
// And continue while we have words left to copy. // And continue while we have words left to copy.
subs r2, r2, #4 subs r2, r2, #4

Binary file not shown.

BIN
intermezzo.elf Executable file

Binary file not shown.

BIN
intermezzo.o Normal file

Binary file not shown.