VMCOG API Documentation v0.22 Copyright 2010 William Henning May be distributed under the terms of the Creative Commons Attributions Required license. PUB start(mailbox,lastpage,numpages) Starts VMCOG mailbox = address of a four LONG array lastpage = address of last page in working set, $FC00 suggested numpages = number of 256 byte pages in working set, grows down $FC00 allows for SphinxOS compatability numpages MUST be greater than 7 and less than 62 Example: [code] OBJ vm: "VMCOG" VAR long mailbox[4] PUB main vm.start(@mailbox,$7C00,61) [/code] PUB rdvbyte(addr) Reads a byte from specified virtual memory address Example: [code] ch := vm.rdvbyte($A000) [/code] PUB rdvword(addr) Reads a word from specified virtual memory address Example: [code] w := vm.rdvword($C000) [/code] PUB rdvlong(addr) Reads a long from specified virtual memory address Example: [code] l := vm.rdvlong($E000) [/code] PUB wrvbyte(addr,data) Writes a byte to the specified virtual memory address Example: [code] vm.wrvbyte($A000,$AA) [/code] PUB wrvword(addr,data) Writes a word to the specified virtual memory address Example: [code] vm.wrvword($C000,$ABCD) [/code] PUB wrvlong(addr,data) Writes a long to the specified virtual memory address Example: [code] vm.wrvlong($E000,$A1B2C3D4) [/code] PUB Flush Resets VMCOG by clearing the Page Translation Table [code] vm.wrvlong($E000,$A1B2C3D4) [/code] PUB Look(addr) Lets you take a look at the contents of the Page Translation Table. You must provide a 256 long array for the table EXAMPLE: [code] LONG ptt[256] ... vm.look(@ptt) [/code] PUB GetPhysVirt(addr) Return address of hub memory where the virtual page resides, or 0 if it is not resident. EXAMPLE: [code] physaddr := vm.GetPhysVirt($800) [/code] PUB GetVirtPhys(addr) Return virtual memory address of specified hub memory address, or 0 if it is not mapped to virtual memory. EXAMPLE: [code] virtaddr := vm.GetVirtPhys($F800) [/code]