Module Error
Adolf Brady (2580) 5 posts |
Hi! ORRS PC, R14, #Overflow_Flag How do I implement #Overflow_Flag in BASIC? If I leave the “SWI entry” as if it was a normal routine, I get the exception: Module ‘X’ is not 32-bit compatible (while RMFlag is declared in the Header). I may add the SWI part to this post if you think it could be another problem. |
Rick Murray (539) 13850 posts |
What are you using as your reference? Whatever it is, it is OUTDATED and should not be used. That sort of code simply won’t run on ARM processors any more. The Processor Status Register is no longer a part of the Program Counter.
As said, the PSR and PC are not the same thing on 32 bit ARM. What you are attempting here will set PC to whatever R14 is and also set bit 28. It will work, but it will have a very different outcome to what you expect. ;-) Ditto, if your reference says to exit with I ought to get around to finishing that. ;-)
Assuming “#Overflow_Flag” is &10000000 (or 1<<28):
[ http://www.heyrick.co.uk/armwiki/The_Status_register – but note that it says “CPSR_flg”, the terminology has changed, it should be “CPSR_f” these days…]
How are you declaring it? The word at +48 is a pointer to a word containing the flags. If you are expanding from a source written for an earlier version of RISC OS, note that there is an extra word in there → +44 is a Messages pointer. |
Steve Pampling (1551) 8172 posts |
Heyrick pages? :) Neutral and 32 bit examples needed. |
Rick Murray (539) 13850 posts |
If you look at the page on modules, you’ll see that was covered (briefly) back in 2004, and the example module is clearly marked as not being 32 bit safe. ;)
Yes. http://www.heyrick.co.uk/software/resfinder/resfinder_s.html Go up to parent folder (/resfinder) for description and other files (headers etc). Duh. That wasn’t a module, was it. :-/ |
Adolf Brady (2580) 5 posts |
Well, I’m following this tutorial: http://www.heyrick.co.uk/assembler/modcode.html#swihandler I’ve changed the Overflow part, and I still get the incompatibility error. .SWIbaseNumber .JumpTable .SWI_0 .SWI_1 .UnknownSWIerror .ErrToken |
Rick Murray (539) 13850 posts |
I think the incompatibility is because the 32 bit word is wrong. In true Internet style, what follows is completely untested and was written my me, here, in the browser editor. Hence, there may be a billion “issues”; the first of which is that it is written for objasm and not BASIC. I don’t remember the OPT settings for making modules in BASIC as I use objasm these days… Hope this helps, anyway. Maybe tomorrow I’ll give it a whirl, see if it actually works. 8-) I have used SWI chunk &16F00 and module title, *command, and SWI prefix MyModule. These are not officially allocated and are for example purposes only. Any module you plan to release should be allocated – details here: https://www.riscosopen.org/content/allocate
[stupid piece of XXXX forum threw away my took-a-long-time-to-write post but HA! I KEPT A COPY! Nerr nerr ner-nerr nerr!] |
Steve Pampling (1551) 8172 posts |
Done in your head, just like a lecturer told me couldn’t be done1 about 30 years ago.
1 He was wrong of course, as the wadge of split beermats2 with Z80 assembler he had to mark testified. |
Steve Revill (20) 1361 posts |
You’re brave, given our site’s tendency to throw forum posts away by logging you out for no obvious reason… |
Rick Murray (539) 13850 posts |
Bottom line of my long post reads:
Forewarned is forearmed, as they say. Bet I could get more done if I had four arms… ;-) |
WPB (1391) 352 posts |
Surely you’d have to update the kernel first? |
Adolf Brady (2580) 5 posts |
Rick, my Module works correctly now. Thank you very much. |