diff options
Diffstat (limited to 'thumb2regs.s')
-rw-r--r-- | thumb2regs.s | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/thumb2regs.s b/thumb2regs.s index c7494b2..c5cb467 100644 --- a/thumb2regs.s +++ b/thumb2regs.s @@ -7,6 +7,9 @@ @ B stack pointer: r13 (sp) @ link/scratch register: r14 (lr) +.if 0 + +@ ARM allocation BSTACK_0 .req r4 BSTACK_1 .req r3 BSTACK_2 .req r2 @@ -25,3 +28,41 @@ HEAP_PTR .req r10 SCRATCH_REG .req r12 LINK_REG .req r14 + +.else + +@ Thumb-2 optimised allocation +BSTACK_0 .req r4 +BSTACK_1 .req r3 +BSTACK_2 .req r2 +BSTACK_3 .req r11 +BSTACK_4 .req r10 +BSTACK_PTR .req r13 + +ASTACK_0 .req r6 +ASTACK_1 .req r7 +ASTACK_2 .req r8 +ASTACK_3 .req r12 +ASTACK_PTR .req r5 + +HEAP_FREE .req r9 +HEAP_PTR .req r1 + +SCRATCH_REG .req r0 +LINK_REG .req r14 + +.macro store_bstack_and_lr + push {r2,r3,r4,r10,r11,lr} +.endm +.macro load_bstack_and_pc + pop {r2,r3,r4,r10,r11,pc} +.endm + +.macro store_global_registers + push {HEAP_PTR} +.endm +.macro load_global_registers + pop {HEAP_PTR} +.endm + +.endif |