Chuck Guzis wrote:
On 2/22/2006 at 4:11 PM Jim Leonard wrote:
The
huge-mode address computation to get from a byte offset to a
segment+offset representation is miserable--and a loop that does
something
like a[i] = b[j]+c[k] where all three arrays are
larger than 64K is
ridiculous.
Right -- don't do this :-)
Yeah, but when I saw the hoops one had to jump through on 8086 code for
large structures with the sales engineer sitting there with a straight face
and telling me it was ONLY 7 instructions, I became an instant fan of the
68000
Well, who wouldn't? :-)
I've always maintained that there's nothing wrong with segmented
architecture as long as it's done properly. If the segment portion of
segment:offset was a 64KB paragraph instead of a 16B paragraph, then
you'd have some very nice 16:16 (32-bit) addressing and easy segment
math. Oh well, one can dream...
Wait -- 7 instructions? Let me look at my flat-to-segmented routine:
; assumes linear address is in dx:ax; returns segmented in dx:ax
mov bx,ax
and ax,0Fh
mov cl,4
shr bx,cl
mov cl,12
shl dx,cl
add dx,bx
...you're right, 7 instructions, unless my code is bad...?
--
Jim Leonard (trixter at
oldskool.org)
http://www.oldskool.org/
Help our electronic games project:
http://www.mobygames.com/
Or check out some trippy MindCandy at
http://www.mindcandydvd.com/
A child borne of the home computer wars:
http://trixter.wordpress.com/