HP3000-L Archives

March 1999, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Ted Ashton <[log in to unmask]>
Reply To:
Ted Ashton <[log in to unmask]>
Date:
Wed, 3 Mar 1999 09:44:21 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
Thus it was written in the epistle of Frank McConnell,
> FREAD expects you to give it a logical array, so hand it WORKL
> instead of WORK.
>
> At least for SPL on the classic (meaning I have no idea how this works
> when Splash! and/or PA-RISC 3000s are involved), when you call an
> intrinsic that expects a word pointer but give it a byte pointer, the
> compiler inserts an arithmetic shift right (ASR) to convert the byte
> pointer to a word pointer (and should give you a warning to tell you
> that it's been so helpful).  ASR preserves the sign bit, so if the
> value of the byte pointer is negative, so will be the value of the
> word pointer.  (Also, if the byte pointer is odd (not word-aligned),
> the least significant bit will get lost, so the resulting word pointer
> will likely point one byte off from your byte pointer.)

Ok, I'm confused.  At least the code seems to have tried to do the right thing
with FREAD.  It *is* passing a word address or what is trying to be a word
address.  I'm sorry for miswriting in my original post.  However this ASR vs.
LSR thing has got me confused.  In the SPL manual (the December, 1976 version,
p 4-3), it claims, "All addresses are signed, one-word integers and are
treated as such in expressions."  However, when @WORK was negative, passing
@WORK & ASR(1) to FREAD gave me a bounds violation, but passing @WORK & LSR(1)
gave me good results.  From that, it seems that addresses are *unsigned*. So
what's up wid dat?

Ted
--
Ted Ashton ([log in to unmask]), Info Serv, Southern Adventist University
          ==========================================================
[Of her:]
Her statistics were more than a study, they were indeed her religion. . . .
she held that the universe -- including human communities -- was evolving in
accordance with a divine plan; that it was man's business to endeavor to
understand this plan and guide his actions in sympathy with it. But to
understand God's thoughts, she held we must study statistics, for these are the
measure of His purpose. Thus the study of statistics was for her a religious
duty.
                        -- Nightingale, Florence (1820-1910)

ATOM RSS1 RSS2