Don’t do this
nemo (145) 2556 posts |
MOV R10,#OS_CallASWI SWI OS_CallASWI ; Go directly to #1 Infinite Loop Nor the obvious alternative. Amusingly, you can do either version of this: MOV R10,#OS_CallASWIR12 MOV R12,#OS_WriteI+7 SWI OS_CallASWI ; Use CallASWI to get CallASWIR12 to call WriteC It would be a really good idea to not change Basic to use Both of the CallASWIs should reject both of the CallASWIs, really. |
Rick Murray (539) 13851 posts |
RISC OS sanity checking inputs? What’s this heresy? |
Jon Abbott (1421) 2651 posts |
It’s explicitly stated in the documentation to not do that:
|
Steve Pampling (1551) 8172 posts |
There’s a warning on the bottom end of power pylons stating danger of death – people still try to climb them so it’s no surprise Nemo is testing the equivalent of the lower level licking a 9 volt battery. The questions are:
|
Rick Murray (539) 13851 posts |
I say leave it. If somebody wants to use a SWI to call itself and cause a universal meltdown, then let’s count that as a lesson to be understood and learned… I mean, of we’re going to talk about dumb things not to do – don’t treat the base of the RMA as a beginning of a sprite area… There’s loads of stuff not to do. ;-) |
Jon Abbott (1421) 2651 posts |
RTFM
A pointless exercise I’d say, you’d end up adding so much input validation to so many SWI. Developer time would be better spent rewriting SWI’s into C. |
Steve Pampling (1551) 8172 posts |
It was a rhetorical question. Of course there’s the question whether the rewrite in C would be like for like or be enhanced, but we can leave that for another day. |
Matthew Phillips (473) 721 posts |
The merit in leaving the SWIs as they are now is that computers should do what they are told. You might be stupid to ask the computer to do that, but we learn from our mistakes. |
nemo (145) 2556 posts |
My point, not sufficiently clear it seems, is
Because, regardless of RTFM, |