Mercurial > hg > Members > kono > os9 > sbc09
changeset 71:eb9be32c701c
fix leval
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 05 Aug 2018 22:17:44 +0900 |
parents | a200fa7d5b70 |
children | 3a2fb51afc4d |
files | game09/game09.asm src/Makefile src/a09.c src/d09.c src/os9/level1/Makefile src/os9/level1/cmds/Makefile src/os9/level2/Makefile src/os9/level2/cmds/Makefile src/os9/level2/cmds/defsfile src/trace.c src/vdisk.c |
diffstat | 11 files changed, 96 insertions(+), 62 deletions(-) [+] |
line wrap: on
line diff
--- a/game09/game09.asm Sun Aug 05 16:12:30 2018 +0900 +++ b/game09/game09.asm Sun Aug 05 22:17:44 2018 +0900 @@ -11,12 +11,10 @@ tylg set Prgrm+Objct atrv set ReEnt+rev rev set $01 -edition set 5 +edition set 1 mod eom,name,tylg,atrv,start,size -name fcs "Game09" - fcb edition org 0 dpage rmb $96 @@ -46,10 +44,13 @@ DPSTK rmb 2 linebuf rmb 256 -program rmb 20000 +program rmb 10000 size equ . -start +name fcs "Game09" + fcb edition +start * clrb + * os9 F$Exit LC000 BRA LC005 LC002 NOP LC003 BRA LC014 @@ -62,8 +63,7 @@ STX <$50 LDA #$FF STA ,X -LC014 LBSR LCD00 - LDU <DPWORK +LC014 LDU <DPWORK LEAX size,U STX <$58 LC020 LDA #$FF @@ -183,10 +183,11 @@ BNE LC10E LC114 LBRA LC032 LC117 LBRA LC024 -LC11A LDX #LFB8F +LC11A LDX <DPWORK + LEAX $8F,X TST <$8C BNE LC124 - LDX #LFB95 + LEAX $95,X LC124 LEAY <LC159,PCR LC127 PSHS X LDX ,Y++ @@ -376,7 +377,7 @@ LC292 ANDB #$3F CLRA LSLB - ADDD #LFB04 + ADDD <$04 TFR D,Y RTS LC29C PSHU B,A @@ -610,7 +611,7 @@ BNE LC460 PULS B,A STD <$7E - LDX #LFFFF + LDX #$FFFF STX <$4A LBSR LC09C STX <$50 @@ -637,7 +638,7 @@ LDA +$01,X CMPA #$4E BEQ LC48E - LBRA LC7D7 + LBRA SYSTEM LC48E TST +$02,X BNE LC494 CLR +$03,X @@ -701,7 +702,12 @@ LDB #$20 LBSR LC412 LDX <$42 - CMPX #LFB95 + PSHS Y,D + LDY <DPWORK + LEAY $95,Y + STY ,S + CMPX ,S + PULS Y,D BNE LC519 LBSR LC165 BRA LC51C @@ -732,7 +738,7 @@ LDD <$52 PSHU B,A LC54E - LDD #L3D09 + LDD #$3D09 LBSR LC319 ADDD #1 STD <$52 @@ -743,9 +749,6 @@ CLRA ADDD #1 RTS -LC564 - NEG <$00 - NEG <$00 LC568 CLRA LDB +$01,X @@ -811,8 +814,9 @@ RTS LC5D5 LBSR LC397 LC5D8 LDB #$3A - BSR LC64A - LDX #LFB95 + LBSR LC64A + LDX <DPWORK + LEAX $95,X TST <$8C BNE LC5F2 LDD <$88 @@ -830,7 +834,13 @@ CMPB #$18 BEQ LC5D5 STB ,X+ - CMPX #LFBDF + PSHS Y,D + LDD <DPWORK + ADDD #$DF + LEAY $DF,Y + STY ,Y + CMPX ,S + PULS Y,D BNE LC5F2 LEAX -$01,X LDB #$08 @@ -838,9 +848,14 @@ BRA LC5F2 LC611 TST <$8C BNE LC626 - CMPX #LFB9B + LDY <DPWORK + LEAY $9B,Y + PSHS Y + CMPX ,S++ BEQ LC61F - CMPX #LFB9A + LEAY -1,Y + PSHS Y + CMPX ,S++ BCC LC626 LC61F COM <$8C LBSR LC39B @@ -849,21 +864,25 @@ ADDD <$8A STD <$88 CLR ,X - LDX #LFB95 + LDX <DPWORK + LEAX $95,X LBRA LC39B LC634 LEAX -$01,X - CMPX #LFB94 + LDY <DPWORK + LEAY $94,Y + PSHS Y + CMPX ,S++ BNE LC5F2 STB <$8C - BRA LC5D8 + LBRA LC5D8 LC63F FCB $D,$A FCS "*READY" FCB $D,$A,0 LC64A LBRA OUTCH -LC64D LBRA LC6FC GETCH -LC650 LBRA LC720 SENSE +LC64D LBRA GETCH +LC650 LBRA SENSE LC653 CMPA #$2E EXBOP BNE LC65E @@ -911,7 +930,7 @@ BSR LC6C9 BRA LC6B3 LC6AE LEAX +$01,X -LC6B0 LDD #LFFFF +LC6B0 LDD #$FFFF LC6B3 PSHU B,A LDA ,X DEC ,S @@ -949,18 +968,18 @@ RTS GETCH LDA #0 - PSHS A + PSHS B LEAX ,S LDY #1 OS9 I$Read - PULS A + PULS B BCS GETCH -OUTCH PSHS A +OUTCH PSHS B LEAX ,S LDA #1 LDY #1 OS9 I$Write - PULS A,PC + PULS B,PC SENSE LDA #0 LDB #SS.Ready OS9 i$GetStt @@ -1020,11 +1039,11 @@ LC79E CLR <$8C RTS BSR LC7B6 - LBSR LCD09 + * LBSR LCD09 BNE LC7B1 RTS BSR LC7B6 - LBSR LCD0C + * LBSR LCD0C BNE LC7B1 RTS LC7B1 LDA #$44 @@ -1036,6 +1055,6 @@ SYSTEM clrb os9 F$Exit rts -eom emod +eom equ * end
--- a/src/Makefile Sun Aug 05 16:12:30 2018 +0900 +++ b/src/Makefile Sun Aug 05 22:17:44 2018 +0900 @@ -44,7 +44,7 @@ $(CC) -c $(CFLAGS) $(V09FLAGS) $< v09.o: v09.c - $(CC) -c $(CFLAGS) $(V09FLAGS) $< + $(CC) -c $(CFLAGS) -DUSE_VDISK $(V09FLAGS) $< d09 : d09.c $(CC) -Wno-format-security $(CFLAGS) $(V09FLAGS) $< -o $@
--- a/src/a09.c Sun Aug 05 16:12:30 2018 +0900 +++ b/src/a09.c Sun Aug 05 22:17:44 2018 +0900 @@ -1545,6 +1545,12 @@ } else if(strcmp(v[i],"-l")==0) { listname=v[i+1]; i+=2; + } else if(strcmp(v[i],"-D")==0) { + struct symrecord * p; + p=findsym(v[i+1]); + p->value = 1; + p->cat = 0; + i+=2; } else if(strcmp(v[i],"-I")==0) { struct incl *j = (struct incl *)malloc(sizeof(struct incl)); j->name = v[i+1];
--- a/src/d09.c Sun Aug 05 16:12:30 2018 +0900 +++ b/src/d09.c Sun Aug 05 22:17:44 2018 +0900 @@ -1453,9 +1453,9 @@ offset = prog[pc+1]; if (offset < 127 ) - disp = pc + 2 + offset; + disp = pc + 2 + offset + adoffset; else - disp = pc + 2 - (256 - offset); + disp = pc + 2 - (256 - offset + adoffset); fprintf(fp,"%0.2X %0.2X %s%s $%0.4X", code, offset, suffix, op->name, disp); return op->bytes;
--- a/src/os9/level1/Makefile Sun Aug 05 16:12:30 2018 +0900 +++ b/src/os9/level1/Makefile Sun Aug 05 22:17:44 2018 +0900 @@ -9,8 +9,10 @@ MOD = pdisk init os9p1 os9p2 ioman pipe piper rbf scf term pty d0 d1 vrbf v0 clock shell dir mdir sysgo shell all : ${MOD} + cd cmds; make clean : + cd cmds; make clean rm -f $(MOD) *.lst krn.asm LST = -l $@.lst
--- a/src/os9/level1/cmds/Makefile Sun Aug 05 16:12:30 2018 +0900 +++ b/src/os9/level1/cmds/Makefile Sun Aug 05 22:17:44 2018 +0900 @@ -1,15 +1,17 @@ -SRC2 = ../src/os9/nitros9-code/level2/cmds -SRC1 = ../src/os9/nitros9-code/level1/cmds +SRC2 = ../../nitros9-code/level2/cmds +SRC1 = ../../nitros9-code/level1/cmds OBJ2 = mdir mfree proc procs reboot OBJ1 = asm attr calldbg cmp config copy cputype date debug del deldir devs dir dir_cb dirsort dump echo edit \ - error free help ident irqs link list load login makdir pd procs prompt shellplus sleep tee touch tsmon unlink + error free help ident irqs link list load login makdir pxd pwd procs prompt shellplus sleep tee touch tsmon unlink all : $(OBJ2) $(OBJ1) -A09 = ../src/a09 +A09 = ../../../a09 +clean : + rm -rf *.lst $(OBJ2) $(OBJ1) mdir : $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm @@ -84,8 +86,10 @@ $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm makdir : $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm -pd : - $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm +pxd : + $(A09) -D PXD -l $@.lst -o $@ $(SRC1)/pd.asm +pwd : + $(A09) -D PWD -l $@.lst -o $@ $(SRC1)/pd.asm prompt : $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm shellplus :
--- a/src/os9/level2/Makefile Sun Aug 05 16:12:30 2018 +0900 +++ b/src/os9/level2/Makefile Sun Aug 05 22:17:44 2018 +0900 @@ -8,8 +8,10 @@ ALL = ioman pdisk init os9p1 os9p2 os9p3_perr os9p4_regdump pipe pipeman pipeman_named piper rbf scf term pty d0 d1 clock vector boot shell dir mdir sysgo v0 vrbf all : $(ALL) + cd cmds ; make clean : + cd cmds ; make clean rm -rf $(ALL) *.lst *.dSYM LST = -l $@.lst
--- a/src/os9/level2/cmds/Makefile Sun Aug 05 16:12:30 2018 +0900 +++ b/src/os9/level2/cmds/Makefile Sun Aug 05 22:17:44 2018 +0900 @@ -1,30 +1,26 @@ -SRC2 = ../src/os9/nitros9-code/level2/cmds -SRC1 = ../src/os9/nitros9-code/level1/cmds +SRC2 = ../../nitros9-code/level2/cmds +SRC1 = ../../nitros9-code/level1/cmds -OBJ2 = dmem mdir mfree mmap pmap proc procs reboot smap +OBJ2 = mdir mfree proc procs reboot OBJ1 = asm attr calldbg cmp config copy cputype date debug del deldir devs dir dir_cb dirsort dump echo edit \ - error free help ident irqs link list load login makdir pd procs prompt shellplus sleep tee touch tsmon unlink + error free help ident irqs link list load login makdir pxd pwd procs prompt shellplus sleep tee touch tsmon unlink all : $(OBJ2) $(OBJ1) -A09 = ../src/a09 +A09 = ../../../a09 -dmem : - $(A09) -l $@.lst -o $@ $(SRC2)/$@.asm +clean : + rm -rf *.lst $(OBJ2) $(OBJ1) mdir : - $(A09) -l $@.lst -o $@ $(SRC2)/$@.asm + $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm mfree : - $(A09) -l $@.lst -o $@ $(SRC2)/$@.asm -mmap : - $(A09) -l $@.lst -o $@ $(SRC2)/$@.asm -pmap : - $(A09) -l $@.lst -o $@ $(SRC2)/$@.asm + $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm proc : $(A09) -l $@.lst -o $@ $(SRC2)/$@.asm procs : - $(A09) -l $@.lst -o $@ $(SRC2)/$@.asm + $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm reboot : $(A09) -l $@.lst -o $@ $(SRC2)/$@.asm smap : @@ -64,6 +60,8 @@ $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm dump : $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm +dw.as : + $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm echo : $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm edit : @@ -88,8 +86,10 @@ $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm makdir : $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm -pd : - $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm +pxd : + $(A09) -D PXD -l $@.lst -o $@ $(SRC1)/pd.asm +pwd : + $(A09) -D PWD -l $@.lst -o $@ $(SRC1)/pd.asm prompt : $(A09) -l $@.lst -o $@ $(SRC1)/$@.asm shellplus :
--- a/src/os9/level2/cmds/defsfile Sun Aug 05 16:12:30 2018 +0900 +++ b/src/os9/level2/cmds/defsfile Sun Aug 05 22:17:44 2018 +0900 @@ -1,3 +1,3 @@ * Main defsfile for OS-9 Level One V1 * - use ../desfile + use ../defsfile
--- a/src/trace.c Sun Aug 05 16:12:30 2018 +0900 +++ b/src/trace.c Sun Aug 05 22:17:44 2018 +0900 @@ -87,6 +87,7 @@ int value = 0; char *b = buf; if (next==0) next = &b; + *next = buf; value=getterm(*next,next); for(;**next;) { if ( **next == '+' ) {
--- a/src/vdisk.c Sun Aug 05 16:12:30 2018 +0900 +++ b/src/vdisk.c Sun Aug 05 22:17:44 2018 +0900 @@ -205,7 +205,7 @@ while(*p==' ') p++; } char *name1 = addCurdir(name,pd,curdir); - if (name1!=name && name1!=path) free(name); + if (name1!=name && path!=name) free(name); if (name1==0) return 0; pd->name = name1; if(vdiskdebug&2) {