Mercurial > hg > Members > kono > os9 > sbc09
changeset 168:2937e970aac6
generate os9 module done
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 11 Apr 2019 13:59:28 +0900 |
parents | 3f8bbec566b3 |
children | c9dc1be48de4 |
files | TL1/TL1os9.asm src/a09.c |
diffstat | 2 files changed, 66 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
--- a/TL1/TL1os9.asm Wed Apr 10 22:48:30 2019 +0900 +++ b/TL1/TL1os9.asm Thu Apr 11 13:59:28 2019 +0900 @@ -47,6 +47,7 @@ AMODE RMB 1 ACC RMB 1 LSIZE RMB 1 local variable size (including arguments ) +GSIZE RMB 1 global variable including array TCOUNT RMB 1 1 search reserved word only, 5 search all local/global var/array, proc TEND RMB 2 table end (search start from here ) include local name WEND RMB 2 word end @@ -71,7 +72,7 @@ ioentry rmb $80 readbuff rmb bufsiz+1 -OBJSTART RMB 11 +OBJSTART RMB 10 * OBJECT PG AREA @@ -87,6 +88,7 @@ name fcs /TL1/ fcb edition + ** OBJECT START ****** C tst <runmod @@ -205,6 +207,8 @@ BSR REGNAM CLR LSIZE BSR REG0 + LDB LSIZE + STB GSIZE LBSR PROG LBSR STPOUT LDX TEND @@ -1428,40 +1432,47 @@ sta <runmod ldy <pc ldd #$87CD + std ,y + leay 4,y skip size + ldd #$0d module name offset std ,y++ - ldd #$0c0a + ldd #$1180 type language std ,y++ - leay 9,y + ldd #$1a00 attribue rev + leay 5,y + * put module name ldx ,s bsr mkmodnam tfr y,d - subd #LIBEND+2 - std modofs + leax crt0top,pcr + pshs x + subd ,s++ + subd #2 + std modofs leau crt0top,pc ldx #LIBEND-crt0top -libcpy ldd ,u++ - std ,y++ - leax -2,x - bhi libcpy +libcpy lda ,u+ + sta ,y+ + leax -1,x + bne libcpy sty <PC puls x,y,u,pc mkmodnam pshs x,y,u -m4 tfr x,u - tst ,x +m7 tfr x,u + lda ,x+ lbeq ERROR * no file name cmpa #' ' - bne m0 - leax 1,x - bra m4 + bne m2 + bra m7 m0 lda ,x+ - cmpa #' ' +m2 cmpa #' ' ble m1 cmpa #'/' - bne m0 + beq m8 cmpa #':' bne m0 - tfr x,u +m8 tfr x,u bra m0 m1 lda ,u+ cmpa #' ' @@ -1477,59 +1488,67 @@ puls x,y,u,pc modend leax OBJECT,u * header setup - ldy <PC - sty 2,x + ldd <PC + pshs x + subd ,s++ + addd #3 + std 2,x module size * header parity clra - ldb #7 -m4 adda ,x+ + ldb #8 +m4 eora ,x+ decb bne m4 + eora #$ff sta ,x+ header parity - leay OBJECT,u - leay crt0-crt0top,y - sty ,x++ start address - ldy GEND - clra - clrb -m5 tst ,y+ - bpl m5 - beq m6 - leay 1,y + leay crt0,pcr + ldd modofs + addd #11 + leay d,y + tfr y,d + pshs x + subd ,s++ + std ,x++ start address offset + clra + ldb GSIZE addd #1 - bra m5 -m6 std $b,u global size + std ,x global size * mod CRC pshs d,u leax OBJECT,u ldu <PC - clr ,u - clr 1,u - clr 2,u + lda #$ff + sta ,u + sta 1,u + sta 2,u + tfr u,d + pshs x + subd ,s++ + tfr d,y os9 F$CRC + com ,u + com 1,u + com 2,u * write to file ldu 2,s leax OBJECT,u ldd 4,x leax d,x - lda 2 write - os9 I$Open + ldd #$27f 10 01111111 + os9 I$Create lbcs ERROR sta ,s ldu 2,s leax OBJECT,u - ldd <PC - addd #3 - pshs x - subd ,s++ + ldy 2,x module size lda ,s os9 I$Write lbcs ERROR - clra + puls d,u + clrb os9 F$Exit all end - ********************** * ADVANCE WORD ** @@ -1970,7 +1989,7 @@ leax OBJSTART,u * compiled code follows -LIBEND +LIBEND equ * emod
--- a/src/a09.c Wed Apr 10 22:48:30 2019 +0900 +++ b/src/a09.c Thu Apr 11 13:59:28 2019 +0900 @@ -957,7 +957,8 @@ if(lp) { if(lp->cat!=13&&lp->cat!=6) { if(lp->cat!=2||lp->value!=loccounter) - lp->value=loccounter; // seterror(8); + lp->value=loccounter; + if (pass==1) seterror(8); } else { lp->cat=2; lp->value=loccounter;