<!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>sys</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#L55'>sys</a> 55 include/struct.h extern SYSTEM *sys;</span> <span class='curline'><a href='../S/2837.html#L376'>sys</a> 376 src/assemble.c if(adr >= sys->memsize) {</span> <span class='curline'><a href='../S/2837.html#L381'>sys</a> 381 src/assemble.c (sys->memory)[adr] = word;</span> <span class='curline'><a href='../S/2837.html#L813'>sys</a> 813 src/assemble.c fwrite(sys->memory, sizeof(WORD), execptr->end, fp);</span> <span class='curline'><a href='../S/2810.html#L246'>sys</a> 246 src/disassemble.c cmd = sys->memory[i] & 0xFF00;</span> <span class='curline'><a href='../S/2810.html#L249'>sys</a> 249 src/disassemble.c if(sys->memory[i] == 0) {</span> <span class='curline'><a href='../S/2810.html#L256'>sys</a> 256 src/disassemble.c disassemble_dc(sys->memory[i], i);</span> <span class='curline'><a href='../S/2810.html#L259'>sys</a> 259 src/disassemble.c disassemble_cmd_adr_x(cmdtype, cmdname, sys->memory[i], sys->memory[i+1], i);</span> <span class='curline'><a href='../S/2810.html#L262'>sys</a> 262 src/disassemble.c disassemble_cmd_r(cmdtype, cmdname, sys->memory[i], i);</span> <span class='curline'><a href='../S/2840.html#L9'>sys</a> 9 src/dump.c fprintf(stdout, "#%04X: adr :", sys->cpu->pr);</span> <span class='curline'><a href='../S/2840.html#L10'>sys</a> 10 src/dump.c if(end > sys->memsize) {</span> <span class='curline'><a href='../S/2840.html#L11'>sys</a> 11 src/dump.c end = sys->memsize;</span> <span class='curline'><a href='../S/2840.html#L13'>sys</a> 13 src/dump.c for(int i = 0; i < sys->memsize && i < col; i++) {</span> <span class='curline'><a href='../S/2840.html#L22'>sys</a> 22 src/dump.c fprintf(stdout, "#%04X: %04X: ", sys->cpu->pr, i);</span> <span class='curline'><a href='../S/2840.html#L29'>sys</a> 29 src/dump.c fprintf(stdout, "%04X", sys->memory[i]);</span> <span class='curline'><a href='../S/2840.html#L40'>sys</a> 40 src/dump.c char *sp = word2bit(sys->cpu->sp);</span> <span class='curline'><a href='../S/2840.html#L41'>sys</a> 41 src/dump.c char *pr = word2bit(sys->cpu->pr);</span> <span class='curline'><a href='../S/2840.html#L42'>sys</a> 42 src/dump.c char *fr = word2bit(sys->cpu->fr);</span> <span class='curline'><a href='../S/2840.html#L47'>sys</a> 47 src/dump.c fprintf(stdout, "#%04X: GR%d: ", sys->cpu->pr, i);</span> <span class='curline'><a href='../S/2840.html#L48'>sys</a> 48 src/dump.c print_dumpword(sys->cpu->gr[i], execmode.logical);</span> <span class='curline'><a href='../S/2840.html#L51'>sys</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'>sys</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'>sys</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'>sys</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'>sys</a> 115 src/exec.c if(sys->cpu->gr[1] + i > execptr->end) {</span> <span class='curline'><a href='../S/2812.html#L119'>sys</a> 119 src/exec.c sys->memory[sys->cpu->gr[1] + i] = buf[i];</span> <span class='curline'><a href='../S/2812.html#L121'>sys</a> 121 src/exec.c sys->memory[sys->cpu->gr[2]] = i + 1;</span> <span class='curline'><a href='../S/2812.html#L130'>sys</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'>sys</a> 131 src/exec.c if(sys->cpu->gr[1] + i > execptr->end) {</span> <span class='curline'><a href='../S/2812.html#L138'>sys</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'>sys</a> 151 src/exec.c sys->cpu->fr = 0x0;</span> <span class='curline'><a href='../S/2812.html#L154'>sys</a> 154 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L158'>sys</a> 158 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L168'>sys</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'>sys</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'>sys</a> 194 src/exec.c a += sys->cpu->gr[x];</span> <span class='curline'><a href='../S/2812.html#L204'>sys</a> 204 src/exec.c if((a = get_adr_x(adr, oprx)) >= sys->memsize) {</span> <span class='curline'><a href='../S/2812.html#L205'>sys</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#L209'>sys</a> 209 src/exec.c return sys->memory[a];</span> <span class='curline'><a href='../S/2812.html#L220'>sys</a> 220 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L225'>sys</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'>sys</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'>sys</a> 227 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L232'>sys</a> 232 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L233'>sys</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'>sys</a> 234 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L239'>sys</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'>sys</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'>sys</a> 241 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L246'>sys</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'>sys</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'>sys</a> 248 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L255'>sys</a> 255 src/exec.c sys->cpu->fr = 0x0;</span> <span class='curline'><a href='../S/2812.html#L258'>sys</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'>sys</a> 259 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L262'>sys</a> 262 src/exec.c sys->cpu->gr[r] = (WORD)(tmp & 0xFFFF);</span> <span class='curline'><a href='../S/2812.html#L263'>sys</a> 263 src/exec.c if((sys->cpu->gr[r] & 0x8000) == 0x8000) {</span> <span class='curline'><a href='../S/2812.html#L264'>sys</a> 264 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L265'>sys</a> 265 src/exec.c } else if(sys->cpu->gr[r] == 0x0) {</span> <span class='curline'><a href='../S/2812.html#L266'>sys</a> 266 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L272'>sys</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'>sys</a> 274 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L279'>sys</a> 279 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L280'>sys</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'>sys</a> 281 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L286'>sys</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'>sys</a> 288 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L293'>sys</a> 293 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L294'>sys</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'>sys</a> 295 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L303'>sys</a> 303 src/exec.c o = sys->cpu->gr[r];</span> <span class='curline'><a href='../S/2812.html#L304'>sys</a> 304 src/exec.c sys->cpu->fr = 0; /* flag initialize */</span> <span class='curline'><a href='../S/2812.html#L309'>sys</a> 309 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L313'>sys</a> 313 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L320'>sys</a> 320 src/exec.c sys->cpu->gr[r] = (WORD)s;</span> <span class='curline'><a href='../S/2812.html#L323'>sys</a> 323 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L326'>sys</a> 326 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L332'>sys</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'>sys</a> 334 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L339'>sys</a> 339 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L340'>sys</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'>sys</a> 341 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L346'>sys</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'>sys</a> 348 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L353'>sys</a> 353 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L354'>sys</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'>sys</a> 355 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L360'>sys</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'>sys</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'>sys</a> 362 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L367'>sys</a> 367 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L368'>sys</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'>sys</a> 369 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L374'>sys</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'>sys</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'>sys</a> 376 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L381'>sys</a> 381 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L382'>sys</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'>sys</a> 383 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L388'>sys</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'>sys</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'>sys</a> 390 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L395'>sys</a> 395 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L396'>sys</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'>sys</a> 397 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L402'>sys</a> 402 src/exec.c sys->cpu->fr = 0;</span> <span class='curline'><a href='../S/2812.html#L403'>sys</a> 403 src/exec.c if((short)sys->cpu->gr[r] < (short)val) {</span> <span class='curline'><a href='../S/2812.html#L404'>sys</a> 404 src/exec.c sys->cpu->fr = SF;</span> <span class='curline'><a href='../S/2812.html#L405'>sys</a> 405 src/exec.c } else if(sys->cpu->gr[r] == val) {</span> <span class='curline'><a href='../S/2812.html#L406'>sys</a> 406 src/exec.c sys->cpu->fr = ZF;</span> <span class='curline'><a href='../S/2812.html#L412'>sys</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'>sys</a> 414 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L419'>sys</a> 419 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L420'>sys</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'>sys</a> 421 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L426'>sys</a> 426 src/exec.c sys->cpu->fr = 0x0;</span> <span class='curline'><a href='../S/2812.html#L427'>sys</a> 427 src/exec.c if(sys->cpu->gr[r] < val) {</span> <span class='curline'><a href='../S/2812.html#L428'>sys</a> 428 src/exec.c sys->cpu->fr = SF;</span> <span class='curline'><a href='../S/2812.html#L429'>sys</a> 429 src/exec.c } else if(sys->cpu->gr[r] == val) {</span> <span class='curline'><a href='../S/2812.html#L430'>sys</a> 430 src/exec.c sys->cpu->fr = ZF;</span> <span class='curline'><a href='../S/2812.html#L436'>sys</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'>sys</a> 438 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L443'>sys</a> 443 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L444'>sys</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'>sys</a> 445 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L450'>sys</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'>sys</a> 452 src/exec.c WORD sign = sys->cpu->gr[r] & 0x8000;</span> <span class='curline'><a href='../S/2812.html#L455'>sys</a> 455 src/exec.c sys->cpu->fr = 0;</span> <span class='curline'><a href='../S/2812.html#L456'>sys</a> 456 src/exec.c sys->cpu->gr[r] &= 0x7FFF;</span> <span class='curline'><a href='../S/2812.html#L458'>sys</a> 458 src/exec.c last = sys->cpu->gr[r] & 0x4000;</span> <span class='curline'><a href='../S/2812.html#L459'>sys</a> 459 src/exec.c sys->cpu->gr[r] <<= 1;</span> <span class='curline'><a href='../S/2812.html#L461'>sys</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'>sys</a> 464 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L468'>sys</a> 468 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L471'>sys</a> 471 src/exec.c if(sys->cpu->gr[r] == 0x0) {</span> <span class='curline'><a href='../S/2812.html#L472'>sys</a> 472 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L474'>sys</a> 474 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L479'>sys</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'>sys</a> 481 src/exec.c WORD sign = sys->cpu->gr[r] & 0x8000;</span> <span class='curline'><a href='../S/2812.html#L484'>sys</a> 484 src/exec.c sys->cpu->fr = 0;</span> <span class='curline'><a href='../S/2812.html#L485'>sys</a> 485 src/exec.c sys->cpu->gr[r] &= 0x7FFF;</span> <span class='curline'><a href='../S/2812.html#L487'>sys</a> 487 src/exec.c last = sys->cpu->gr[r] & 0x1;</span> <span class='curline'><a href='../S/2812.html#L488'>sys</a> 488 src/exec.c sys->cpu->gr[r] >>= 1;</span> <span class='curline'><a href='../S/2812.html#L490'>sys</a> 490 src/exec.c sys->cpu->gr[r] |= 0x4000;</span> <span class='curline'><a href='../S/2812.html#L493'>sys</a> 493 src/exec.c sys->cpu->gr[r] = sign | sys->cpu->gr[r];</span> <span class='curline'><a href='../S/2812.html#L496'>sys</a> 496 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L500'>sys</a> 500 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L503'>sys</a> 503 src/exec.c if(sys->cpu->gr[r] == 0x0) {</span> <span class='curline'><a href='../S/2812.html#L504'>sys</a> 504 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L506'>sys</a> 506 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L511'>sys</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'>sys</a> 515 src/exec.c sys->cpu->fr = 0x0;</span> <span class='curline'><a href='../S/2812.html#L517'>sys</a> 517 src/exec.c last = sys->cpu->gr[r] & 0x8000;</span> <span class='curline'><a href='../S/2812.html#L518'>sys</a> 518 src/exec.c sys->cpu->gr[r] <<= 1;</span> <span class='curline'><a href='../S/2812.html#L522'>sys</a> 522 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L525'>sys</a> 525 src/exec.c if((sys->cpu->gr[r] & 0x8000) > 0x0) {</span> <span class='curline'><a href='../S/2812.html#L526'>sys</a> 526 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L529'>sys</a> 529 src/exec.c if(sys->cpu->gr[r] == 0x0) {</span> <span class='curline'><a href='../S/2812.html#L530'>sys</a> 530 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L532'>sys</a> 532 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L537'>sys</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'>sys</a> 541 src/exec.c sys->cpu->fr = 0x0;</span> <span class='curline'><a href='../S/2812.html#L543'>sys</a> 543 src/exec.c last = sys->cpu->gr[r] & 0x0001;</span> <span class='curline'><a href='../S/2812.html#L544'>sys</a> 544 src/exec.c sys->cpu->gr[r] >>= 1;</span> <span class='curline'><a href='../S/2812.html#L548'>sys</a> 548 src/exec.c sys->cpu->fr += OF;</span> <span class='curline'><a href='../S/2812.html#L551'>sys</a> 551 src/exec.c if((sys->cpu->gr[r] & 0x8000) > 0x0) {</span> <span class='curline'><a href='../S/2812.html#L552'>sys</a> 552 src/exec.c sys->cpu->fr += SF;</span> <span class='curline'><a href='../S/2812.html#L555'>sys</a> 555 src/exec.c if(sys->cpu->gr[r] == 0x0) {</span> <span class='curline'><a href='../S/2812.html#L556'>sys</a> 556 src/exec.c sys->cpu->fr += ZF;</span> <span class='curline'><a href='../S/2812.html#L558'>sys</a> 558 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L563'>sys</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'>sys</a> 564 src/exec.c if((sys->cpu->fr & (SF | ZF)) == 0) {</span> <span class='curline'><a href='../S/2812.html#L565'>sys</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'>sys</a> 567 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L573'>sys</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'>sys</a> 574 src/exec.c if((sys->cpu->fr & SF) > 0) {</span> <span class='curline'><a href='../S/2812.html#L575'>sys</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'>sys</a> 577 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L583'>sys</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'>sys</a> 584 src/exec.c if((sys->cpu->fr & ZF) == 0) {</span> <span class='curline'><a href='../S/2812.html#L585'>sys</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'>sys</a> 587 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L593'>sys</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'>sys</a> 594 src/exec.c if((sys->cpu->fr & ZF) > 0) {</span> <span class='curline'><a href='../S/2812.html#L595'>sys</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'>sys</a> 597 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L603'>sys</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'>sys</a> 604 src/exec.c if((sys->cpu->fr & OF) > 0) {</span> <span class='curline'><a href='../S/2812.html#L605'>sys</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'>sys</a> 607 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L613'>sys</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'>sys</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'>sys</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'>sys</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'>sys</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'>sys</a> 622 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L627'>sys</a> 627 src/exec.c assert(sys->cpu->sp > execptr->end);</span> <span class='curline'><a href='../S/2812.html#L628'>sys</a> 628 src/exec.c WORD w[] = {sys->memory[sys->cpu->pr]};</span> <span class='curline'><a href='../S/2812.html#L631'>sys</a> 631 src/exec.c if(sys->cpu->sp >= sys->memsize) {</span> <span class='curline'><a href='../S/2812.html#L632'>sys</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'>sys</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'>sys</a> 636 src/exec.c sys->cpu->pr += 1;</span> <span class='curline'><a href='../S/2812.html#L642'>sys</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'>sys</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'>sys</a> 644 src/exec.c sys->memory[--(sys->cpu->sp)] = sys->cpu->pr + 1;</span> <span class='curline'><a href='../S/2812.html#L645'>sys</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'>sys</a> 650 src/exec.c assert(sys->cpu->sp <= sys->memsize);</span> <span class='curline'><a href='../S/2812.html#L651'>sys</a> 651 src/exec.c if(sys->cpu->sp == sys->memsize) {</span> <span class='curline'><a href='../S/2812.html#L653'>sys</a> 653 src/exec.c } else if(sys->cpu->sp < sys->memsize) {</span> <span class='curline'><a href='../S/2812.html#L654'>sys</a> 654 src/exec.c sys->cpu->pr = sys->memory[(sys->cpu->sp)++] + 1;</span> <span class='curline'><a href='../S/2812.html#L660'>sys</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'>sys</a> 673 src/exec.c sys->cpu->pr += 2;</span> <span class='curline'><a href='../S/2812.html#L690'>sys</a> 690 src/exec.c for (sys->cpu->pr = execptr->start; ; ) {</span> <span class='curline'><a href='../S/2812.html#L694'>sys</a> 694 src/exec.c fprintf(stdout, "#%04X: Register::::\n", sys->cpu->pr);</span> <span class='curline'><a href='../S/2812.html#L698'>sys</a> 698 src/exec.c fprintf(stdout, "#%04X: Memory::::\n", sys->cpu->pr);</span> <span class='curline'><a href='../S/2812.html#L705'>sys</a> 705 src/exec.c (execmode.monitor == true && sys->cpu->pr == execptr->start) ||</span> <span class='curline'><a href='../S/2812.html#L706'>sys</a> 706 src/exec.c execmode.step == true || getbps(sys->cpu->pr) == true)</span> <span class='curline'><a href='../S/2812.html#L708'>sys</a> 708 src/exec.c if(sys->cpu->pr == execptr->start) {</span> <span class='curline'><a href='../S/2812.html#L714'>sys</a> 714 src/exec.c if(sys->cpu->pr >= sys->memsize) {</span> <span class='curline'><a href='../S/2812.html#L715'>sys</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'>sys</a> 719 src/exec.c if(sys->cpu->sp <= execptr->end) {</span> <span class='curline'><a href='../S/2812.html#L720'>sys</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'>sys</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'>sys</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/2812.html#L747'>sys</a> 747 src/exec.c } while(clock_end - clock_begin < CLOCKS_PER_SEC / sys->clocks);</span> <span class='curline'><a href='../S/2852.html#L37'>sys</a> 37 src/load.c end = start + fread(sys->memory + start, sizeof(WORD), sys->memsize - start, fp);</span> <span class='curline'><a href='../S/2852.html#L38'>sys</a> 38 src/load.c if(end == sys->memsize) {</span> <span class='curline'><a href='../S/2804.html#L319'>sys</a> 319 src/monitor.c reset(sys->memsize, sys->clocks); /* COMET II仮想マシンのリセット */</span> <span class='curline'><a href='../S/2804.html#L327'>sys</a> 327 src/monitor.c fprintf(stdout, "#%04X: Register::::\n", sys->cpu->pr);</span> <span class='curline'><a href='../S/2804.html#L337'>sys</a> 337 src/monitor.c fprintf(stdout, "#%04X: Register::::\n", sys->cpu->pr);</span> <span class='curline'><a href='../S/2856.html#L7'>sys</a> 7 src/struct.c SYSTEM *sys = NULL;</span> <span class='curline'><a href='../S/2856.html#L255'>sys</a> 255 src/struct.c sys = malloc_chk(sizeof(SYSTEM), "sys");</span> <span class='curline'><a href='../S/2856.html#L257'>sys</a> 257 src/struct.c sys->memsize = memsize;</span> <span class='curline'><a href='../S/2856.html#L259'>sys</a> 259 src/struct.c sys->clocks = clocks;</span> <span class='curline'><a href='../S/2856.html#L261'>sys</a> 261 src/struct.c sys->memory = calloc_chk(sys->memsize, sizeof(WORD), "memory");</span> <span class='curline'><a href='../S/2856.html#L263'>sys</a> 263 src/struct.c sys->cpu = malloc_chk(sizeof(CPU), "cpu");</span> <span class='curline'><a href='../S/2856.html#L265'>sys</a> 265 src/struct.c sys->cpu->gr[i] = 0x0;</span> <span class='curline'><a href='../S/2856.html#L267'>sys</a> 267 src/struct.c sys->cpu->sp = sys->memsize; /* スタックポインタ */</span> <span class='curline'><a href='../S/2856.html#L268'>sys</a> 268 src/struct.c sys->cpu->pr = 0x0; /* プログラムレジスタ */</span> <span class='curline'><a href='../S/2856.html#L269'>sys</a> 269 src/struct.c sys->cpu->fr = 0x0; /* フラグレジスタ */</span> <span class='curline'><a href='../S/2856.html#L281'>sys</a> 281 src/struct.c FREE(sys->memory);</span> <span class='curline'><a href='../S/2856.html#L282'>sys</a> 282 src/struct.c FREE(sys->cpu);</span> <span class='curline'><a href='../S/2856.html#L283'>sys</a> 283 src/struct.c FREE(sys);</span> </pre> </body> </html>