changeset 103:844305752064

no compile errors on mc09
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 27 Dec 2018 20:16:34 +0900
parents 09148bb27659
children 096b3fc7aa66
files os9/mc09/crtos9.asm os9/mc09/makefile os9/mc09/mclibos9.c src/a09.c
diffstat 4 files changed, 23 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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
 
--- 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
 }
--- 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