cpu 46 include/struct.h CPU *cpu; /**<CPU */ cpu 9 src/dump.c fprintf(stdout, "#%04X: adr :", sys->cpu->pr); cpu 22 src/dump.c fprintf(stdout, "#%04X: %04X: ", sys->cpu->pr, i); cpu 40 src/dump.c char *sp = word2bit(sys->cpu->sp); cpu 41 src/dump.c char *pr = word2bit(sys->cpu->pr); cpu 42 src/dump.c char *fr = word2bit(sys->cpu->fr); cpu 47 src/dump.c fprintf(stdout, "#%04X: GR%d: ", sys->cpu->pr, i); cpu 48 src/dump.c print_dumpword(sys->cpu->gr[i], execmode.logical); cpu 51 src/dump.c fprintf(stdout, "#%04X: SP: %6d = #%04X = %s\n", sys->cpu->pr, sys->cpu->sp, sys->cpu->sp, sp); cpu 52 src/dump.c fprintf(stdout, "#%04X: PR: %6d = #%04X = %s\n", sys->cpu->pr, sys->cpu->pr, sys->cpu->pr, pr); cpu 53 src/dump.c fprintf(stdout, "#%04X: FR (OF SF ZF): %s\n", sys->cpu->pr, fr + L3BIT); /* FRは下位3けたを表示 */ cpu 107 src/exec.c sys->memory[sys->cpu->gr[1]] = sys->memory[sys->cpu->gr[2]] = 0x0; cpu 115 src/exec.c if(sys->cpu->gr[1] + i > execptr->end) { cpu 119 src/exec.c sys->memory[sys->cpu->gr[1] + i] = buf[i]; cpu 121 src/exec.c sys->memory[sys->cpu->gr[2]] = i + 1; cpu 130 src/exec.c for(i = 0; i < sys->memory[sys->cpu->gr[2]]; i++) { cpu 131 src/exec.c if(sys->cpu->gr[1] + i > execptr->end) { cpu 138 src/exec.c if(((w = sys->memory[sys->cpu->gr[1]+i]) >= 0x20 && w <= 0x7E) || /* JIS X 0201ラテン文字 */ cpu 151 src/exec.c sys->cpu->fr = 0x0; cpu 154 src/exec.c sys->cpu->fr += SF; cpu 158 src/exec.c sys->cpu->fr += ZF; cpu 168 src/exec.c setcerr(205, s = pr2str(sys->cpu->pr)); /* r/r1 in word #1 - not GR */ cpu 181 src/exec.c setcerr(206, s = pr2str(sys->cpu->pr)); /* r/r1 in word #1 - not GR */ cpu 194 src/exec.c a += sys->cpu->gr[x]; cpu 205 src/exec.c setcerr(207, s = pr2str(sys->cpu->pr + 1)); /* address in word #2 - out of memory */ cpu 220 src/exec.c sys->cpu->pr += 1; cpu 225 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 226 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] = get_val_adr_x(w[1], w[0])); cpu 227 src/exec.c sys->cpu->pr += 2; cpu 232 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 233 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] = sys->cpu->gr[get_x_r2(w[0])]); cpu 234 src/exec.c sys->cpu->pr += 1; cpu 239 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 240 src/exec.c sys->memory[get_adr_x(w[1], w[0])] = sys->cpu->gr[get_r_r1(w[0])]; cpu 241 src/exec.c sys->cpu->pr += 2; cpu 246 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 247 src/exec.c sys->cpu->gr[get_r_r1(w[0])] = get_adr_x(w[1], w[0]); cpu 248 src/exec.c sys->cpu->pr += 2; cpu 255 src/exec.c sys->cpu->fr = 0x0; cpu 258 src/exec.c if((tmp = (short)(sys->cpu->gr[r]) + (short)val) > 32767 || tmp < -32768) { cpu 259 src/exec.c sys->cpu->fr += OF; cpu 262 src/exec.c sys->cpu->gr[r] = (WORD)(tmp & 0xFFFF); cpu 263 src/exec.c if((sys->cpu->gr[r] & 0x8000) == 0x8000) { cpu 264 src/exec.c sys->cpu->fr += SF; cpu 265 src/exec.c } else if(sys->cpu->gr[r] == 0x0) { cpu 266 src/exec.c sys->cpu->fr += ZF; cpu 272 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 274 src/exec.c sys->cpu->pr += 2; cpu 279 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 280 src/exec.c adda(get_r_r1(w[0]), sys->cpu->gr[get_x_r2(w[0])]); cpu 281 src/exec.c sys->cpu->pr += 1; cpu 286 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 288 src/exec.c sys->cpu->pr += 2; cpu 293 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 294 src/exec.c adda(get_r_r1(w[0]), ~(sys->cpu->gr[get_x_r2(w[0])]) + 1); cpu 295 src/exec.c sys->cpu->pr += 1; cpu 303 src/exec.c o = sys->cpu->gr[r]; cpu 304 src/exec.c sys->cpu->fr = 0; /* flag initialize */ cpu 309 src/exec.c sys->cpu->fr += OF; cpu 313 src/exec.c sys->cpu->fr += OF; cpu 320 src/exec.c sys->cpu->gr[r] = (WORD)s; cpu 323 src/exec.c sys->cpu->fr += SF; cpu 326 src/exec.c sys->cpu->fr += ZF; cpu 332 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 334 src/exec.c sys->cpu->pr += 2; cpu 339 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 340 src/exec.c addl_gr(get_r_r1(w[0]), sys->cpu->gr[get_x_r2(w[0])], true); cpu 341 src/exec.c sys->cpu->pr += 1; cpu 346 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 348 src/exec.c sys->cpu->pr += 2; cpu 353 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 354 src/exec.c addl_gr(get_r_r1(w[0]), sys->cpu->gr[get_x_r2(w[0])], false); cpu 355 src/exec.c sys->cpu->pr += 1; cpu 360 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 361 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] &= get_val_adr_x(w[1], w[0])); cpu 362 src/exec.c sys->cpu->pr += 2; cpu 367 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 368 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] &= sys->cpu->gr[get_x_r2(w[0])]); cpu 369 src/exec.c sys->cpu->pr += 1; cpu 374 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 375 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] |= get_val_adr_x(w[1], w[0])); cpu 376 src/exec.c sys->cpu->pr += 2; cpu 381 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 382 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] |= sys->cpu->gr[get_x_r2(w[0])]); cpu 383 src/exec.c sys->cpu->pr += 1; cpu 388 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 389 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] ^= get_val_adr_x(w[1], w[0])); cpu 390 src/exec.c sys->cpu->pr += 2; cpu 395 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 396 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] ^= sys->cpu->gr[get_x_r2(w[0])]); cpu 397 src/exec.c sys->cpu->pr += 1; cpu 402 src/exec.c sys->cpu->fr = 0; cpu 403 src/exec.c if((short)sys->cpu->gr[r] < (short)val) { cpu 404 src/exec.c sys->cpu->fr = SF; cpu 405 src/exec.c } else if(sys->cpu->gr[r] == val) { cpu 406 src/exec.c sys->cpu->fr = ZF; cpu 412 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 414 src/exec.c sys->cpu->pr += 2; cpu 419 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 420 src/exec.c cpa(get_r_r1(w[0]), sys->cpu->gr[get_x_r2(w[0])]); cpu 421 src/exec.c sys->cpu->pr += 1; cpu 426 src/exec.c sys->cpu->fr = 0x0; cpu 427 src/exec.c if(sys->cpu->gr[r] < val) { cpu 428 src/exec.c sys->cpu->fr = SF; cpu 429 src/exec.c } else if(sys->cpu->gr[r] == val) { cpu 430 src/exec.c sys->cpu->fr = ZF; cpu 436 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 438 src/exec.c sys->cpu->pr += 2; cpu 443 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 444 src/exec.c cpl(get_r_r1(w[0]), sys->cpu->gr[get_x_r2(w[0])]); cpu 445 src/exec.c sys->cpu->pr += 1; cpu 450 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 452 src/exec.c WORD sign = sys->cpu->gr[r] & 0x8000; cpu 455 src/exec.c sys->cpu->fr = 0; cpu 456 src/exec.c sys->cpu->gr[r] &= 0x7FFF; cpu 458 src/exec.c last = sys->cpu->gr[r] & 0x4000; cpu 459 src/exec.c sys->cpu->gr[r] <<= 1; cpu 461 src/exec.c sys->cpu->gr[r] = sign | (sys->cpu->gr[r] & 0x7FFF); cpu 464 src/exec.c sys->cpu->fr += OF; cpu 468 src/exec.c sys->cpu->fr += SF; cpu 471 src/exec.c if(sys->cpu->gr[r] == 0x0) { cpu 472 src/exec.c sys->cpu->fr += ZF; cpu 474 src/exec.c sys->cpu->pr += 2; cpu 479 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 481 src/exec.c WORD sign = sys->cpu->gr[r] & 0x8000; cpu 484 src/exec.c sys->cpu->fr = 0; cpu 485 src/exec.c sys->cpu->gr[r] &= 0x7FFF; cpu 487 src/exec.c last = sys->cpu->gr[r] & 0x1; cpu 488 src/exec.c sys->cpu->gr[r] >>= 1; cpu 490 src/exec.c sys->cpu->gr[r] |= 0x4000; cpu 493 src/exec.c sys->cpu->gr[r] = sign | sys->cpu->gr[r]; cpu 496 src/exec.c sys->cpu->fr += OF; cpu 500 src/exec.c sys->cpu->fr += SF; cpu 503 src/exec.c if(sys->cpu->gr[r] == 0x0) { cpu 504 src/exec.c sys->cpu->fr += ZF; cpu 506 src/exec.c sys->cpu->pr += 2; cpu 511 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 515 src/exec.c sys->cpu->fr = 0x0; cpu 517 src/exec.c last = sys->cpu->gr[r] & 0x8000; cpu 518 src/exec.c sys->cpu->gr[r] <<= 1; cpu 522 src/exec.c sys->cpu->fr += OF; cpu 525 src/exec.c if((sys->cpu->gr[r] & 0x8000) > 0x0) { cpu 526 src/exec.c sys->cpu->fr += SF; cpu 529 src/exec.c if(sys->cpu->gr[r] == 0x0) { cpu 530 src/exec.c sys->cpu->fr += ZF; cpu 532 src/exec.c sys->cpu->pr += 2; cpu 537 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 541 src/exec.c sys->cpu->fr = 0x0; cpu 543 src/exec.c last = sys->cpu->gr[r] & 0x0001; cpu 544 src/exec.c sys->cpu->gr[r] >>= 1; cpu 548 src/exec.c sys->cpu->fr += OF; cpu 551 src/exec.c if((sys->cpu->gr[r] & 0x8000) > 0x0) { cpu 552 src/exec.c sys->cpu->fr += SF; cpu 555 src/exec.c if(sys->cpu->gr[r] == 0x0) { cpu 556 src/exec.c sys->cpu->fr += ZF; cpu 558 src/exec.c sys->cpu->pr += 2; cpu 563 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 564 src/exec.c if((sys->cpu->fr & (SF | ZF)) == 0) { cpu 565 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]); cpu 567 src/exec.c sys->cpu->pr += 2; cpu 573 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 574 src/exec.c if((sys->cpu->fr & SF) > 0) { cpu 575 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]); cpu 577 src/exec.c sys->cpu->pr += 2; cpu 583 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 584 src/exec.c if((sys->cpu->fr & ZF) == 0) { cpu 585 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]); cpu 587 src/exec.c sys->cpu->pr += 2; cpu 593 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 594 src/exec.c if((sys->cpu->fr & ZF) > 0) { cpu 595 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]); cpu 597 src/exec.c sys->cpu->pr += 2; cpu 603 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 604 src/exec.c if((sys->cpu->fr & OF) > 0) { cpu 605 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]); cpu 607 src/exec.c sys->cpu->pr += 2; cpu 613 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 614 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]); cpu 619 src/exec.c assert(sys->cpu->sp > execptr->end && sys->cpu->sp <= sys->memsize); cpu 620 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 621 src/exec.c sys->memory[--(sys->cpu->sp)] = get_adr_x(w[1], w[0]); cpu 622 src/exec.c sys->cpu->pr += 2; cpu 627 src/exec.c assert(sys->cpu->sp > execptr->end); cpu 628 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]}; cpu 631 src/exec.c if(sys->cpu->sp >= sys->memsize) { cpu 632 src/exec.c setcerr(203, s = pr2str(sys->cpu->pr)); /* Stack Pointer (SP) - stack underflow */ cpu 635 src/exec.c sys->cpu->gr[get_r_r1(w[0])] = sys->memory[(sys->cpu->sp)++]; cpu 636 src/exec.c sys->cpu->pr += 1; cpu 642 src/exec.c assert(sys->cpu->sp > execptr->end && sys->cpu->sp <= sys->memsize); cpu 643 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 644 src/exec.c sys->memory[--(sys->cpu->sp)] = sys->cpu->pr + 1; cpu 645 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]); cpu 650 src/exec.c assert(sys->cpu->sp <= sys->memsize); cpu 651 src/exec.c if(sys->cpu->sp == sys->memsize) { cpu 653 src/exec.c } else if(sys->cpu->sp < sys->memsize) { cpu 654 src/exec.c sys->cpu->pr = sys->memory[(sys->cpu->sp)++] + 1; cpu 660 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]}; cpu 673 src/exec.c sys->cpu->pr += 2; cpu 690 src/exec.c for (sys->cpu->pr = execptr->start; ; ) { cpu 694 src/exec.c fprintf(stdout, "#%04X: Register::::\n", sys->cpu->pr); cpu 698 src/exec.c fprintf(stdout, "#%04X: Memory::::\n", sys->cpu->pr); cpu 705 src/exec.c (execmode.monitor == true && sys->cpu->pr == execptr->start) || cpu 706 src/exec.c execmode.step == true || getbps(sys->cpu->pr) == true) cpu 708 src/exec.c if(sys->cpu->pr == execptr->start) { cpu 714 src/exec.c if(sys->cpu->pr >= sys->memsize) { cpu 715 src/exec.c setcerr(201, s = pr2str(sys->cpu->pr)); /* Program Register (PR) - memory overflow */ cpu 719 src/exec.c if(sys->cpu->sp <= execptr->end) { cpu 720 src/exec.c setcerr(202, s = pr2str(sys->cpu->pr)); /* Stack Pointer (SP) - stack overflow */ cpu 725 src/exec.c if((cmdptr = getcmdptr(sys->memory[sys->cpu->pr] & 0xFF00)) == NULL) { cpu 726 src/exec.c setcerr(204, s = pr2str(sys->cpu->pr)); /* OP in word #1 - not command code */ cpu 327 src/monitor.c fprintf(stdout, "#%04X: Register::::\n", sys->cpu->pr); cpu 337 src/monitor.c fprintf(stdout, "#%04X: Register::::\n", sys->cpu->pr); cpu 263 src/struct.c sys->cpu = malloc_chk(sizeof(CPU), "cpu"); cpu 265 src/struct.c sys->cpu->gr[i] = 0x0; cpu 267 src/struct.c sys->cpu->sp = sys->memsize; /* スタックポインタ */ cpu 268 src/struct.c sys->cpu->pr = 0x0; /* プログラムレジスタ */ cpu 269 src/struct.c sys->cpu->fr = 0x0; /* フラグレジスタ */ cpu 282 src/struct.c FREE(sys->cpu);