Post Reply 
ARM Error Undefined FPTR Name
03-31-2017, 08:30 AM
Post: #1
ARM Error Undefined FPTR Name
Here is a very simple ARM assembly source.
When I build it and EVAL I get : Error Undefined FPTR Name
Why ?

"!RPL
CODE
SAVE

!ARM
STMDB sp! {R4 R5 R6 R7 R8 LP}
LDMIA sp! {R4 R5 R6 R7 R8 PC}

!ASM
LOADRPL
ENDCODE
;
@"
Visit this user's website Find all posts by this user
Quote this message in a reply
03-31-2017, 02:09 PM
Post: #2
RE: ARM Error Undefined FPTR Name
(03-31-2017 08:30 AM)sunhp Wrote:  Here is a very simple ARM assembly source.
When I build it and EVAL I get : Error Undefined FPTR Name
Why ?

"!RPL
CODE
SAVE

!ARM
STMDB sp! {R4 R5 R6 R7 R8 LP}
LDMIA sp! {R4 R5 R6 R7 R8 PC}

!ASM
LOADRPL
ENDCODE
;
@"

Not so simple. You can't embed ARM code in Saturn assembler and expect the emulated CPU to switch modes automatically. You have to tell it to execute the ARM code with the ARMSYS and ARMSAT instructions. Also, ARM code must be word-aligned (word=32 bits in this context), therefore you can't simply embed it, it needs to be copied in memory to an aligned position, then executed.
In other words you need a "launcher" like the one discussed here.
You could also install the ARM Toolbox from hpcalc.org and create a string, also as explained on the same old post. The Toolbox will align and launch the code for you, but the small launcher discussed there will do the job well with a lot less overhead for small programs.
Find all posts by this user
Quote this message in a reply
03-31-2017, 09:29 PM
Post: #3
RE: ARM Error Undefined FPTR Name
You could also create self-modifying code. Pad in some nibbles (of value 0) in front of and behind the ARM code. During compile time, calculate the offset of the start of the SATURN code to the ARM code (and embed it into the SATURN code; the offset should include the width of the offset itself). Use this offset during runtime to determine whether you need to move the ARM block a few nibbles so that it is byte aligned. If you do move it, adjust the offset for future runs. Then do a jump to the start of the ARM code after moving the ARM code within the SATURN code.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
04-01-2017, 08:00 AM
Post: #4
RE: ARM Error Undefined FPTR Name
Thank you guys for your clear explanations !
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)