Article View: bit.listserv.asm370
Article #124Re: Shifting memory to the right
From: Don Nielsen
Date: Fri, 30 Sep 2005 16:10
Date: Fri, 30 Sep 2005 16:10
97 lines
5302 bytes
5302 bytes
Never thought of that. Excellent idea.
-----Original Message-----
From: IBM Mainframe Assembler List
[mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU]On Behalf Of Michael Stack
Sent: Friday, September 30, 2005 10:48 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Shifting memory to the right
If you're going to do a binary search, why not use a balanced binary search
tree? If a tree node is a row, your link memory overhead would be
relatively small and your search time would be comparable. And if you are
not inserting too many rows, the overhead for balancing should be small,
too. A lot less virtual (and real) memory used, as well.
It's usually (!) less costly to manipulate a data structure than to move
data around. YMMV. See Knuth, TAoCP, Vol 3, 2nd Ed. (Sorting and
Searching) pp 471-473 for a discussion of using a balanced tree to
represent a linear list.
Mike
At 09:57 AM 9/30/2005 -0500, Don Nielsen wrote:
> > Why not just have the table entries linked with a "next" pointer ?
>
>Binary searching of the tables after they have been loaded.
>
> > Have a second buffer for the table.
>
>Good thought. There are three tables involved, which are already very
>large (75 meg between them). I'll look into a fourth for buffer space.
>
>
>
>-----Original Message-----
>From: IBM Mainframe Assembler List
>[mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU]On Behalf Of Beate Kawelke
>Sent: Friday, September 30, 2005 9:14 AM
>To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
>Subject: Re: Shifting memory to the right
>
>
>Hmmmm - two thoughts:
>
>1. Why not just have the table entries linked with a "next" pointer ? If
>necessary, throw in a "previous" pointer, too. Navigation through the
>table is quite easy, and you can add / delete entries simply by chaining
>them in the right place.
>2. Have a second buffer for the table. Move upper part to buffer, then the
>new entry, then the lower part.
>
>HTH, Beate
>
> > -----Original Message-----
> > From: IBM Mainframe Assembler List
> > [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Don Nielsen
> > Sent: Friday, September 30, 2005 3:56 PM
> > To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> > Subject: [ASSEMBLER-LIST] Shifting memory to the right
> >
> > Nothing like a dumb applications programmer question to end
> > the week. Is there an instruction like MVCL that moves
> > memory starting at the end working to the beginning. I have
> > a table that is in sequence. I want to insert a new row,
> > maintaining sequence. That requires shifting right the end
> > of the table. It would be great to just code an MVCL to do
> > it, but I would be overwrite data. But if MVCL started with
> > the last byte and worked its way to the start, then the shift
> > would be easy. Does any such instruction or function exist?
> >
> > I guess I could do something silly and build the table
> > starting at the end of the of memory block and shift it left
> > as I build it.
> >
> > dvn
> >
> > Don V Nielsen
> > Products & Tools
> > CMS
> > 3707 Corporate Drive
> > Marshfield, WI 54449
> > donn@cmscms.com
> >
> > > '715-486-8807 X434
> > >
> > Better Results, Faster!
> >
Michael Stack e-mail: mstack@niu.edu
ear-mail: 1.815.753.9447
Computer Science Department fax: 1.815.753.0342
Northern Illinois University www: http://mstack.cs.niu.edu/
DeKalb, IL 60115 skype: callto://mstack
Technical Details
Message-ID:
<F57FDB5201A2AA488C21CC5CC9759029848D61@cdmail.cmscms.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!atl-c02.usenetserver.com!news.usenetserver.com!atl-c04.usenetserver.com!news.usenetserver.com!newsfeed.berkeley.edu!ucberkeley!sn-xit-02!sn-xit-06!sn-xit-14!supernews.com!149.173.6.116.MISMATCH!foggy!vm.sas.com!cmscms.com!donnShow Full Headers
Complete Article Headers
X-Google-Thread: fcdcb,3e46d196c2b56e33
X-Google-Attributes: gidfcdcb,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!atl-c02.usenetserver.com!news.usenetserver.com!atl-c04.usenetserver.com!news.usenetserver.com!newsfeed.berkeley.edu!ucberkeley!sn-xit-02!sn-xit-06!sn-xit-14!supernews.com!149.173.6.116.MISMATCH!foggy!vm.sas.com!cmscms.com!donn
From: Don Nielsen <donn@cmscms.com>
Newsgroups: bit.listserv.asm370
Subject: Re: Shifting memory to the right
Date: Fri, 30 Sep 2005 11:10:29 -0500
Organization: SAS Inc.
Lines: 97
Sender: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU>
Message-ID: <F57FDB5201A2AA488C21CC5CC9759029848D61@cdmail.cmscms.com>
NNTP-Posting-Host: mozart.unx.sas.com
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: foggy.unx.sas.com 1128096774 17856 10.19.150.41 (30 Sep 2005 16:12:54 GMT)
X-Complaints-To: usenet@unx.sas.com
NNTP-Posting-Date: Fri, 30 Sep 2005 16:12:54 +0000 (UTC)
Comments: Gated by NETNEWS@VM.SAS.COM
Return-Path: <owner-assembler-list@LISTSERV.UGA.EDU>
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
Thread-Topic: Re: Shifting memory to the right
Thread-Index: AcXF1t/IlHffBrJfSjKad24DVhDnGAAAmhBg
X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.cc.uga.edu id
j8UG8rKn025486
Approved-By: Don Nielsen <donn@CMSCMS.COM>
Return-Path: owner-assembler-list@LISTSERV.UGA.EDU
X-OriginalArrivalTime: 30 Sep 2005 16:12:51.0121 (UTC)
FILETIME=[CE64BA10:01C5C5D9]
X-Mime-Autoconverted: from 8bit to 7bit by mime827
Originator: daemon@mozart.unx.sas.com