Article View: bit.listserv.asm370
Article #225Re: Shifting memory to the right
From: robin
Date: Tue, 25 Oct 2005 14:39
Date: Tue, 25 Oct 2005 14:39
29 lines
2437 bytes
2437 bytes
Edward E. Jaffe wrote in message <433D6157.7090209@phoenixsoftware.com>... >Don Nielsen wrote: >>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? >Shifting a block of data left is easy. Shifting right must be done >one-byte-at-a-time in a loop. Would give the simplest code but would be slowest, considering the setup time for each of the individual instructions. Better to use a small buffer, start at the end, and move chunks at a time. >>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. >That's precisely what I have done in similar circumstances. Lateral thinking! >-- >.-----------------------------------------------------------------. >| Edward E. Jaffe
Technical Details
Message-ID:
<hsr7f.578$Hj2.50@news-server.bigpond.net.au>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!ken-transit.news.telstra.net!lon-transit.news.telstra.net!lon-in.news.telstra.net!news.telstra.net!news-server.bigpond.net.au!53ab2750!not-for-mailReferences:
<F57FDB5201A2AA488C21CC5CC9759029848D5D@cdmail.cmscms.com> <433D6157.7090209@phoenixsoftware.com>Show 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!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!ken-transit.news.telstra.net!lon-transit.news.telstra.net!lon-in.news.telstra.net!news.telstra.net!news-server.bigpond.net.au!53ab2750!not-for-mail From: "robin" <robin_v@bigpond.com> Newsgroups: bit.listserv.asm370 References: <F57FDB5201A2AA488C21CC5CC9759029848D5D@cdmail.cmscms.com> <433D6157.7090209@phoenixsoftware.com> Subject: Re: Shifting memory to the right Lines: 34 X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Message-ID: <hsr7f.578$Hj2.50@news-server.bigpond.net.au> Date: Tue, 25 Oct 2005 14:39:09 GMT NNTP-Posting-Host: 203.54.188.175 X-Complaints-To: abuse@bigpond.net.au X-Trace: news-server.bigpond.net.au 1130251149 203.54.188.175 (Wed, 26 Oct 2005 00:39:09 EST) NNTP-Posting-Date: Wed, 26 Oct 2005 00:39:09 EST Organization: BigPond Internet Services