# HG changeset patch
# User Shinji KONO <kono@ie.u-ryukyu.ac.jp>
# Date 1545909394 -32400
# Node ID 84430575206401ab0dfd6abb4b93462ea8fc3143
# Parent  09148bb27659c67859edf8a8ecd16d0707b22e4b
no compile errors on mc09

diff -r 09148bb27659 -r 844305752064 os9/mc09/crtos9.asm
--- a/os9/mc09/crtos9.asm	Thu Dec 27 16:03:36 2018 +0900
+++ b/os9/mc09/crtos9.asm	Thu Dec 27 20:16:34 2018 +0900
@@ -9,6 +9,15 @@
 *
 * micro-C user program
 *
+_tylg     set   Prgrm+Objct   
+_atrv     set   ReEnt+rev
+_rev      set   $00
+_edition  set   5
+        ifp1
+            use   defsfile
+        endc
+
+
 *	OPT	LIST
 	INCLUDE	"c.out"		include compilers output
 *	OPT	NOL
diff -r 09148bb27659 -r 844305752064 os9/mc09/makefile
--- a/os9/mc09/makefile	Thu Dec 27 16:03:36 2018 +0900
+++ b/os9/mc09/makefile	Thu Dec 27 20:16:34 2018 +0900
@@ -36,6 +36,10 @@
 mc2.c:
 	patch <diff_to_mc2 -o mc2.c
 
+test-cp : test/cp.c
+	./mc test/cp.c
+	$(AS09) crtos9.asm -l cp.lst -o cp
+
 clean:
 	rm -f mc c.out mc2.o lint
 
diff -r 09148bb27659 -r 844305752064 os9/mc09/mclibos9.c
--- a/os9/mc09/mclibos9.c	Thu Dec 27 16:03:36 2018 +0900
+++ b/os9/mc09/mclibos9.c	Thu Dec 27 20:16:34 2018 +0900
@@ -2,17 +2,12 @@
  *  os9  driver
  */
 
-#asm
-         ifp1
-         use   defsfile
-         endc
-#endasm
 
 typedef	struct {
     int fd;                   /*  0 */
-    int mode;                 /*  2 */
+    int fmode;                 /*  2 */
     int len;                  /*  4 */
-    char *name;               /*  6 */
+    char *fname;               /*  6 */
     char *ptr;        /*  8 */
     char buff[256];       /*  10 */
  } FILE ;
@@ -156,19 +151,19 @@
         lda       2,x          mode
         ldb       3,x          src attribute
         leax      6,x          name
-        os9       F$Create
-        bcc        _LC0001
+        os9       I$Create
+        bcc        _LC0003
         ldx       -4,u
         clrb
         std       ,x
-        bra       _LC0002
-_LC0001
+        bra       _LC0004
+_LC0003
         ldx       -4,u
         clra
         stD       2,x          err code
         ldd       #-1
         std       ,x
-_LC0002
+_LC0004
         puls      x,y,u
 #endasm
 	if (fcbp->fd < 0 ) return NULL;
@@ -237,10 +232,10 @@
         clr       ,s
         ldy       #1
         os9       I$Read
-        bcc       _LC0003
+        bcc       _LC0005
         ldd       #-1
         std       ,s
-_LC0003
+_LC0005
         puls      d,x,y,u
 #endasm
 }
diff -r 09148bb27659 -r 844305752064 src/a09.c
--- a/src/a09.c	Thu Dec 27 16:03:36 2018 +0900
+++ b/src/a09.c	Thu Dec 27 20:16:34 2018 +0900
@@ -53,7 +53,7 @@
 #include <string.h>
 #include <ctype.h>
 
-#define NLABELS 2048
+#define NLABELS (2048*2)
 #define MAXIDLEN 16
 #define MAXLISTBYTES 8
 #define FNLEN 30