The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [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
* [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 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

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  6:44 [TUHS] Having trouble with V6 source code jigsaw
2006-10-02 12:50 ` Hans Rosenfeld
2006-10-02 12:59   ` jigsaw
2006-10-02 14:22 Jose R Valverde
2006-10-02 15:24 ` jigsaw
2006-10-02 14:24 Jose R Valverde
2006-10-03 12:25 Wolfgang Helbig

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).