The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Having trouble with V6 source code
@ 2006-10-02 14:24 Jose R Valverde
  0 siblings, 0 replies; 7+ messages in thread
From: Jose R Valverde @ 2006-10-02 14:24 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1770 bytes --]

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [TUHS] Having trouble with V6 source code
@ 2006-10-03 12:25 Wolfgang Helbig
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Helbig @ 2006-10-03 12:25 UTC (permalink / raw)


Hi,

I'd like to add
	http://www.ba-stuttgart.de/~helbig/os/v6/doc/as.ps
as a reference to the assembler of Unix V6.

>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

Greetings,
Wolfgang
--
"Dijkstra is right, but you don't say such things!"
(A less courageous programmer)




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [TUHS] Having trouble with V6 source code
  2006-10-02 14:22 Jose R Valverde
@ 2006-10-02 15:24 ` jigsaw
  0 siblings, 0 replies; 7+ messages in thread
From: jigsaw @ 2006-10-02 15:24 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2330 bytes --]

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
>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [TUHS] Having trouble with V6 source code
@ 2006-10-02 14:22 Jose R Valverde
  2006-10-02 15:24 ` jigsaw
  0 siblings, 1 reply; 7+ messages in thread
From: Jose R Valverde @ 2006-10-02 14:22 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1770 bytes --]

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [TUHS] Having trouble with V6 source code
  2006-10-02 12:50 ` Hans Rosenfeld
@ 2006-10-02 12:59   ` jigsaw
  0 siblings, 0 replies; 7+ messages in thread
From: jigsaw @ 2006-10-02 12:59 UTC (permalink / raw)


hi Hans,

It's my mistake - it is \ rather than /

And refer to the assambler manual for UNIX v7, the "/<" stands for
"shift left", i.e., <<.

Regards,

Qinglai

On 10/2/06, Hans Rosenfeld <rosenfeld at grumpf.hope-2000.org> wrote:
> On Mon, Oct 02, 2006 at 09:44:58AM +0300, jigsaw wrote:
> > But before I went far I was stopped by m40.s
> > 0636: mov $USIZE-1/<8|6, (r1)+
>
> In my printed copy it is a \<, not a /<
>
> > What does the slash "/" stand for?
>
> / would start a comment
>
> > I guess this line should be
> > mov $USIZE-1<<8|6, (r1)+
>
> I don't know for sure, but I doubt that the assembler will understand
> this C syntax.
>
> This piece of code is commented on page 6-2:
>
> 'The value 007406 is obtained by shifting the octal value 017 eight
> places to the left and then "or"ing in the value of 6;'
>
>
>
> --
> %SYSTEM-F-ANARCHISM, The operating system has been overthrown
>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [TUHS] Having trouble with V6 source code
  2006-10-02  6:44 jigsaw
@ 2006-10-02 12:50 ` Hans Rosenfeld
  2006-10-02 12:59   ` jigsaw
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Rosenfeld @ 2006-10-02 12:50 UTC (permalink / raw)


On Mon, Oct 02, 2006 at 09:44:58AM +0300, jigsaw wrote:
> But before I went far I was stopped by m40.s
> 0636: mov $USIZE-1/<8|6, (r1)+

In my printed copy it is a \<, not a /<

> What does the slash "/" stand for?

/ would start a comment

> I guess this line should be
> mov $USIZE-1<<8|6, (r1)+

I don't know for sure, but I doubt that the assembler will understand
this C syntax. 

This piece of code is commented on page 6-2:

'The value 007406 is obtained by shifting the octal value 017 eight
places to the left and then "or"ing in the value of 6;'



-- 
%SYSTEM-F-ANARCHISM, The operating system has been overthrown



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [TUHS] Having trouble with V6 source code
@ 2006-10-02  6:44 jigsaw
  2006-10-02 12:50 ` Hans Rosenfeld
  0 siblings, 1 reply; 7+ messages in thread
From: jigsaw @ 2006-10-02  6:44 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-10-03 12:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-02 14:24 [TUHS] Having trouble with V6 source code Jose R Valverde
  -- strict thread matches above, loose matches on Subject: below --
2006-10-03 12:25 Wolfgang Helbig
2006-10-02 14:22 Jose R Valverde
2006-10-02 15:24 ` jigsaw
2006-10-02  6:44 jigsaw
2006-10-02 12:50 ` Hans Rosenfeld
2006-10-02 12:59   ` jigsaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).