> Make it possible to use segments. What I mean is you can set some register
> outside the cpu on a value rg and if an address ad is asked by the cpu,
> the address that is actually read out is ad+mf*rg, where mf is a
> multiplying factor, prefferibly smaller than 64 (use a power of 2 of
> course, so you don't actually have to multiply).

Why a small value like 64? A Z380 based system will probably have a 
memory size in the order of megabytes, so a value like 64K will be 
acceptable as well.
Ofcourse, if a value of 1 is possible, that would be ideal, but maybe 
that will make hardware implementation too complex.

> It's not too hard to implement, but it makes life much
> easier for programmers.

Implementation may be simple, but it may have drastic impact on de 
speed of the system. Memory accesses are very important for how fast 
a system runs (every instruction must be fetched from memory). If the 
adding of a segment offset takes additional clockticks for every 
memory access, it will seriously slow down the system.

There are other ways of solving problems with relocation:
- Using relative addressing most of the time. For example JR and 
DJNZ, but also using IX and IY registers. Z380 has stackpointer 
relative addressing, which makes building compilers much easier.
- Filling in the right absolute addresses after loading an executable. If a 
standardized mechanism is used for this, it is only a small burden.

> (I don't know why pc-programmers always say
> segments are the worst thing ever invented...)

The decision of 16 bytes increments for segments was wrong. That 
decision is the reason x86 real mode can only address 1024K, so 
indirectly it is responsible for the hated 640K boundary.

Bye,
                Maarten

****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****

Reply via email to