osbyte call ? and which adress

discussion of beeb/electron applications, languages, utils and educational s/w
duikkie
Posts: 2649
Joined: Fri Feb 07, 2014 3:28 pm

osbyte call ? and which adress

Postby duikkie » Thu Jul 20, 2017 7:40 am

oke my book tells me inkey for bbc or keyboard scan but ???

a%=&81:x%=0:y%=&ff:a%=(usr(&fff4)and&ff00)/256
if a%<>1 ?&224=?(&24+!&ffb7)

before running it ?&224=&a6 and after running it ?&224=&a6 so ???

is osbyte &81 something else ??

and what is the adress from (&24+!&ffb7) ??

User avatar
tricky
Posts: 1811
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: osbyte call ? and which adress

Postby tricky » Thu Jul 20, 2017 11:34 am

X%, not x%

User avatar
ctr
Posts: 93
Joined: Wed Jul 16, 2014 2:53 pm

Re: osbyte call ? and which adress

Postby ctr » Thu Jul 20, 2017 12:07 pm

&FFB7 holds the address of the default vector table. As seen here.

!&FFB7 is the address of the default vector table (&D940 on OS 1.20).

?(&24+!&FFB7) is the low byte of the default NETV vector.

?&224 is the low byte of the NETV vector.

So you are replacing the low byte of the NETV vector with its default value, which it probably had anyway.

In the first line of code (assuming it's really in upper case) a% is set to the value of the X register after the osbyte call. The exact meaning of this osbyte call is unspecified. Y=255 means a keyboard scan, but only if X is negative. Vanilla OS 1.20 treats this as a scan for a non-existent key and always returns X=255, never 1. On a Master it returns X=253.

If the first line of code is actually in lower case then a%,x% and y% are ignored and usr is an array!

The code seems to be saying "unless the osbyte call behaves in a non-standard way, partially unhook the netv vector".

duikkie
Posts: 2649
Joined: Fri Feb 07, 2014 3:28 pm

Re: osbyte call ? and which adress

Postby duikkie » Thu Jul 20, 2017 12:20 pm

else so if a%=1

a%=163
x%=128
y%=1
call &fff4

i don't have osbyte call 163 in the big old book :(

User avatar
ctr
Posts: 93
Joined: Wed Jul 16, 2014 2:53 pm

Re: osbyte call ? and which adress

Postby ctr » Thu Jul 20, 2017 3:37 pm

I should have looked at the beeb wiki in the first place:

OSBYTE 129 with X=0 and Y=255 reads the OS version.

The original code is saying if this isn't an Electron then partially reset the NETV vector.

OSBYTE 163 checks for various extensions.


Return to “software: other”

Who is online

Users browsing this forum: Lardo Boffin, markdryan and 4 guests