Re: [Tack-devel] back-end tables, assemblers, and front-ends
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: David G. <dg...@co...> - 2006-07-21 23:21:02
|
Gregory T. (tim) Kelly wrote: [...] > STMFD R12<,{R13,R14} > MOV R13,R12 I think this is using a radically different ABI than most systems use. Th= is looks like it's using R12 as the stack pointer and R13 as the frame point= er. This means that after this: [...] > SUB R12,R12,#8 > STMFD R12<,{R7,R6} =2E..it's indexing four locals off R12 (two uninitialised variables and t= he old values of r6 and r7, and this: [...] > LDR R7,[R13,#8] =2E..is accessing function parameters, which seem to be passed on the sta= ck. The reason why you're not seeing the arguments in r0-r4 is that they're just = not there! The stack layout they're using seems to look like this (assuming sp is as= it is after the function prologue): sp+0C max sp+08 min sp+04 old fp \ return frame sp+00 old pc / fp+0C unused local fp+08 unused local fp+04 old r6 fp+00 old r7 This is a completely alien ABI to the entire rest of the ARM world, inclu= ding RiscOS, which the port was done *for*... I think they can get away with i= t because RiscOS executables are standalone binary blobs that communicate w= ith the outside world via system calls, which switch stacks. So binary compatibility is unnecessary. It does seem to be credited to "an anonymous student at the Vrije Univers= iteit"... --=20 +- David Given --McQ-+ "Gaping from its single obling socket was | dg...@co... | scintillating, many fauceted scarlet emerald..." | (dg...@ta...) | --- Jim Theis, _The Eye of Argon_ (spelling +- www.cowlark.com --+ original) |