Mercurial > hg > Members > kono > os9 > sbc09
changeset 12:111e5defb8ab
boot is called, rti failed
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 07 Jul 2018 00:37:24 +0900 |
parents | ce7323f9b937 |
children | 2aebc6b17fbf |
files | a09.c io.c os9/makerom.c os9/os9disass.c v09.c |
diffstat | 5 files changed, 27 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/a09.c Fri Jul 06 18:31:38 2018 +0900 +++ b/a09.c Sat Jul 07 00:37:24 2018 +0900 @@ -933,11 +933,11 @@ break; case 4: case 6: offs=(unsigned short)operand-loccounter-codeptr-2; if(offs<-128||offs>=128||opsize==3||unknown||!certain) { - if((!unknown)&&opsize==2&&(offs<-128||offs>=128) ) - error|=16; - // offs--; - // opsize=3; - // postbyte++; + if((!unknown)&&opsize==2&&(offs<-128||offs>=128) ) + error|=16; + offs--; + opsize=3; + postbyte++; } putbyte(postbyte); if (debug) fprintf(stderr,"DEBUG: doaddress: mode=%d, opsize=%d, error=%d, postbyte=%02X, operand=%04X offs=%d\n",mode,opsize,error,postbyte,operand,offs);
--- a/io.c Fri Jul 06 18:31:38 2018 +0900 +++ b/io.c Sat Jul 07 00:37:24 2018 +0900 @@ -98,7 +98,7 @@ FILE *disk[] = {0,0}; extern void hexadump( unsigned char *b, int l, int loc, int w); -extern void disasm(int,int); +extern int disasm(int,int); #ifdef USE_MMU extern char *prog ; // for disass extern Byte * mem0(Byte *iphymem, Word adr, Byte *immu) ; @@ -489,12 +489,15 @@ len = getarg(next,&next); } if (skip==2 && s[1]=='i') { - for(int i=0; len > 0 ; i+=16, len-=16) { + Word end = adr + len; + while(adr < end) { #ifdef USE_MMU - Byte *phyadr = mem0(phymem,adr+i,mmu); - prog = (char*)phyadr - adr; + Byte *phyadr = mem0(phymem,adr,mmu); + prog = (char*)phyadr - adr ; + if (phyadr > phymem+memsize) goto restart; #endif - disasm(adr+i,adr+i+(len>16?16:len)); + int len = adr+16<end? 16 : end-adr -1 ; + adr = disasm(adr,adr+len); } } else { #ifdef USE_MMU
--- a/os9/makerom.c Fri Jul 06 18:31:38 2018 +0900 +++ b/os9/makerom.c Sat Jul 07 00:37:24 2018 +0900 @@ -26,7 +26,7 @@ * 8k block ( offset 0xc000 ) * * 0xe000 - 0xccff 0xff - * 0xed00 - 0xff78 os9 modules, os9p1 should be the last + * 0xed00 - 0xfeff os9 modules, os9p1 should be the last * MMU doesnot touch below * 0xff80 - 0xffdf IO port ( ACIA, clock, pdisk, MMU ) * 0xffd0 - 0xffef boot code @@ -40,7 +40,8 @@ int IOSIZE = 0x100; char * outfile ; -#define LV2START 0xffd0 +#define LV2START 0xffd0 // our own small boot for mmu +#define LV2ROMEND 0xff00 // #define DEBUG @@ -97,13 +98,13 @@ return (ptr[0]<<8)+ptr[1]; } -void rewrite_vector(MPTR m,int top, unsigned char *adr,int count) +void rewrite_vector(MPTR m,int size, unsigned char *adr,int count) { // vector is a offset from $F100 (possibly os9p1 module address) - int offset = 0xf100-top; + int offset = -size-0xf100; for(int i=0;i<count;i++) { int vec = getword(adr); - vec -= offset; + vec += offset; adr[0] = vec>>8; adr[1] = vec&0xff; adr += 2; @@ -120,8 +121,8 @@ if (level == 1) top = 0xf800; // OS9p1 else { - top = 0x10000-(m->size+0x80); - rewrite_vector(m,top,m->mod+getword(m->mod+2),7); + top = 0x10000-(m->size+0x100); + rewrite_vector(m,m->size,m->mod+getword(m->mod+2),7); } } if (level==1 && !(( top+m->size < IOBASE ) || ( IOBASE+IOSIZE < top)) ) { @@ -155,7 +156,7 @@ if (*av[i]=='-') { if (av[i][1] =='2') { // for level 2 level = 2; - IOBASE = 0xff00; + IOBASE = LV2ROMEND; } else if (av[i][1] =='o') { outfile = av[i+1]; i += 1; @@ -202,8 +203,8 @@ fputc(0xff,romfile); } } else { - int pend = 0x10000-( cur->size +0x80); - for(; pos < pend ; pos++) { // os9p1 ends 0xff7f + int pend = 0x10000-( cur->size +0x100); + for(; pos < pend ; pos++) { // os9p1 ends 0xfeff fputc(0xff,romfile); } }
--- a/os9/os9disass.c Fri Jul 06 18:31:38 2018 +0900 +++ b/os9/os9disass.c Sat Jul 07 00:37:24 2018 +0900 @@ -1591,7 +1591,7 @@ return ""; } -void disasm(start, end) +int disasm(start, end) int start; int end; { @@ -1615,6 +1615,7 @@ pc += (*optable[code].display)(&optable[code], code, pc, " "); fprintf(fp,"\n"); } + return pc; } #ifndef NO_MAIN