The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: txomsy@yahoo.es (Jose R Valverde)
Subject: [TUHS] Having trouble with V6 source code
Date: Mon, 2 Oct 2006 16:22:11 +0200 (CEST)	[thread overview]
Message-ID: <20061002142211.20654.qmail@web26112.mail.ukl.yahoo.com> (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



             reply	other threads:[~2006-10-02 14:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-02 14:22 Jose R Valverde [this message]
2006-10-02 15:24 ` jigsaw
  -- strict thread matches above, loose matches on Subject: below --
2006-10-03 12:25 Wolfgang Helbig
2006-10-02 14:24 Jose R Valverde
2006-10-02  6:44 jigsaw
2006-10-02 12:50 ` Hans Rosenfeld
2006-10-02 12:59   ` jigsaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061002142211.20654.qmail@web26112.mail.ukl.yahoo.com \
    --to=txomsy@yahoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).