--- /dev/null
+/* Test memory Aliasing for MMURTL V1.0 */\r
+/* Copyright (c) 1994 R.A. Burgess */\r
+/* All Rights Reserved */\r
+\r
+/*\r
+This simple program shows how memory aliasing works in MMURTL.\r
+To build this, use MakeIt.bat in DOS, or use CM32 and DASM:\r
+ CM32 MemTest.c\r
+ DASM MemTest.atf\r
+*/\r
+\r
+\r
+#define U32 unsigned long\r
+#define S32 long\r
+#define U16 unsigned int\r
+#define S16 int\r
+#define U8 unsigned char\r
+#define S8 char\r
+#define TRUE 1\r
+#define FALSE 0\r
+\r
+\r
+#include <stdio.h>\r
+#include <string.h>\r
+#include <ctype.h>\r
+#include <stdlib.h>\r
+\r
+/* Includes for OS public calls and structures */\r
+\r
+#include "\OSSource\MMemory.h"\r
+#include "\OSSource\MKbd.h"\r
+#include "\OSSource\MStatus.h"\r
+\r
+/**************** BEGIN Data ********************/\r
+\r
+char *Alias;\r
+U32 AliasPhy;\r
+U32 OSPhy;\r
+\r
+/**************** BEGIN Code ********************/\r
+\r
+void main(U32 argc, U8 argv[])\r
+{\r
+unsigned long erc, key;\r
+\r
+ erc = GetPhyAdd(1, 3072, &OSPhy);\r
+ if (erc)\r
+ printf("ERROR %d on GetPhyAdd.\r\n", erc);\r
+\r
+ printf("Aliasing Job 1 Linear Address %08x\r\n", 3072);\r
+ printf("Physical Address is %08x\r\n", OSPhy);\r
+\r
+ erc = AliasMem(3072, 8000, 1, &Alias);\r
+\r
+ if (erc)\r
+ printf("ERROR %d on AliasMem.\r\n", erc);\r
+\r
+ erc = GetPhyAdd(3, Alias, &AliasPhy);\r
+\r
+ if (erc)\r
+ printf("ERROR %d on GetPhyAdd.\r\n", erc);\r
+\r
+ printf("Alias Linear address is %08x\r\n", Alias);\r
+ printf("Physical Address is %08x\r\n", AliasPhy);\r
+\r
+ printf("Press a key to continue...\r\n");\r
+ ReadKbd(&key, 1);\r
+\r
+ erc = DeAliasMem(Alias, 8000, 3);\r
+ if (erc)\r
+ printf("ERROR %d on DeAliasMem.\r\n", erc);\r
+\r
+ exit(0);\r
+\r
+}\r