[TUHS] Having trouble with V6 source code

jigsaw jigsaw at gmail.com
Tue Oct 3 01:24:11 AEST 2006


Yes...thank you for pointing out my typo and what does the back slash mean.

In the v6 assembler manual, the \> is listed as an example of
escaping, but it doesn't clearly state it equals to logical shift
right (or left).

Regards,

Qinglai

On 10/2/06, Jose R Valverde <txomsy at yahoo.es> wrote:
> No.
>
> On PDP 11 assembler the left and right shifts were a
> single < and >.
>
> You made a typo when transcribing the source
> statement: you typed
>
> > 0636: mov $USIZE-1/<8|6, (r1)+
>
> but the actual code from m40.s reads
>
> > 0636:         mov     $usize-1\<8|6,(r1)+
>
> However, since < and > where also used to delimit
> strings, there was a
> need to escape them so as to distinguish their usage
> as shifts from the
> string delimiters. The escaping was achieved by \
> which is what you see
> in the code.
>
> See the assembler section of vol 2b of the Unix V7
> manuals for details at
>         http://plan9.bell-labs.com/7thEdMan/v7vol2b.pdf
> or
>         http://web.cuzuco.com/%7Ecuzuco/v7/v7vol2b.pdf
> namely:
>
> 6.1 Expression operators
>         The operators are:
>         (blank) when there is no operand between operands,
> the effect is
>                 exactly the same as if a ''+'' had appeared.
>         + addition
>         – subtraction
>         * multiplication
>         \/ division (note that plain '' / '' starts a
> comment)
>         & bitwise and
>         | bitwise or
>         \> logical right shift
>         \< logical left shift
>         ...   ...   ...
>
>                                 j
>
> On Mon, 2 Oct 2006 09:44:58 +0300
> jigsaw <jigsaw at gmail.com> wrote:
> > hi all,
> >
> > I just started to read the source code of V6 with
> Lion's book.
> >
> > But before I went far I was stopped by m40.s
> >
> > 0636: mov $USIZE-1/<8|6, (r1)+
> >
> > What does the slash "/" stand for?
> >
> > I guess this line should be
> >
> > mov $USIZE-1<<8|6, (r1)+
> >
> > Is "/<" the same as "<<"?
> >
> > I checked in Unix PDP11 Assemble Refrence Manual but
> didn't find a clue.
> >
> > Is it the right place to ask such question?
> >
> > Thanks in advance
> >
> > Regards,
> >
> > Qinglai
>
>
>
>
>
> ______________________________________________
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
>



More information about the TUHS mailing list