OS_File 255
Greg (2474) 144 posts |
Not sure if this is a bug. Certainly looks like it. Nothing serious though I don’t think. I’ve got a bit of code that loads a file into memory and MOV R0,#255 My question is if the file doesn’t exist the documentation https://www.riscosopen.org/wiki/documentation/show/OS_File%20255 says that R0 = 0 but in my case it returns an address that |
Rick Murray (539) 13750 posts |
The documention says An error will be generated if the file is not found, is a directory, no read access, or a bad load address. Which means, as is common with most SWIs, if the V flag is set on exit, then R0 will be a pointer to an error block. It isn’t specifically mentioned in the documentation for each call because it is something that applies to all of them. |
Greg (2474) 144 posts |
Yes Rick, I am aware of the V flag again, i’d forgotten that to be fair. https://www.riscosopen.org/wiki/documentation/show/File%20Object%20Types Yet when my code above is run it does not return a 0. It As an afterthought, when I get a dump of the registers and flags, are |
Stuart Painting (5389) 709 posts |
The wiki page on “File Object Types” is used by 19 other pages besides “OS_File 255”. It is reasonable to suppose that one or more of those do indeed make use of object type 0 meaning “not found”, but as already mentioned OS_File 255 returns an error instead. |
Greg (2474) 144 posts |
Ahh. Okay then Stuart that makes more sense. Thats cleared that up. No need to wonder anymore. |
Rick Murray (539) 13750 posts |
That would be rather odd. ;-)
|
Stuart Swales (8827) 1326 posts |
@Greg – I think you may be trying *ShowRegs? That register dump isn’t modified simply because a SWI is returning a V-set error. |
Greg (2474) 144 posts |
Oops. My bad gentlemen. Eyes wern’t working. Capital V to show V flag is set. Promise I will double check my homework before handing in next time :-) |