- Timestamp:
- 07/16/2017 02:23:05 PM (7 years ago)
- Branches:
- master
- Children:
- 4cfe69a
- Parents:
- 897a874
- Location:
- rom
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
rom/romp.c
r897a874 r5117699 266 266 267 267 uint16_t *tba0, /* breakpoint 0 temporary */ 268 *tba1; /* breakpoint 1 temporary */268 *tba1; /* breakpoint 1 temporary */ 269 269 270 270 uint16_t p_bv0, /* breakpoint 0 value */ 271 p_bv1; /* breakpoint 1 value */271 p_bv1; /* breakpoint 1 value */ 272 272 273 273 uint16_t *p_ba0, /* breakpoint 0 address */ 274 *p_ba1; /* breakpoint 1 address */274 *p_ba1; /* breakpoint 1 address */ 275 275 276 276 jmp_buf restart; /* jmp environment */ … … 368 368 369 369 writeln(cmdunit, "File name: "); 370 endc = getln(cmdunit, MAXFNLN+1, bfname);370 endc = (int8_t)getln(cmdunit, MAXFNLN+1, bfname); 371 371 writeln(cmdunit, CRLF); 372 372 … … 472 472 void dosw(int16_t nb, int16_t sv) 473 473 { 474 register uint16_t *bp ;475 register int16_t i , j;474 register uint16_t *bp, j; 475 register int16_t i; 476 476 477 477 if ((nb LT 1) OR (nb GT 82)) … … 667 667 668 668 for (i = 0; i < 22; i++) 669 if (c EQ *ap++) 669 if (c EQ *ap++) { 670 670 if (i >15) 671 671 return(i - 6); 672 672 else 673 673 return(i); 674 } 674 675 675 676 return(-1); … … 699 700 case A_LF: 700 701 701 argsep = c;702 argsep = (int8_t)c; 702 703 return(argln); 703 704 … … 712 713 c = 0x00FF & *sptr; 713 714 714 argsep = c;715 argsep = (int8_t)c; 715 716 return(argln); 716 717 … … 720 721 c = _tolower(c); 721 722 722 *aptr++ = c;723 *aptr++ = (int8_t)c; 723 724 ++sptr; 724 725 ++argln; … … 753 754 case A_LF: 754 755 755 argsep = c;756 argsep = (int8_t)c; 756 757 return(argln); 757 758 … … 766 767 c = 0x00FF & *sptr; 767 768 768 argsep = c;769 argsep = (int8_t)c; 769 770 return(argln); 770 771 … … 772 773 773 774 ++sptr; 774 argsep = c;775 argsep = (int8_t)c; 775 776 return(argln); 776 777 777 778 default: 778 779 779 *aptr++ = c;780 *aptr++ = (int8_t)c; 780 781 ++sptr; 781 782 ++argln; … … 901 902 putn(num/10, cw-1, unit); 902 903 903 d = num % 10;904 d = (int16_t)(num % 10); 904 905 905 906 BIOS(B_PUTC, unit, (d + '0')); … … 1060 1061 return(FALSE); 1061 1062 1062 *p_from++ = 0xFF & p_value;1063 *p_from++ = (int8_t)(0xFF & p_value); 1063 1064 1064 1065 if (argsep EQ A_CR) … … 1113 1114 return(FALSE); 1114 1115 1115 *p_uint++ = 0xFFFF & p_value;1116 *p_uint++ = (uint16_t)(0xFFFF & p_value); 1116 1117 1117 1118 if (argsep EQ A_CR) … … 1184 1185 *loc = mask; 1185 1186 1186 if (mask NE (was = *loc)) 1187 if (mask NE (was = *loc)) { 1187 1188 if (p_from LT (int8_t *)USER_RAM) 1188 1189 halt(); … … 1190 1191 printf("%08lX was %04X, expected %04X\r\n", 1191 1192 loc, was, mask); 1193 } 1192 1194 1193 1195 *loc = ~mask; 1194 1196 1195 if (~mask NE (was = *loc)) 1197 if (~mask NE (was = *loc)) { 1196 1198 if (p_from LT (int8_t *)USER_RAM) 1197 1199 halt(); … … 1199 1201 printf("%08lX was %04X, expected %04X\r\n", 1200 1202 loc, was, ~mask); 1203 } 1201 1204 1202 1205 mask <<= 1; … … 1317 1320 for (i = 0; i < 16; i++) { 1318 1321 1319 xloc = v_odtab[i][1] & 0x03FF;1322 xloc = (int16_t)(v_odtab[i][1] & 0x03FF); 1320 1323 1321 1324 if (xloc & 0x0200) /* sign extend xloc */ 1322 xloc |= 0xFC00;1323 1324 width = ( v_odtab[i][1] >> 10) & 0x003F;1325 xloc = xloc - 0x400; 1326 1327 width = (int16_t)((v_odtab[i][1] >> 10) & 0x003F); 1325 1328 1326 1329 printf("%2d %s ", … … 1350 1353 writeln(cmdunit, CRLF); 1351 1354 1352 for (i = 0; i < NCMDS; i++) {1355 for (i = 0; i < (int16_t)NCMDS; i++) { 1353 1356 1354 1357 if (j++ EQ 22) { … … 1435 1438 1436 1439 if (goflag) 1437 regptr->reg_pc = p_goto;1440 regptr->reg_pc = (uint32_t)p_goto; 1438 1441 1439 1442 if (b0flag ) { … … 1759 1762 if (rnum < 9) { /* d0..d7 -- data register */ 1760 1763 1761 regptr->d_reg[rnum-1] = p_value;1764 regptr->d_reg[rnum-1] = (uint32_t)p_value; 1762 1765 return(TRUE); 1763 1766 } … … 1765 1768 if (rnum < 17) { /* a0..a7 -- address register */ 1766 1769 1767 regptr->a_reg[rnum-9] = p_value;1770 regptr->a_reg[rnum-9] = (uint32_t)p_value; 1768 1771 return(TRUE); 1769 1772 } … … 1783 1786 return(FALSE); 1784 1787 1785 regptr->reg_pc = p_value;1788 regptr->reg_pc = (uint32_t)p_value; 1786 1789 return(TRUE); 1787 1790 } … … 1792 1795 return(FALSE); 1793 1796 1794 regptr->a_reg[7] = p_value;1797 regptr->a_reg[7] = (uint32_t)p_value; 1795 1798 return(TRUE); 1796 1799 } … … 1868 1871 if (vrnum < 17) { /* 1..16 -- r0..r15 -- complete register */ 1869 1872 1870 v_regs[vrnum-1] = p_value;1873 v_regs[vrnum-1] = (uint16_t)p_value; 1871 1874 return(TRUE); 1872 1875 } … … 1875 1878 1876 1879 v_regs[vrnum-5] = (v_regs[vrnum-5] & 0x03FF) | 1877 (( p_value << 10) & 0xFC00);1880 (((uint16_t)p_value << 10) & 0xFC00); 1878 1881 return(TRUE); 1879 1882 } … … 1881 1884 if (vrnum < 25) { /* 21..24 -- v0..v3 -- vertical register */ 1882 1885 1883 v_regs[vrnum-9] = (v_regs[vrnum-9] & 0xFC00) | p_value;1886 v_regs[vrnum-9] = (v_regs[vrnum-9] & 0xFC00) | (uint16_t)p_value; 1884 1887 return(TRUE); 1885 1888 } … … 1932 1935 { 1933 1936 register int8_t *ldadr; 1934 register int16_t c, csum,i, len;1935 register uint16_t val ;1937 register int16_t c, i, len; 1938 register uint16_t val, csum; 1936 1939 1937 1940 if ('S' NE (c = *line++)) … … 1961 1964 1962 1965 if (isxdigit(c = *line++)) 1963 val = xdtoi(c);1966 val = (uint16_t)xdtoi(c); 1964 1967 else 1965 1968 return(-3); /* error 3 = bad address byte */ 1966 1969 1967 1970 if (isxdigit(c = *line++)) 1968 val = (val << 4) + xdtoi(c);1971 val = (val << 4) + (uint16_t)xdtoi(c); 1969 1972 else 1970 1973 return(-3); … … 1977 1980 1978 1981 if (isxdigit(c = *line++)) 1979 val = xdtoi(c);1982 val = (uint16_t)xdtoi(c); 1980 1983 else 1981 1984 return(-4); /* error 4 = bad data byte */ 1982 1985 1983 1986 if (isxdigit(c = *line++)) 1984 val = (val << 4) + xdtoi(c);1987 val = (val << 4) + (uint16_t)xdtoi(c); 1985 1988 else 1986 1989 return(-4); 1987 1990 1988 1991 csum += (val & 0xFF); 1989 *ldadr = val & 0xFF;1992 *ldadr = (int8_t)(val & 0xFF); 1990 1993 1991 1994 if ((*ldadr & 0xFF) NE (val & 0xFF)) … … 1998 2001 1999 2002 if (isxdigit(c = *line++)) 2000 val = xdtoi(c);2003 val = (uint16_t)xdtoi(c); 2001 2004 else 2002 2005 return(-6); /* error 6 = bad checksum byte */ 2003 2006 2004 2007 if (isxdigit(c = *line++)) 2005 val = (val << 4) + xdtoi(c);2008 val = (val << 4) + (uint16_t)xdtoi(c); 2006 2009 else 2007 2010 return(-6); … … 2216 2219 d_next = p_to + 1; 2217 2220 d_last = ((int32_t)p_to - (int32_t)p_from) + d_next; 2218 nw = p_width;2221 nw = (int16_t)p_width; 2219 2222 rc = TRUE; 2220 2223 … … 2282 2285 */ 2283 2286 2284 int16_t ldump( int32_t *loc,int32_t *lastloc, int16_t nwide, int16_t unit)2287 int16_t ldump(uint32_t *loc, uint32_t *lastloc, int16_t nwide, int16_t unit) 2285 2288 { 2286 2289 while (nwide--) { 2287 2290 2288 puthn( (uint32_t)*loc, 8, unit);2291 puthn(*loc, 8, unit); 2289 2292 BIOS(B_PUTC,unit, ' '); 2290 2293 … … 2448 2451 return(FALSE); 2449 2452 2450 iplev = iplevl;2453 iplev = (int16_t)iplevl; 2451 2454 2452 2455 return(TRUE); … … 2538 2541 case MON_C: 2539 2542 2540 vc = *monptr & 0x0FF;2543 vc = (int8_t)(*monptr & 0x0FF); 2541 2544 puthn((uint32_t)vc, 2, cmdunit); 2542 2545 writeln(cmdunit, "\r\n"); … … 2544 2547 while (!(0xFFFFL & BIOS(B_RDAV, CON_DEV))) { 2545 2548 2546 vcc = *monptr & 0x0FF;2549 vcc = (int8_t)(*monptr & 0x0FF); 2547 2550 2548 2551 if (vc NE vcc) { … … 2621 2624 d_next = p_to + 2; 2622 2625 d_last = ((int32_t)p_to - (int32_t)p_from) + d_next; 2623 nw = p_width;2626 nw = (int16_t)p_width; 2624 2627 rc = TRUE; 2625 2628 … … 2630 2633 dflag = FALSE; 2631 2634 2632 if (wdump( p_from,p_to, nw, cmdunit))2635 if (wdump((uint16_t *)p_from, (uint16_t *)p_to, nw, cmdunit)) 2633 2636 rc = FALSE; 2634 2637 … … 2660 2663 d_next = p_to + 4; 2661 2664 d_last = ((int32_t)p_to - (int32_t)p_from) + d_next; 2662 nw = p_width;2665 nw = (int16_t)p_width; 2663 2666 rc = TRUE; 2664 2667 … … 2669 2672 dflag = FALSE; 2670 2673 2671 if (ldump( p_from,p_to, nw, cmdunit))2674 if (ldump((uint32_t *)p_from, (uint32_t *)p_to, nw, cmdunit)) 2672 2675 rc = FALSE; 2673 2676 … … 2718 2721 if (getcmd()) { 2719 2722 2720 for (i = 0; i < NCMDS; i++) {2723 for (i = 0; i < (int16_t)NCMDS; i++) { 2721 2724 2722 2725 if (0 EQ strcmp(argstr, cmtab[i].cname)) { … … 2796 2799 2797 2800 ns = p_len & 0x7FFFL; 2798 recno = (int 32_t)p_from & 0xFFFFL;2801 recno = (int16_t)((int32_t)p_from & 0xFFFFL); 2799 2802 2800 2803 rc = BIOS(B_RDWR, 2, p_to, ns, recno, 0); … … 2825 2828 2826 2829 ns = p_len & 0x7FFFL; 2827 recno = (int 32_t)p_from & 0xFFFFL;2830 recno = (int16_t)((int32_t)p_from & 0xFFFFL); 2828 2831 2829 2832 rc = BIOS(B_RDWR, 3, p_to, ns, recno, 0); … … 3154 3157 rc = FALSE; 3155 3158 3156 if ( p_ba0 EQ regptr->reg_pc) {3159 if ((uint32_t)p_ba0 EQ regptr->reg_pc) { 3157 3160 3158 3161 if (*p_ba0 EQ BPINST) { … … 3176 3179 } 3177 3180 3178 if ( p_ba1 EQ regptr->reg_pc) {3181 if ((uint32_t)p_ba1 EQ regptr->reg_pc) { 3179 3182 3180 3183 if (*p_ba1 EQ BPINST) { … … 3404 3407 3405 3408 if ((baseled + 3) > 23) /* turn on a LED */ 3406 io_leds = baseled - 21;3409 io_leds = (uint8_t)(baseled - 21); 3407 3410 else 3408 io_leds = baseled + 3;3409 3410 io_leds = 0x80 + baseled;/* turn off a LED */3411 io_leds = (uint8_t)(baseled + 3); 3412 3413 io_leds = (uint8_t)(0x80 + baseled); /* turn off a LED */ 3411 3414 3412 3415 if (++baseled > 23) /* update LED number */ … … 3445 3448 3446 3449 for (i = 0; i < 24; i++) /* turn off LEDs */ 3447 io_leds = 0x80 + i;3450 io_leds = (uint8_t)(0x80 + i); 3448 3451 3449 3452 io_leds = 0x1F; /* turn off LCD lamp */ … … 3465 3468 3466 3469 for (i = 0; i < 24; i++) /* turn off LEDs */ 3467 io_leds = 0x80 + i;3470 io_leds = (uint8_t)(0x80 + i); 3468 3471 3469 3472 return(TRUE); … … 3502 3505 *pdptr++ = '-'; 3503 3506 *pdptr++ = ' '; 3504 *pdptr++ = ( (*pcptr >> 4) & 0x0F) + '0';3505 *pdptr++ = ( *pcptr++ & 0x0F) + '0';3506 *pdptr++ = ( (*pcptr >> 4) & 0x0F) + '0';3507 *pdptr++ = ( *pcptr++ & 0x0F) + '0';3507 *pdptr++ = (int8_t)(((*pcptr >> 4) & 0x0F) + '0'); 3508 *pdptr++ = (int8_t)((*pcptr++ & 0x0F) + '0'); 3509 *pdptr++ = (int8_t)(((*pcptr >> 4) & 0x0F) + '0'); 3510 *pdptr++ = (int8_t)((*pcptr++ & 0x0F) + '0'); 3508 3511 *pdptr++ = '-'; 3509 *pdptr++ = ( (*pcptr >> 4) & 0x0F) + '0';3510 *pdptr++ = ( *pcptr++ & 0x0F) + '0';3512 *pdptr++ = (int8_t)(((*pcptr >> 4) & 0x0F) + '0'); 3513 *pdptr++ = (int8_t)((*pcptr++ & 0x0F) + '0'); 3511 3514 *pdptr++ = '-'; 3512 *pdptr++ = ( (*pcptr >> 4) & 0x0F) + '0';3513 *pdptr++ = ( *pcptr++ & 0x0F) + '0';3515 *pdptr++ = (int8_t)(((*pcptr >> 4) & 0x0F) + '0'); 3516 *pdptr++ = (int8_t)((*pcptr++ & 0x0F) + '0'); 3514 3517 *pdptr++ = '\0'; 3515 3518 -
rom/romp.x
r897a874 r5117699 156 156 extern int16_t getcmd(void); 157 157 extern int16_t getlong(int32_t *var); 158 extern int16_t ldump( int32_t *loc,int32_t *lastloc, int16_t nwide, int16_t unit);158 extern int16_t ldump(uint32_t *loc, uint32_t *lastloc, int16_t nwide, int16_t unit); 159 159 extern void main(void); 160 160 extern void padr(void *adr, int16_t unit);
Note:
See TracChangeset
for help on using the changeset viewer.