diff --git a/intermezzo.S b/intermezzo.S index ccc3b59..30d01aa 100644 --- a/intermezzo.S +++ b/intermezzo.S @@ -9,10 +9,10 @@ _start: // First, we'll need to move ourselves _out_ of the target area. // We'll copy down into the start of the IRAM. - ldr r0, =post_relocation - ldr r1, =START_OF_IRAM + ldr r0, =START_OF_IRAM + ldr r1, =post_relocation ldr r2, =intermezzo_end - sub r2, r2, r0 + sub r2, r2, r1 bl copy // Jump to the start of RAM, which should now contain the post-relocation code. @@ -24,8 +24,8 @@ _start: post_relocation: // Next, we'll copy our payload down to the appropriate relocaiton address. - ldr r0, =LOAD_BLOCK_START - ldr r1, =RELOCATION_TARGET + ldr r0, =RELOCATION_TARGET + ldr r1, =LOAD_BLOCK_START ldr r2, =LOAD_BLOCK_LENGTH bl copy @@ -36,16 +36,16 @@ post_relocation: // // Simple block copy. -// r0 = source address -// r1 = destination address +// r0 = destination address +// r1 = source address // r2 = length in bytes -// Destroys r3. +// Destroys r0-r3. // copy: // Copy the word... - ldr r3, [r0], #4 - str r3, [r1], #4 + ldr r3, [r1], #4 + str r3, [r0], #4 // And continue while we have words left to copy. subs r2, r2, #4 diff --git a/intermezzo.bin b/intermezzo.bin index 755f4be..b0f4512 100755 Binary files a/intermezzo.bin and b/intermezzo.bin differ diff --git a/intermezzo.elf b/intermezzo.elf new file mode 100755 index 0000000..070de5a Binary files /dev/null and b/intermezzo.elf differ diff --git a/intermezzo.o b/intermezzo.o new file mode 100644 index 0000000..793e121 Binary files /dev/null and b/intermezzo.o differ