main: setting register from C with inline asm
[swan-dev] / src / main.c
index f37cfc4..1ce8228 100644 (file)
@@ -1,4 +1,26 @@
+/* #include <code16bit.h> */
+#include <wonderswan_mem.h>
+
+void outport(c)
+       unsigned c;
+{
+#asm
+       xor dx, dx
+       mov dx, ax
+       shr dx, 8
+       out dx, al
+       ;out 0x15, al
+#endasm
+}
+
 int main()
 {
-       return 1;
+       while(1) {
+               /* outport(0x15EE); */
+               unsigned reg = 0x15;
+               unsigned val = 0xEE;
+               outport((reg << 8) | val);
+
+       }
+       return 0;
 }