The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: random832@fastmail.com (Random832)
Subject: [TUHS] PDP-11 DIV instruction lossage
Date: Mon, 19 Mar 2018 11:32:38 -0400	[thread overview]
Message-ID: <1521473558.1945631.1308301672.0CD3ACAD@webmail.messagingengine.com> (raw)
In-Reply-To: <20180319140359.2204C18C088@mercury.lcs.mit.edu>

On Mon, Mar 19, 2018, at 10:03, Noel Chiappa wrote:
>     > I'll have to redo my kludgy fix to gmtime() ... I guess I'll have to fix
>     > it for real, instead of my kludgy fix (which extended it to work for
>     > 16-bit results). :-)
>     > ...
>     > And on the -11/23:
>     > Note that the returned 'quotient' is simply the high part of the dividend.
> 
> Heh. I had decided that the easiest clean and long-lived fix was to just to do
> it right, using the long division routine used in the V7 C compiler runtime:

I did a version of gmtime a few months ago that divides by 86400 using the V6 ldiv function (by shifting by 7 to divide by 128 first, then dividing by 675). My main interest was in getting it to treat timestamps as unsigned (despite the V6 compiler having neither an unsigned type nor a long type) in order to push back the 2038 problem. After adding an overflow warning to apout, it looks like mine manages to avoid hitting the overflow until September of 2059.


  reply	other threads:[~2018-03-19 15:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 14:03 Noel Chiappa
2018-03-19 15:32 ` Random832 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-18 21:38 Noel Chiappa

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=1521473558.1945631.1308301672.0CD3ACAD@webmail.messagingengine.com \
    --to=random832@fastmail.com \
    /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).