"Dresner, Norman A." wrote:
> 
> Let me try to clarify the situation a little.
> to use the segment that the 80188 sees that data at.  In this
> example we need to take 0x000D3478 and transform it into 0x1000:3478.

#define DPM_OFFSET 0xC000

register int segment,cpu_address,device_address;

segment = (cpu_address & 0xFFFF0000 - DPM_OFFSET) << 16;
device_address = cpu_address & 0x0000FFFF + segment;

segment = device_address >> 16 + DPM_OFFSET;
cpu_address = device_address & 0x0000FFFF + segment;

Although this looks complicated in C it gets translated into some really
fast asm.  It uses some of the fastest asm instructions: 

shift,
bitwise-and ( bit masking),
add,
subtract.

- Kal.
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to