🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #503

.comm - bug or feature?

#503
From: jmc
Date: Tue, 10 Feb 1987 21:17
26 lines
1394 bytes
In porting UNIX V.3 onto a new chipset I discovered a curiosity in the 3b2
assembler/loader.

	.comm	x,4

	(instruction refering to x)

has "4" in the displacement not 0 - the same as the "value" field, which
distinguishes ".comm" from an undefined external.

The loader subtracts the value field whatever it means from the relocated
position.

Everything ends up in the right place, unless you are naive enough (like me
of course) to write your own assembler which puts "0" in the displacement.
Then the undoctored loader ends up subtracting 4 from the address with
unfortunate effects if you are trying to debug a sparkling new kernel!

I cannot believe it is logically correct to treat the value field in this
way although the two bug(?)s compensate.

Note that an ordinary undefined goes in as 0.

Any Comments?

John Collins, Xi Software Ltd, ..... xisl!jmc
Technical Details
Message-ID: <490@ubu.warwick.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!lll-lcc!seismo!mcvax!ukc!warwick!jmc

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!lll-lcc!seismo!mcvax!ukc!warwick!jmc
From: jmc@warwick.UUCP
Newsgroups: comp.bugs.sys5,comp.lang.c
Subject: .comm - bug or feature?
Message-ID: <490@ubu.warwick.UUCP>
Date: Tue, 10-Feb-87 16:17:46 EST
Article-I.D.: ubu.490
Posted: Tue Feb 10 16:17:46 1987
Date-Received: Fri, 13-Feb-87 20:40:59 EST
Reply-To: jmc@ubu.UUCP (John Collins)
Organization: Computer Science, Warwick University, UK
Lines: 26