Date : Sat, 23 Sep 2006 23:01:46 +0100
From : jgh@... (Jonathan Graham Harston)
Subject: Odd bug in ANFS
While rooting around inside ANFS 4.25 to try and flesh out my
documentation for NetFS_Info() - OSWORD &13 - I found an
interesting bug.
The OSWORD &13 code does:
A9BC TAX ; Pass subcall to X
A9BD CMP #19 ; Is subcode >=19 ?
A9BF BCS ->RTS ; Exit with subcode 19+
However, it then goes on to fetch a routine address from a table
with only 18 entries! The byte at &A9BE should be &12. Calling
OSWORD &13 with subcode 18 jumps to an address formed from the
high byte of address 0 and the first byte of the code following
the table, jumping to &20AA.
This can be verified with:
>$&20AA=CHR$0+"!BANG"+CHR$0
>DIM X% 31:Y%=X%DIV256:?X%=18:A%=&13:CALL &FFF1
BANG
>
--
J.G.Harston - jgh@... - mdfs.net/User/JGH
NOBODY expects the MACRO ARGUMENT INQUISITION! Our chief weapon is
unexpected addressing modes... unexpected addressing modes and local
branches out of range. Our two weapons are unexpected addressing modes and
local branches out of range and quoted argument lists. Our *three* weapons
are unexpected addressing modes, local branches out of range, quoted
argument lists, and an almost fanatical devotion to the pope. *Amongst* our
weapons are such elements as unexpected addressing modes, local branches out
of range... I'll come in again.