<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <title>cpu</title> <meta name='robots' content='noindex,nofollow' /> <meta name='generator' content='GLOBAL-6.6.5' /> <meta http-equiv='Content-Style-Type' content='text/css' /> <link rel='stylesheet' type='text/css' href='../style.css' /> </head> <body> <pre> <span class='curline'><a href='../S/2417.html#L46'>cpu</a> 46 include/struct.h CPU *cpu; /**<CPU */</span> <span class='curline'><a href='../S/2840.html#L9'>cpu</a> 9 src/dump.c fprintf(stdout, "#%04X: adr :", sys->cpu->pr);</span> <span class='curline'><a href='../S/2840.html#L22'>cpu</a> 22 src/dump.c fprintf(stdout, "#%04X: %04X: ", sys->cpu->pr, i);</span> <span class='curline'><a href='../S/2840.html#L40'>cpu</a> 40 src/dump.c char *sp = word2bit(sys->cpu->sp);</span> <span class='curline'><a href='../S/2840.html#L41'>cpu</a> 41 src/dump.c char *pr = word2bit(sys->cpu->pr);</span> <span class='curline'><a href='../S/2840.html#L42'>cpu</a> 42 src/dump.c char *fr = word2bit(sys->cpu->fr);</span> <span class='curline'><a href='../S/2840.html#L47'>cpu</a> 47 src/dump.c fprintf(stdout, "#%04X: GR%d: ", sys->cpu->pr, i);</span> <span class='curline'><a href='../S/2840.html#L48'>cpu</a> 48 src/dump.c print_dumpword(sys->cpu->gr[i], execmode.logical);</span> <span class='curline'><a href='../S/2840.html#L51'>cpu</a> 51 src/dump.c fprintf(stdout, "#%04X: SP: %6d = #%04X = %s\n", sys->cpu->pr, sys->cpu->sp, sys->cpu->sp, sp);</span> <span class='curline'><a href='../S/2840.html#L52'>cpu</a> 52 src/dump.c fprintf(stdout, "#%04X: PR: %6d = #%04X = %s\n", sys->cpu->pr, sys->cpu->pr, sys->cpu->pr, pr);</span> <span class='curline'><a href='../S/2840.html#L53'>cpu</a> 53 src/dump.c fprintf(stdout, "#%04X: FR (OF SF ZF): %s\n", sys->cpu->pr, fr + L3BIT); /* FRは下位3けたを表示 */</span> <span class='curline'><a href='../S/2812.html#L107'>cpu</a> 107 src/exec.c sys->memory[sys->cpu->gr[1]] = sys->memory[sys->cpu->gr[2]] = 0x0;</span> <span class='curline'><a href='../S/2812.html#L115'>cpu</a> 115 src/exec.c if(sys->cpu->gr[1] + i > execptr->end) {</span> <span class='curline'><a href='../S/2812.html#L119'>cpu</a> 119 src/exec.c sys->memory[sys->cpu->gr[1] + i] = buf[i];</span> <span class='curline'><a href='../S/2812.html#L121'>cpu</a> 121 src/exec.c sys->memory[sys->cpu->gr[2]] = i + 1;</span> <span class='curline'><a href='../S/2812.html#L130'>cpu</a> 130 src/exec.c for(i = 0; i < sys->memory[sys->cpu->gr[2]]; i++) {</span> <span class='curline'><a href='../S/2812.html#L131'>cpu</a> 131 src/exec.c if(sys->cpu->gr[1] + i > execptr->end) {</span> <span class='curline'><a href='../S/2812.html#L138'>cpu</a> 138 src/exec.c if(((w = sys->memory[sys->cpu->gr[1]+i]) >= 0x20 && w <= 0x7E) || /* JIS X 0201ラテン文字 */</span> <span class='curline'><a href='../S/2812.html#L151'>cpu</a> 151 src/exec.c sys->cpu->fr = 0x0;</span> <span class='curline'><a href='../S/2812.html#L154'>cpu</a> 154 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L158'>cpu</a> 158 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L168'>cpu</a> 168 src/exec.c setcerr(205, s = pr2str(sys->cpu->pr)); /* r/r1 in word #1 - not GR */</span> <span class='curline'><a href='../S/2812.html#L181'>cpu</a> 181 src/exec.c setcerr(206, s = pr2str(sys->cpu->pr)); /* r/r1 in word #1 - not GR */</span> <span class='curline'><a href='../S/2812.html#L194'>cpu</a> 194 src/exec.c a += sys->cpu->gr[x];</span> <span class='curline'><a href='../S/2812.html#L205'>cpu</a> 205 src/exec.c setcerr(207, s = pr2str(sys->cpu->pr + 1)); /* address in word #2 - out of memory */</span> <span class='curline'><a href='../S/2812.html#L220'>cpu</a> 220 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L225'>cpu</a> 225 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L226'>cpu</a> 226 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] = get_val_adr_x(w[1], w[0]));</span> <span class='curline'><a href='../S/2812.html#L227'>cpu</a> 227 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L232'>cpu</a> 232 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L233'>cpu</a> 233 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] = sys->cpu->gr[get_x_r2(w[0])]);</span> <span class='curline'><a href='../S/2812.html#L234'>cpu</a> 234 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L239'>cpu</a> 239 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L240'>cpu</a> 240 src/exec.c sys->memory[get_adr_x(w[1], w[0])] = sys->cpu->gr[get_r_r1(w[0])];</span> <span class='curline'><a href='../S/2812.html#L241'>cpu</a> 241 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L246'>cpu</a> 246 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L247'>cpu</a> 247 src/exec.c sys->cpu->gr[get_r_r1(w[0])] = get_adr_x(w[1], w[0]);</span> <span class='curline'><a href='../S/2812.html#L248'>cpu</a> 248 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L255'>cpu</a> 255 src/exec.c sys->cpu->fr = 0x0;</span> <span class='curline'><a href='../S/2812.html#L258'>cpu</a> 258 src/exec.c if((tmp = (short)(sys->cpu->gr[r]) + (short)val) > 32767 || tmp < -32768) {</span> <span class='curline'><a href='../S/2812.html#L259'>cpu</a> 259 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L262'>cpu</a> 262 src/exec.c sys->cpu->gr[r] = (WORD)(tmp & 0xFFFF);</span> <span class='curline'><a href='../S/2812.html#L263'>cpu</a> 263 src/exec.c if((sys->cpu->gr[r] & 0x8000) == 0x8000) {</span> <span class='curline'><a href='../S/2812.html#L264'>cpu</a> 264 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L265'>cpu</a> 265 src/exec.c } else if(sys->cpu->gr[r] == 0x0) {</span> <span class='curline'><a href='../S/2812.html#L266'>cpu</a> 266 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L272'>cpu</a> 272 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L274'>cpu</a> 274 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L279'>cpu</a> 279 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L280'>cpu</a> 280 src/exec.c adda(get_r_r1(w[0]), sys->cpu->gr[get_x_r2(w[0])]);</span> <span class='curline'><a href='../S/2812.html#L281'>cpu</a> 281 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L286'>cpu</a> 286 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L288'>cpu</a> 288 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L293'>cpu</a> 293 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L294'>cpu</a> 294 src/exec.c adda(get_r_r1(w[0]), ~(sys->cpu->gr[get_x_r2(w[0])]) + 1);</span> <span class='curline'><a href='../S/2812.html#L295'>cpu</a> 295 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L303'>cpu</a> 303 src/exec.c o = sys->cpu->gr[r];</span> <span class='curline'><a href='../S/2812.html#L304'>cpu</a> 304 src/exec.c sys->cpu->fr = 0; /* flag initialize */</span> <span class='curline'><a href='../S/2812.html#L309'>cpu</a> 309 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L313'>cpu</a> 313 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L320'>cpu</a> 320 src/exec.c sys->cpu->gr[r] = (WORD)s;</span> <span class='curline'><a href='../S/2812.html#L323'>cpu</a> 323 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L326'>cpu</a> 326 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L332'>cpu</a> 332 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L334'>cpu</a> 334 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L339'>cpu</a> 339 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L340'>cpu</a> 340 src/exec.c addl_gr(get_r_r1(w[0]), sys->cpu->gr[get_x_r2(w[0])], true);</span> <span class='curline'><a href='../S/2812.html#L341'>cpu</a> 341 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L346'>cpu</a> 346 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L348'>cpu</a> 348 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L353'>cpu</a> 353 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L354'>cpu</a> 354 src/exec.c addl_gr(get_r_r1(w[0]), sys->cpu->gr[get_x_r2(w[0])], false);</span> <span class='curline'><a href='../S/2812.html#L355'>cpu</a> 355 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L360'>cpu</a> 360 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L361'>cpu</a> 361 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] &= get_val_adr_x(w[1], w[0]));</span> <span class='curline'><a href='../S/2812.html#L362'>cpu</a> 362 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L367'>cpu</a> 367 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L368'>cpu</a> 368 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] &= sys->cpu->gr[get_x_r2(w[0])]);</span> <span class='curline'><a href='../S/2812.html#L369'>cpu</a> 369 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L374'>cpu</a> 374 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L375'>cpu</a> 375 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] |= get_val_adr_x(w[1], w[0]));</span> <span class='curline'><a href='../S/2812.html#L376'>cpu</a> 376 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L381'>cpu</a> 381 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L382'>cpu</a> 382 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] |= sys->cpu->gr[get_x_r2(w[0])]);</span> <span class='curline'><a href='../S/2812.html#L383'>cpu</a> 383 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L388'>cpu</a> 388 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L389'>cpu</a> 389 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] ^= get_val_adr_x(w[1], w[0]));</span> <span class='curline'><a href='../S/2812.html#L390'>cpu</a> 390 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L395'>cpu</a> 395 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L396'>cpu</a> 396 src/exec.c setfr(sys->cpu->gr[get_r_r1(w[0])] ^= sys->cpu->gr[get_x_r2(w[0])]);</span> <span class='curline'><a href='../S/2812.html#L397'>cpu</a> 397 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L402'>cpu</a> 402 src/exec.c sys->cpu->fr = 0;</span> <span class='curline'><a href='../S/2812.html#L403'>cpu</a> 403 src/exec.c if((short)sys->cpu->gr[r] < (short)val) {</span> <span class='curline'><a href='../S/2812.html#L404'>cpu</a> 404 src/exec.c sys->cpu->fr = SF;</span> <span class='curline'><a href='../S/2812.html#L405'>cpu</a> 405 src/exec.c } else if(sys->cpu->gr[r] == val) {</span> <span class='curline'><a href='../S/2812.html#L406'>cpu</a> 406 src/exec.c sys->cpu->fr = ZF;</span> <span class='curline'><a href='../S/2812.html#L412'>cpu</a> 412 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L414'>cpu</a> 414 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L419'>cpu</a> 419 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L420'>cpu</a> 420 src/exec.c cpa(get_r_r1(w[0]), sys->cpu->gr[get_x_r2(w[0])]);</span> <span class='curline'><a href='../S/2812.html#L421'>cpu</a> 421 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L426'>cpu</a> 426 src/exec.c sys->cpu->fr = 0x0;</span> <span class='curline'><a href='../S/2812.html#L427'>cpu</a> 427 src/exec.c if(sys->cpu->gr[r] < val) {</span> <span class='curline'><a href='../S/2812.html#L428'>cpu</a> 428 src/exec.c sys->cpu->fr = SF;</span> <span class='curline'><a href='../S/2812.html#L429'>cpu</a> 429 src/exec.c } else if(sys->cpu->gr[r] == val) {</span> <span class='curline'><a href='../S/2812.html#L430'>cpu</a> 430 src/exec.c sys->cpu->fr = ZF;</span> <span class='curline'><a href='../S/2812.html#L436'>cpu</a> 436 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L438'>cpu</a> 438 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L443'>cpu</a> 443 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L444'>cpu</a> 444 src/exec.c cpl(get_r_r1(w[0]), sys->cpu->gr[get_x_r2(w[0])]);</span> <span class='curline'><a href='../S/2812.html#L445'>cpu</a> 445 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L450'>cpu</a> 450 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L452'>cpu</a> 452 src/exec.c WORD sign = sys->cpu->gr[r] & 0x8000;</span> <span class='curline'><a href='../S/2812.html#L455'>cpu</a> 455 src/exec.c sys->cpu->fr = 0;</span> <span class='curline'><a href='../S/2812.html#L456'>cpu</a> 456 src/exec.c sys->cpu->gr[r] &= 0x7FFF;</span> <span class='curline'><a href='../S/2812.html#L458'>cpu</a> 458 src/exec.c last = sys->cpu->gr[r] & 0x4000;</span> <span class='curline'><a href='../S/2812.html#L459'>cpu</a> 459 src/exec.c sys->cpu->gr[r] <<= 1;</span> <span class='curline'><a href='../S/2812.html#L461'>cpu</a> 461 src/exec.c sys->cpu->gr[r] = sign | (sys->cpu->gr[r] & 0x7FFF);</span> <span class='curline'><a href='../S/2812.html#L464'>cpu</a> 464 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L468'>cpu</a> 468 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L471'>cpu</a> 471 src/exec.c if(sys->cpu->gr[r] == 0x0) {</span> <span class='curline'><a href='../S/2812.html#L472'>cpu</a> 472 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L474'>cpu</a> 474 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L479'>cpu</a> 479 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L481'>cpu</a> 481 src/exec.c WORD sign = sys->cpu->gr[r] & 0x8000;</span> <span class='curline'><a href='../S/2812.html#L484'>cpu</a> 484 src/exec.c sys->cpu->fr = 0;</span> <span class='curline'><a href='../S/2812.html#L485'>cpu</a> 485 src/exec.c sys->cpu->gr[r] &= 0x7FFF;</span> <span class='curline'><a href='../S/2812.html#L487'>cpu</a> 487 src/exec.c last = sys->cpu->gr[r] & 0x1;</span> <span class='curline'><a href='../S/2812.html#L488'>cpu</a> 488 src/exec.c sys->cpu->gr[r] >>= 1;</span> <span class='curline'><a href='../S/2812.html#L490'>cpu</a> 490 src/exec.c sys->cpu->gr[r] |= 0x4000;</span> <span class='curline'><a href='../S/2812.html#L493'>cpu</a> 493 src/exec.c sys->cpu->gr[r] = sign | sys->cpu->gr[r];</span> <span class='curline'><a href='../S/2812.html#L496'>cpu</a> 496 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L500'>cpu</a> 500 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L503'>cpu</a> 503 src/exec.c if(sys->cpu->gr[r] == 0x0) {</span> <span class='curline'><a href='../S/2812.html#L504'>cpu</a> 504 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L506'>cpu</a> 506 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L511'>cpu</a> 511 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L515'>cpu</a> 515 src/exec.c sys->cpu->fr = 0x0;</span> <span class='curline'><a href='../S/2812.html#L517'>cpu</a> 517 src/exec.c last = sys->cpu->gr[r] & 0x8000;</span> <span class='curline'><a href='../S/2812.html#L518'>cpu</a> 518 src/exec.c sys->cpu->gr[r] <<= 1;</span> <span class='curline'><a href='../S/2812.html#L522'>cpu</a> 522 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L525'>cpu</a> 525 src/exec.c if((sys->cpu->gr[r] & 0x8000) > 0x0) {</span> <span class='curline'><a href='../S/2812.html#L526'>cpu</a> 526 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L529'>cpu</a> 529 src/exec.c if(sys->cpu->gr[r] == 0x0) {</span> <span class='curline'><a href='../S/2812.html#L530'>cpu</a> 530 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L532'>cpu</a> 532 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L537'>cpu</a> 537 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L541'>cpu</a> 541 src/exec.c sys->cpu->fr = 0x0;</span> <span class='curline'><a href='../S/2812.html#L543'>cpu</a> 543 src/exec.c last = sys->cpu->gr[r] & 0x0001;</span> <span class='curline'><a href='../S/2812.html#L544'>cpu</a> 544 src/exec.c sys->cpu->gr[r] >>= 1;</span> <span class='curline'><a href='../S/2812.html#L548'>cpu</a> 548 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L551'>cpu</a> 551 src/exec.c if((sys->cpu->gr[r] & 0x8000) > 0x0) {</span> <span class='curline'><a href='../S/2812.html#L552'>cpu</a> 552 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L555'>cpu</a> 555 src/exec.c if(sys->cpu->gr[r] == 0x0) {</span> <span class='curline'><a href='../S/2812.html#L556'>cpu</a> 556 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L558'>cpu</a> 558 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L563'>cpu</a> 563 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L564'>cpu</a> 564 src/exec.c if((sys->cpu->fr & (SF | ZF)) == 0) {</span> <span class='curline'><a href='../S/2812.html#L565'>cpu</a> 565 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]);</span> <span class='curline'><a href='../S/2812.html#L567'>cpu</a> 567 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L573'>cpu</a> 573 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L574'>cpu</a> 574 src/exec.c if((sys->cpu->fr & SF) > 0) {</span> <span class='curline'><a href='../S/2812.html#L575'>cpu</a> 575 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]);</span> <span class='curline'><a href='../S/2812.html#L577'>cpu</a> 577 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L583'>cpu</a> 583 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L584'>cpu</a> 584 src/exec.c if((sys->cpu->fr & ZF) == 0) {</span> <span class='curline'><a href='../S/2812.html#L585'>cpu</a> 585 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]);</span> <span class='curline'><a href='../S/2812.html#L587'>cpu</a> 587 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L593'>cpu</a> 593 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L594'>cpu</a> 594 src/exec.c if((sys->cpu->fr & ZF) > 0) {</span> <span class='curline'><a href='../S/2812.html#L595'>cpu</a> 595 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]);</span> <span class='curline'><a href='../S/2812.html#L597'>cpu</a> 597 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L603'>cpu</a> 603 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L604'>cpu</a> 604 src/exec.c if((sys->cpu->fr & OF) > 0) {</span> <span class='curline'><a href='../S/2812.html#L605'>cpu</a> 605 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]);</span> <span class='curline'><a href='../S/2812.html#L607'>cpu</a> 607 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L613'>cpu</a> 613 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L614'>cpu</a> 614 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]);</span> <span class='curline'><a href='../S/2812.html#L619'>cpu</a> 619 src/exec.c assert(sys->cpu->sp > execptr->end && sys->cpu->sp <= sys->memsize);</span> <span class='curline'><a href='../S/2812.html#L620'>cpu</a> 620 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L621'>cpu</a> 621 src/exec.c sys->memory[--(sys->cpu->sp)] = get_adr_x(w[1], w[0]);</span> <span class='curline'><a href='../S/2812.html#L622'>cpu</a> 622 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L627'>cpu</a> 627 src/exec.c assert(sys->cpu->sp > execptr->end);</span> <span class='curline'><a href='../S/2812.html#L628'>cpu</a> 628 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L631'>cpu</a> 631 src/exec.c if(sys->cpu->sp >= sys->memsize) {</span> <span class='curline'><a href='../S/2812.html#L632'>cpu</a> 632 src/exec.c setcerr(203, s = pr2str(sys->cpu->pr)); /* Stack Pointer (SP) - stack underflow */</span> <span class='curline'><a href='../S/2812.html#L635'>cpu</a> 635 src/exec.c sys->cpu->gr[get_r_r1(w[0])] = sys->memory[(sys->cpu->sp)++];</span> <span class='curline'><a href='../S/2812.html#L636'>cpu</a> 636 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L642'>cpu</a> 642 src/exec.c assert(sys->cpu->sp > execptr->end && sys->cpu->sp <= sys->memsize);</span> <span class='curline'><a href='../S/2812.html#L643'>cpu</a> 643 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L644'>cpu</a> 644 src/exec.c sys->memory[--(sys->cpu->sp)] = sys->cpu->pr + 1;</span> <span class='curline'><a href='../S/2812.html#L645'>cpu</a> 645 src/exec.c sys->cpu->pr = get_adr_x(w[1], w[0]);</span> <span class='curline'><a href='../S/2812.html#L650'>cpu</a> 650 src/exec.c assert(sys->cpu->sp <= sys->memsize);</span> <span class='curline'><a href='../S/2812.html#L651'>cpu</a> 651 src/exec.c if(sys->cpu->sp == sys->memsize) {</span> <span class='curline'><a href='../S/2812.html#L653'>cpu</a> 653 src/exec.c } else if(sys->cpu->sp < sys->memsize) {</span> <span class='curline'><a href='../S/2812.html#L654'>cpu</a> 654 src/exec.c sys->cpu->pr = sys->memory[(sys->cpu->sp)++] + 1;</span> <span class='curline'><a href='../S/2812.html#L660'>cpu</a> 660 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr], sys->memory[sys->cpu->pr + 1]};</span> <span class='curline'><a href='../S/2812.html#L673'>cpu</a> 673 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L690'>cpu</a> 690 src/exec.c for (sys->cpu->pr = execptr->start; ; ) {</span> <span class='curline'><a href='../S/2812.html#L694'>cpu</a> 694 src/exec.c fprintf(stdout, "#%04X: Register::::\n", sys->cpu->pr);</span> <span class='curline'><a href='../S/2812.html#L698'>cpu</a> 698 src/exec.c fprintf(stdout, "#%04X: Memory::::\n", sys->cpu->pr);</span> <span class='curline'><a href='../S/2812.html#L705'>cpu</a> 705 src/exec.c (execmode.monitor == true && sys->cpu->pr == execptr->start) ||</span> <span class='curline'><a href='../S/2812.html#L706'>cpu</a> 706 src/exec.c execmode.step == true || getbps(sys->cpu->pr) == true)</span> <span class='curline'><a href='../S/2812.html#L708'>cpu</a> 708 src/exec.c if(sys->cpu->pr == execptr->start) {</span> <span class='curline'><a href='../S/2812.html#L714'>cpu</a> 714 src/exec.c if(sys->cpu->pr >= sys->memsize) {</span> <span class='curline'><a href='../S/2812.html#L715'>cpu</a> 715 src/exec.c setcerr(201, s = pr2str(sys->cpu->pr)); /* Program Register (PR) - memory overflow */</span> <span class='curline'><a href='../S/2812.html#L719'>cpu</a> 719 src/exec.c if(sys->cpu->sp <= execptr->end) {</span> <span class='curline'><a href='../S/2812.html#L720'>cpu</a> 720 src/exec.c setcerr(202, s = pr2str(sys->cpu->pr)); /* Stack Pointer (SP) - stack overflow */</span> <span class='curline'><a href='../S/2812.html#L725'>cpu</a> 725 src/exec.c if((cmdptr = getcmdptr(sys->memory[sys->cpu->pr] & 0xFF00)) == NULL) {</span> <span class='curline'><a href='../S/2812.html#L726'>cpu</a> 726 src/exec.c setcerr(204, s = pr2str(sys->cpu->pr)); /* OP in word #1 - not command code */</span> <span class='curline'><a href='../S/2804.html#L327'>cpu</a> 327 src/monitor.c fprintf(stdout, "#%04X: Register::::\n", sys->cpu->pr);</span> <span class='curline'><a href='../S/2804.html#L337'>cpu</a> 337 src/monitor.c fprintf(stdout, "#%04X: Register::::\n", sys->cpu->pr);</span> <span class='curline'><a href='../S/2856.html#L263'>cpu</a> 263 src/struct.c sys->cpu = malloc_chk(sizeof(CPU), "cpu");</span> <span class='curline'><a href='../S/2856.html#L265'>cpu</a> 265 src/struct.c sys->cpu->gr[i] = 0x0;</span> <span class='curline'><a href='../S/2856.html#L267'>cpu</a> 267 src/struct.c sys->cpu->sp = sys->memsize; /* スタックポインタ */</span> <span class='curline'><a href='../S/2856.html#L268'>cpu</a> 268 src/struct.c sys->cpu->pr = 0x0; /* プログラムレジスタ */</span> <span class='curline'><a href='../S/2856.html#L269'>cpu</a> 269 src/struct.c sys->cpu->fr = 0x0; /* フラグレジスタ */</span> <span class='curline'><a href='../S/2856.html#L282'>cpu</a> 282 src/struct.c FREE(sys->cpu);</span> </pre> </body> </html>