You've already forked pico-loader
mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-01-09 16:28:35 -08:00
22 lines
432 B
ArmAsm
22 lines
432 B
ArmAsm
|
|
.cpu arm7tdmi
|
||
|
|
.section "offsettosectorremap", "ax"
|
||
|
|
.syntax unified
|
||
|
|
.thumb
|
||
|
|
|
||
|
|
// r0 = rom offset
|
||
|
|
// returns sd sector in r0
|
||
|
|
// returns remaining sectors in cluster in lr
|
||
|
|
.global offset_to_sector_remap
|
||
|
|
.type offset_to_sector_remap, %function
|
||
|
|
offset_to_sector_remap:
|
||
|
|
push {lr}
|
||
|
|
lsrs r0, r0, #9 // byte address to sector address
|
||
|
|
movs r1, #1
|
||
|
|
mov lr, r1 // read at most 1 sector at a time
|
||
|
|
pop {pc}
|
||
|
|
|
||
|
|
.balign 4
|
||
|
|
|
||
|
|
.pool
|
||
|
|
|
||
|
|
.end
|