User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Help with this assembly code

Sat Nov 24, 2018 1:12 am

Paeryn wrote:
Sat Nov 24, 2018 12:26 am
The oldest APCS I could find is from Acorn RISC Machines with a copyright of 1994 (so slightly earlier than I could find on Arm's website), no idea what revision it is though (it doesn't say and it's a plain text document), that has the same usage as now.

No idea on how printf is picking up R4 for you without knowing how it was compiled. Have you tried compiling a C program against it and looking at how it is passing parameters?
Yes around 1994 would be correct. I forget which peice of software my copy came with, though it was late 1994 that I got it based on the October 1994 date on the 3 page Acorn document.

Yes it I had that wrong, do to an incorrect document, combined with my personal memory failing. I apologize.

I did figure it out on why the extra parameter was accepted that way, it does not work in C.

I have a fast C library that I had put together for playing around with that uses R0-R8 for parameters, it is only of any use from assembly, and I have my toolchain configured to link with that for assembly source if any C Library function is called. I had was not thinking about it until i dumped the assembly listing from gcc, and it did not line up.

Thank you for the refresher.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
Paeryn
Posts: 2735
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Help with this assembly code

Sat Nov 24, 2018 3:25 am

No worries, at least it's sorted where the confusion came from.
She who travels light — forgot something.

Return to “Bare metal, Assembly language”