Emulation
Pages: 1 2
nemo (145) 2546 posts |
Jon guessed
As I’ve pointed out many times before, this wasn’t even true on the BBC Micro. It has always been capable of returning more than 16bits even on the MOS, and the convention chosen in Arthur ensured that it could return 32bit addresses. And that’s how it’s always used. Not only is OS_Byte not limited to bytes (at all, in or out), but all the code that uses such calls rebuilds the 32bit address as Jeff has pointed out. The galling bit is that when somebody put the ‘new’ API in, presumably in the belief that the old API wasn’t 32bit, they actually had to look at that line of code that Jeff has highlighted… and they still couldn’t see it was 32bit. Sheesh. Martin quibbled
It’s hamstrung by a 26bit API, which means that perfectly innocent code that uses a buffer in a Dynamic Area could suddenly start setting bits it didn’t mean to in a 32bit build. However, it is definitely broken and always was because it checks the wrong bits anyway. |
Rick Murray (539) 13840 posts |
No, actually, it isn’t. Yes, I know you can return an extra 8 bits in A, giving a total of 24 bits. If the value to be returned by the “where is the MOS stuff?” call was supposed to be larger than 16 bits, it would have been an OSWORD.
Certainly, so it really wouldn’t be a big deal for the high vector builds to OR in the upper halfword so the end result was a valid address that still worked. By all means have a ReadSysInfo, but breaking the older API is… unnecessary.
Not to mention the fun of shoving both into the same vector – https://www.riscosopen.org/wiki/documentation/show/ReadLineV Take a moment to think about this. Remember I was having a go above for the half-assed way of bashing in an extra 8 bits in the Accumulator?
And, yeah… cerise sur le gâteau… |
nemo (145) 2546 posts |
You then go on to show that 24 is greater than 16, proving me correct. Perhaps you’re quibbling about the definition of “always”. Let me rephrase it – OSBYTE was capable of returning more than 16bits before Arthur existed. As far as RISC OS is concerned, that may as well be ‘always’. And OS_Byte has always been able to return 32bit values. Ça suffit. I can’t clarify that further without pasting the actual code from every Acorn version of RISC OS and Arthur… which I would do (he says pointedly) if it brought me any joy. |
Rick Murray (539) 13840 posts |
Certainly, three eight bit registers can return a 24 bit result if you’re willing to simply ignore the bit that states that one of the registers is preserved on exit.
And let me rephrase it – BBC AUG p180 documenting calls 166 and 167. A is preserved. This is in response to: As I’ve pointed out many times before, this wasn’t even true on the BBC Micro. It has always been capable of returning more than 16bits even on the MOS
Knock yourself out. I’m not arguing RISC OS behaviour. And if you actually read my message rather than skipping bits, you’ll maybe have noticed that I think that the high order bits of the high vector address should be ORed into the value read from the 16 bit value in OS workspace to form a valid 32 bit address. I’m arguing your assertion that the BBC MOS could return bigger values. Technically, yes. But when the docs say that A is preserved, one expects A to be preserved; additionally the standard MOS had no need to use more than 16 bits as that was sufficient to represent the entire addressing range of the processor. Anything add on that did return larger values did so in contravention of the API (it probably should have added an OSWORD, but there’s enough “probably should have” in any API…). |
nemo (145) 2546 posts |
Once again, thank you for establishing this fact. Again.
“Always” refers to OS_Byte. The observation that OSBYTE changed during the 8bit era is of historical interest only – when OS_Byte was born, OSBYTE had the API I described. And if you think OS_Byte always preserves its “A” – R0 – then OS_Byte,0 would like a word. I’m not going to argue with you any more on this subject. |
Rick Murray (539) 13840 posts |
OSBYTE &00 (0) *FX 0 Identify Operating System version Entry parameters: X=0 Execute BRK with a message giving the O.S. type X<>0 RTS with O.S. type returned in X On exit, X=0, OS 1.00 X=1, OS 1.20 A and Y are preserved C is undefined Or the original user guide: OSBYTE call with A=&0 (0) Read operating system version number So… <shrug>
Yeah, it’s boring me too, pointing out the many places where MOSVARS was clearly considered to be a 16 bit entity… and a remnant of the MOS lingering in RISC OS. Whatever. |
nemo (145) 2546 posts |
You are continuing to get confused between OSBYTE and OS_Byte. |
Pages: 1 2