<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Mon, 26 May 2003 01:56:38 +0100
From   : jgh@... (Jonathan Graham Harston)
Subject: Re: Re: Encoding of line numbers in BBC BASIC

> Message-ID: <5.2.1.1.0.20030523125924.00ad8cd8@...>
 
Dennis Hartley <D.F.Hartley@...> wrote:
> >"Fewell, Steve" <Steve.Fewell@...> wrote:
> > > On Fri, 28 Feb 1997 Robert Schmidt wrote:
> > > > Does anyone know how this is done for line numbers in statements like
> > > > "GOTO x" etc.?
> 
> If memory serves it was stored in the program as two hex bytes following
> the GOTO (etc) command byte.
 
Four bytes: &8D, &x1, &x2, &x3 where &x1 to &x3 are encoded as stated in
http://www.mdfs.net/Docs/Comp/BBCBasic/Line/Numbers3
 
In summary:
Byte 0 : &8D
Byte 1 :(((lsb AND &C0) DIV 4) OR ((msb AND &C0) DIV 16)) EOR &54
Byte 2 :  (lsb AND &3F) OR &40
Byte 3 :  (msb AND &3F) OR &40
 
-- 
J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TR
jgh@...                - Running on BBCs & Masters with SJ MDFS FileServer
Z80+6502/CoPro+Tubes/Econet+SJ - - - - - - - http://www.mdfs.net/User/JGH/



<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>