The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [Unix-jun72] Minor bug in sources e09-07
@ 2008-05-03 16:21 James A. Markevitch
  2008-05-03 17:26 ` Brad Parker
  0 siblings, 1 reply; 3+ messages in thread
From: James A. Markevitch @ 2008-05-03 16:21 UTC (permalink / raw)


I downloaded the stuff from the svn, got it to build, then did a cmp -l
on the load file from my assembler vs. the one built from the svn tree.

There is a bug in the svn sources on page e09-07, near the bottom.
The call to sleep should read:

	jsr	r0,sleep; 0:..

Note that there should be a colon, not a semi-colon after the 0.
Presumably, this code was never executed, else it would have
resulted in a halt.

After I made that fix, a build from the svn tree is identical to that
from my assembler.

James Markevitch



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

* [Unix-jun72] Minor bug in sources e09-07
  2008-05-03 16:21 [Unix-jun72] Minor bug in sources e09-07 James A. Markevitch
@ 2008-05-03 17:26 ` Brad Parker
  0 siblings, 0 replies; 3+ messages in thread
From: Brad Parker @ 2008-05-03 17:26 UTC (permalink / raw)



"James A. Markevitch" wrote:
>I downloaded the stuff from the svn, got it to build, then did a cmp -l
>on the load file from my assembler vs. the one built from the svn tree.
>
>There is a bug in the svn sources on page e09-07, near the bottom.
>The call to sleep should read:
>
>	jsr	r0,sleep; 0:..
>
>Note that there should be a colon, not a semi-colon after the 0.
>Presumably, this code was never executed, else it would have
>resulted in a halt.

thanks!

but what *does* that syntax do?  0:..  ?

(I do know that 0 is halt :-)

-brad



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

* [Unix-jun72] Minor bug in sources e09-07
@ 2008-05-03 17:35 James A. Markevitch
  0 siblings, 0 replies; 3+ messages in thread
From: James A. Markevitch @ 2008-05-03 17:35 UTC (permalink / raw)


> >There is a bug in the svn sources on page e09-07, near the bottom.
> >The call to sleep should read:
> >
> >       jsr     r0,sleep; 0:..
> >
> >Note that there should be a colon, not a semi-colon after the 0.
> >Presumably, this code was never executed, else it would have
> >resulted in a halt.
> 
> thanks!
> 
> but what *does* that syntax do?  0:..  ?

The two-instruction sequence is:

	movb	tty+3(r1),0f / put clist id in sleep argument
	jsr	r0,sleep; 0:..

The "0:" on the second line is a label and it is referenced by the "0f"
in the first line.  The first line is putting a value into the argument
being passed to the sleep subroutine.  Self-modifying code.

The ".." assembles to a 0.

With the incorrect code, "0" assembled to a 0 and ".." assembled to
a 0, so there was one extra word of zeroes, and the return from the
sleep would have executed it (halt) instead of the "br 1b" on the
next line.

James Markevitch



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

end of thread, other threads:[~2008-05-03 17:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-03 16:21 [Unix-jun72] Minor bug in sources e09-07 James A. Markevitch
2008-05-03 17:26 ` Brad Parker
2008-05-03 17:35 James A. Markevitch

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