[Coco] 6309 microprocessor project 01-19-2004

John Collyer johncollyer at zoominternet.net
Mon Jan 19 15:02:42 EST 2004


6309 microprocessor project:

Hello,

I have reconsidered and decided to use the pointer method.
Reasons are it is faster to calculate a pointer then it
is to move 8k of memory.  This is to satisfy NitrOS-9 and
OS-9 Level 2 need to constantly change the MMU registers.

I am using the win32 kernel function VirtualAlloc, which
reserves or commits a region of pages in the virtual address
space of the calling process.  I then fill my memory pointer
table (the size is (2048 * 4) = 8192) with a pointer to every
2000h bytes.  I also have a 64k address space, which is used
as a virtual address table.  This table corresponds to the
address of a byte being read or written.  At every 2000h bytes
there is a pointer to the 8k region of the real memory
allocated by the VirtualAlloc function.  When a MMU register
is changed the function that handles the change will update
this table of virtual memory pointers.

To access any byte you use the address AND with $FE00 this
will give you the right pointer location in virtual address table.

With that pointer you add the address of the byte shifted left three times.
You now get or write the byte located at the pointer value you just
calculated above.  Of course, generally you can always read the byte,
but it might come from several different sources.  However you can
not always write to memory it being rom and all.

The only drawback is now the win32 kernel functions in the special
opcode $11FD have to fit inside of a 8k address space.  This goes
for the special opcode $11FF also.  Everything must be in one 8k
memory page.  Unless you set up the memory pages to follow one
another in chronological order.  This is because the pointer you
pass inside of register x must now be process just exactly like
above from the virtual address table and the memory might not be
continuous.

This is how Jeff did it anyway.  As a matter of fact, if you look at
his special opcode $11FF you'll see that it works the same as mine
except you pass the 80x86 register values inside of the 6309 registers.

So the 6309 assembly example I showed awhile back works almost the
same for Jeff's.  You set up the 6309 registers as per documentation execute
the $11FF opcode.  The program counter register is updated through the
80x86 si register.  You make sure that its initial value plus the size your
80x86 code is updated into register si and then return to your 6309
program.

Any way more later

John Collyer




More information about the Coco mailing list