<!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>src/struct.c</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> <a id='TOP' name='TOP'></a><h2 class='header'><a href='../mains.html'>root</a>/<a href='../files/2932.html'>src</a>/struct.c</h2> <em class='comment'>/* [<][>]<a href='#L88'>[^]</a><a href='#L278'>[v]</a>[top]<a href='#BOTTOM'>[bottom]</a><a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</em> <hr /> <h2 class='header'>DEFINITIONS</h2> This source file includes following definitions. <ol> <li><a href='#L88' title='Defined at 88.'>hash_cmdtype</a></li> <li><a href='#L113' title='Defined at 113.'>create_cmdtable</a></li> <li><a href='#L135' title='Defined at 135.'>free_cmdtable</a></li> <li><a href='#L153' title='Defined at 153.'>getcmdcode</a></li> <li><a href='#L171' title='Defined at 171.'>hash_code</a></li> <li><a href='#L188' title='Defined at 188.'>getcmdptr</a></li> <li><a href='#L205' title='Defined at 205.'>getcmdtype</a></li> <li><a href='#L222' title='Defined at 222.'>getcmdname</a></li> <li><a href='#L240' title='Defined at 240.'>grstr</a></li> <li><a href='#L253' title='Defined at 253.'>reset</a></li> <li><a href='#L278' title='Defined at 278.'>shutdown</a></li> </ol> <hr /> <pre> <a id='L1' name='L1'></a> 1 <em class='sharp'>#include</em> "<a href='2417.html'>struct.h</a>" <a id='L2' name='L2'></a> 2 <em class='sharp'>#include</em> "<a href='2420.html'>exec.h</a>" <a id='L3' name='L3'></a> 3 <a id='L4' name='L4'></a> 4 <em class='comment'>/**</em> <a id='L5' name='L5'></a> 5 <em class='comment'> * COMET IIの仮想実行マシンシステム</em> <a id='L6' name='L6'></a> 6 <em class='comment'> */</em> <a id='L7' name='L7'></a> 7 <a href='../S/2417.html#L50' title='Defined at 50 in include/struct.h.'>SYSTEM</a> *<a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L8' name='L8'></a> 8 <a id='L9' name='L9'></a> 9 <em class='comment'>/**</em> <a id='L10' name='L10'></a> 10 <em class='comment'> * プログラム実行時の開始と終了のアドレス</em> <a id='L11' name='L11'></a> 11 <em class='comment'> */</em> <a id='L12' name='L12'></a> 12 <a href='../S/2417.html#L134' title='Defined at 134 in include/struct.h.'>EXECPTR</a> *<a href='../Y/89.html' title='Multiple used in 25 places.'>execptr</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L13' name='L13'></a> 13 <a id='L14' name='L14'></a> 14 <em class='comment'>/**</em> <a id='L15' name='L15'></a> 15 <em class='comment'> * システムCOMET IIの命令表</em> <a id='L16' name='L16'></a> 16 <em class='comment'> */</em> <a id='L17' name='L17'></a> 17 <strong class='reserved'>static</strong> <strong class='reserved'>const</strong> <a href='../S/2417.html#L117' title='Defined at 117 in include/struct.h.'>COMET2CMD</a> <a href='../Y/73.html' title='Multiple used in 5 places.'>comet2cmd</a>[] = <em class='brace'>{</em> <a id='L18' name='L18'></a> 18 <em class='brace'>{</em> "NOP", <a href='../S/2417.html#L98' title='Defined at 98 in include/struct.h.'>NONE</a>, 0x0, <a href='../S/2812.html#L218' title='Defined at 218 in src/exec.c.'>nop</a> <em class='brace'>}</em>, <a id='L19' name='L19'></a> 19 <em class='brace'>{</em> "LD", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x1000, <a href='../S/2812.html#L223' title='Defined at 223 in src/exec.c.'>ld_r_adr_x</a> <em class='brace'>}</em>, <a id='L20' name='L20'></a> 20 <em class='brace'>{</em> "ST", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x1100, <a href='../S/2812.html#L237' title='Defined at 237 in src/exec.c.'>st</a> <em class='brace'>}</em>, <a id='L21' name='L21'></a> 21 <em class='brace'>{</em> "LAD", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x1200, <a href='../S/2812.html#L244' title='Defined at 244 in src/exec.c.'>lad</a> <em class='brace'>}</em>, <a id='L22' name='L22'></a> 22 <em class='brace'>{</em> "LD", <a href='../S/2417.html#L83' title='Defined at 83 in include/struct.h.'>R1_R2</a>, 0x1400, <a href='../S/2812.html#L230' title='Defined at 230 in src/exec.c.'>ld_r1_r2</a> <em class='brace'>}</em>, <a id='L23' name='L23'></a> 23 <em class='brace'>{</em> "ADDA", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x2000, <a href='../S/2812.html#L270' title='Defined at 270 in src/exec.c.'>adda_r_adr_x</a> <em class='brace'>}</em>, <a id='L24' name='L24'></a> 24 <em class='brace'>{</em> "SUBA", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x2100, <a href='../S/2812.html#L284' title='Defined at 284 in src/exec.c.'>suba_r_adr_x</a> <em class='brace'>}</em>, <a id='L25' name='L25'></a> 25 <em class='brace'>{</em> "ADDL", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x2200, <a href='../S/2812.html#L330' title='Defined at 330 in src/exec.c.'>addl_r_adr_x</a> <em class='brace'>}</em>, <a id='L26' name='L26'></a> 26 <em class='brace'>{</em> "SUBL", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x2300, <a href='../S/2812.html#L344' title='Defined at 344 in src/exec.c.'>subl_r_adr_x</a> <em class='brace'>}</em>, <a id='L27' name='L27'></a> 27 <em class='brace'>{</em> "ADDA", <a href='../S/2417.html#L83' title='Defined at 83 in include/struct.h.'>R1_R2</a>, 0x2400, <a href='../S/2812.html#L277' title='Defined at 277 in src/exec.c.'>adda_r1_r2</a> <em class='brace'>}</em>, <a id='L28' name='L28'></a> 28 <em class='brace'>{</em> "SUBA", <a href='../S/2417.html#L83' title='Defined at 83 in include/struct.h.'>R1_R2</a>, 0x2500, <a href='../S/2812.html#L291' title='Defined at 291 in src/exec.c.'>suba_r1_r2</a> <em class='brace'>}</em>, <a id='L29' name='L29'></a> 29 <em class='brace'>{</em> "ADDL", <a href='../S/2417.html#L83' title='Defined at 83 in include/struct.h.'>R1_R2</a>, 0x2600, <a href='../S/2812.html#L337' title='Defined at 337 in src/exec.c.'>addl_r1_r2</a> <em class='brace'>}</em>, <a id='L30' name='L30'></a> 30 <em class='brace'>{</em> "SUBL", <a href='../S/2417.html#L83' title='Defined at 83 in include/struct.h.'>R1_R2</a>, 0x2700, <a href='../S/2812.html#L351' title='Defined at 351 in src/exec.c.'>subl_r1_r2</a> <em class='brace'>}</em>, <a id='L31' name='L31'></a> 31 <em class='brace'>{</em> "AND", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x3000, <a href='../S/2812.html#L358' title='Defined at 358 in src/exec.c.'>and_r_adr_x</a> <em class='brace'>}</em>, <a id='L32' name='L32'></a> 32 <em class='brace'>{</em> "OR", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x3100, <a href='../S/2812.html#L372' title='Defined at 372 in src/exec.c.'>or_r_adr_x</a> <em class='brace'>}</em>, <a id='L33' name='L33'></a> 33 <em class='brace'>{</em> "XOR", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x3200, <a href='../S/2812.html#L386' title='Defined at 386 in src/exec.c.'>xor_r_adr_x</a> <em class='brace'>}</em>, <a id='L34' name='L34'></a> 34 <em class='brace'>{</em> "AND", <a href='../S/2417.html#L83' title='Defined at 83 in include/struct.h.'>R1_R2</a>, 0x3400, <a href='../S/2812.html#L365' title='Defined at 365 in src/exec.c.'>and_r1_r2</a> <em class='brace'>}</em>, <a id='L35' name='L35'></a> 35 <em class='brace'>{</em> "OR", <a href='../S/2417.html#L83' title='Defined at 83 in include/struct.h.'>R1_R2</a>, 0x3500, <a href='../S/2812.html#L379' title='Defined at 379 in src/exec.c.'>or_r1_r2</a> <em class='brace'>}</em>, <a id='L36' name='L36'></a> 36 <em class='brace'>{</em> "XOR", <a href='../S/2417.html#L83' title='Defined at 83 in include/struct.h.'>R1_R2</a>, 0x3600, <a href='../S/2812.html#L393' title='Defined at 393 in src/exec.c.'>xor_r1_r2</a> <em class='brace'>}</em>, <a id='L37' name='L37'></a> 37 <em class='brace'>{</em> "CPA", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x4000, <a href='../S/2812.html#L410' title='Defined at 410 in src/exec.c.'>cpa_r_adr_x</a> <em class='brace'>}</em>, <a id='L38' name='L38'></a> 38 <em class='brace'>{</em> "CPL", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x4100, <a href='../S/2812.html#L434' title='Defined at 434 in src/exec.c.'>cpl_r_adr_x</a> <em class='brace'>}</em>, <a id='L39' name='L39'></a> 39 <em class='brace'>{</em> "CPA", <a href='../S/2417.html#L83' title='Defined at 83 in include/struct.h.'>R1_R2</a>, 0x4400, <a href='../S/2812.html#L417' title='Defined at 417 in src/exec.c.'>cpa_r1_r2</a> <em class='brace'>}</em>, <a id='L40' name='L40'></a> 40 <em class='brace'>{</em> "CPL", <a href='../S/2417.html#L83' title='Defined at 83 in include/struct.h.'>R1_R2</a>, 0x4500, <a href='../S/2812.html#L441' title='Defined at 441 in src/exec.c.'>cpl_r1_r2</a> <em class='brace'>}</em>, <a id='L41' name='L41'></a> 41 <em class='brace'>{</em> "SLA", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x5000, <a href='../S/2812.html#L448' title='Defined at 448 in src/exec.c.'>sla</a> <em class='brace'>}</em>, <a id='L42' name='L42'></a> 42 <em class='brace'>{</em> "SRA", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x5100, <a href='../S/2812.html#L477' title='Defined at 477 in src/exec.c.'>sra</a> <em class='brace'>}</em>, <a id='L43' name='L43'></a> 43 <em class='brace'>{</em> "SLL", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x5200, <a href='../S/2812.html#L509' title='Defined at 509 in src/exec.c.'>sll</a> <em class='brace'>}</em>, <a id='L44' name='L44'></a> 44 <em class='brace'>{</em> "SRL", <a href='../S/2417.html#L77' title='Defined at 77 in include/struct.h.'>R_ADR_X</a>, 0x5300, <a href='../S/2812.html#L535' title='Defined at 535 in src/exec.c.'>srl</a> <em class='brace'>}</em>, <a id='L45' name='L45'></a> 45 <em class='brace'>{</em> "JMI", <a href='../S/2417.html#L89' title='Defined at 89 in include/struct.h.'>ADR_X</a>, 0x6100, <a href='../S/2812.html#L571' title='Defined at 571 in src/exec.c.'>jmi</a> <em class='brace'>}</em>, <a id='L46' name='L46'></a> 46 <em class='brace'>{</em> "JNZ", <a href='../S/2417.html#L89' title='Defined at 89 in include/struct.h.'>ADR_X</a>, 0x6200, <a href='../S/2812.html#L581' title='Defined at 581 in src/exec.c.'>jnz</a> <em class='brace'>}</em>, <a id='L47' name='L47'></a> 47 <em class='brace'>{</em> "JZE", <a href='../S/2417.html#L89' title='Defined at 89 in include/struct.h.'>ADR_X</a>, 0x6300, <a href='../S/2812.html#L591' title='Defined at 591 in src/exec.c.'>jze</a> <em class='brace'>}</em>, <a id='L48' name='L48'></a> 48 <em class='brace'>{</em> "JUMP", <a href='../S/2417.html#L89' title='Defined at 89 in include/struct.h.'>ADR_X</a>, 0x6400, <a href='../S/2812.html#L611' title='Defined at 611 in src/exec.c.'>jump</a> <em class='brace'>}</em>, <a id='L49' name='L49'></a> 49 <em class='brace'>{</em> "JPL", <a href='../S/2417.html#L89' title='Defined at 89 in include/struct.h.'>ADR_X</a>, 0x6500, <a href='../S/2812.html#L561' title='Defined at 561 in src/exec.c.'>jpl</a> <em class='brace'>}</em>, <a id='L50' name='L50'></a> 50 <em class='brace'>{</em> "JOV", <a href='../S/2417.html#L89' title='Defined at 89 in include/struct.h.'>ADR_X</a>, 0x6600, <a href='../S/2812.html#L601' title='Defined at 601 in src/exec.c.'>jov</a> <em class='brace'>}</em>, <a id='L51' name='L51'></a> 51 <em class='brace'>{</em> "PUSH", <a href='../S/2417.html#L89' title='Defined at 89 in include/struct.h.'>ADR_X</a>, 0x7000, <a href='../S/2812.html#L617' title='Defined at 617 in src/exec.c.'>push</a> <em class='brace'>}</em>, <a id='L52' name='L52'></a> 52 <em class='brace'>{</em> "POP", <a href='../S/2417.html#L94' title='Defined at 94 in include/struct.h.'>R_</a>, 0x7100, <a href='../S/2812.html#L625' title='Defined at 625 in src/exec.c.'>pop</a> <em class='brace'>}</em>, <a id='L53' name='L53'></a> 53 <em class='brace'>{</em> "CALL", <a href='../S/2417.html#L89' title='Defined at 89 in include/struct.h.'>ADR_X</a>, 0x8000, <a href='../S/2812.html#L640' title='Defined at 640 in src/exec.c.'>call</a> <em class='brace'>}</em>, <a id='L54' name='L54'></a> 54 <em class='brace'>{</em> "SVC", <a href='../S/2417.html#L89' title='Defined at 89 in include/struct.h.'>ADR_X</a>, 0xF000, <a href='../S/2812.html#L658' title='Defined at 658 in src/exec.c.'>svc</a> <em class='brace'>}</em>, <a id='L55' name='L55'></a> 55 <em class='brace'>{</em> "RET", <a href='../S/2417.html#L98' title='Defined at 98 in include/struct.h.'>NONE</a>, 0x8100, <a href='../S/2812.html#L648' title='Defined at 648 in src/exec.c.'>ret</a> <em class='brace'>}</em>, <a id='L56' name='L56'></a> 56 <em class='brace'>}</em>; <a id='L57' name='L57'></a> 57 <a id='L58' name='L58'></a> 58 <em class='comment'>/**</em> <a id='L59' name='L59'></a> 59 <em class='comment'> * 命令表のサイズ</em> <a id='L60' name='L60'></a> 60 <em class='comment'> */</em> <a id='L61' name='L61'></a> 61 <strong class='reserved'>static</strong> <strong class='reserved'>int</strong> <a href='../Y/74.html' title='Multiple used in 2 places.'>comet2cmdsize</a> = <a href='../S/2424.html#L14' title='Defined at 14 in include/cmem.h.'>ARRAYSIZE</a>(<a href='../Y/73.html' title='Multiple used in 5 places.'>comet2cmd</a>); <a id='L62' name='L62'></a> 62 <a id='L63' name='L63'></a> 63 <em class='comment'>/**</em> <a id='L64' name='L64'></a> 64 <em class='comment'> * ハッシュ表のサイズ</em> <a id='L65' name='L65'></a> 65 <em class='comment'> */</em> <a id='L66' name='L66'></a> 66 <strong class='reserved'>enum</strong> <em class='brace'>{</em> <a id='L67' name='L67'></a> 67 <a href='../R/15.html' title='Multiple referred from 4 places.'>CMDTABSIZE</a> = 41, <a id='L68' name='L68'></a> 68 <em class='brace'>}</em>; <a id='L69' name='L69'></a> 69 <a id='L70' name='L70'></a> 70 <em class='comment'>/**</em> <a id='L71' name='L71'></a> 71 <em class='comment'> * ハッシュ表</em> <a id='L72' name='L72'></a> 72 <em class='comment'> */</em> <a id='L73' name='L73'></a> 73 <strong class='reserved'>static</strong> <a href='../S/2417.html#L125' title='Defined at 125 in include/struct.h.'>CMDTAB</a> *<a href='../Y/64.html' title='Multiple used in 9 places.'>cmdtab</a>[<a href='../S/2417.html#L63' title='Defined at 63 in include/struct.h.'>HASH_MAX</a>][<a href='../S/2856.html#L67' title='Defined at 67 in src/struct.c.'>CMDTABSIZE</a>] = <em class='brace'>{</em><em class='brace'>{</em><a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a><em class='brace'>}</em><em class='brace'>}</em>; <a id='L74' name='L74'></a> 74 <a id='L75' name='L75'></a> 75 <em class='comment'>/**</em> <a id='L76' name='L76'></a> 76 <em class='comment'> * 命令の名前とタイプからハッシュ値を生成する</em> <a id='L77' name='L77'></a> 77 <em class='comment'> */</em> <a id='L78' name='L78'></a> 78 <strong class='reserved'>unsigned</strong> <a href='../S/2856.html#L88' title='Defined at 88 in src/struct.c.'>hash_cmdtype</a>(<strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>, <a href='../S/2417.html#L99' title='Defined at 99 in include/struct.h.'>CMDTYPE</a> <a href='../Y/230.html' title='Multiple used in 26 places.'>type</a>); <a id='L79' name='L79'></a> 79 <a id='L80' name='L80'></a> 80 <em class='comment'>/**</em> <a id='L81' name='L81'></a> 81 <em class='comment'> * 命令コードからハッシュ値を生成する</em> <a id='L82' name='L82'></a> 82 <em class='comment'> */</em> <a id='L83' name='L83'></a> 83 <strong class='reserved'>unsigned</strong> <a href='../S/2856.html#L171' title='Defined at 171 in src/struct.c.'>hash_code</a>(<a href='../S/2425.html#L9' title='Defined at 9 in include/word.h.'>WORD</a> <a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>); <a id='L84' name='L84'></a> 84 <a id='L85' name='L85'></a> 85 <em class='comment'>/**</em> <a id='L86' name='L86'></a> 86 <em class='comment'> * 命令の名前とタイプからハッシュ値を生成する</em> <a id='L87' name='L87'></a> 87 <em class='comment'> */</em> <a id='L88' name='L88'></a> 88 <strong class='reserved'>unsigned</strong> <a href='../R/164.html' title='Multiple referred from 3 places.'>hash_cmdtype</a>(<strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>, <a href='../S/2417.html#L99' title='Defined at 99 in include/struct.h.'>CMDTYPE</a> <a href='../Y/230.html' title='Multiple used in 26 places.'>type</a>) <a id='L89' name='L89'></a> 89 <em class='brace'>{</em> <a id='L90' name='L90'></a> 90 <a href='../S/2426.html#L21' title='Defined at 21 in include/hash.h.'>HKEY</a> *<a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[2] = <em class='brace'>{</em><a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a><em class='brace'>}</em>; <a id='L91' name='L91'></a> 91 <strong class='reserved'>unsigned</strong> <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a> = 0; <a id='L92' name='L92'></a> 92 <a id='L93' name='L93'></a> 93 <em class='comment'>/* 命令名を設定 */</em> <a id='L94' name='L94'></a> 94 <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[0] = <a href='../S/2831.html#L3' title='Defined at 3 in src/cmem.c.'>malloc_chk</a>(<strong class='reserved'>sizeof</strong>(<a href='../S/2426.html#L21' title='Defined at 21 in include/hash.h.'>HKEY</a>), "hash_cmdtype.keys[0]"); <a id='L95' name='L95'></a> 95 <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[0]-><a href='../Y/230.html' title='Multiple used in 26 places.'>type</a> = <a href='../S/2426.html#L8' title='Defined at 8 in include/hash.h.'>CHARS</a>; <a id='L96' name='L96'></a> 96 <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[0]-><a href='../Y/232.html' title='Multiple used in 27 places.'>val</a>.<a href='../Y/188.html' title='Multiple used in 74 places.'>s</a> = <a href='../S/2831.html#L25' title='Defined at 25 in src/cmem.c.'>strdup_chk</a>(<a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>, "keys[0].val.s"); <a id='L97' name='L97'></a> 97 <em class='comment'>/* 命令タイプを設定 */</em> <a id='L98' name='L98'></a> 98 <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[1] = <a href='../S/2831.html#L3' title='Defined at 3 in src/cmem.c.'>malloc_chk</a>(<strong class='reserved'>sizeof</strong>(<a href='../S/2426.html#L21' title='Defined at 21 in include/hash.h.'>HKEY</a>), "hash_cmdtype.keys[1]"); <a id='L99' name='L99'></a> 99 <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[1]-><a href='../Y/230.html' title='Multiple used in 26 places.'>type</a> = <a href='../S/2426.html#L9' title='Defined at 9 in include/hash.h.'>INT</a>; <a id='L100' name='L100'></a> 100 <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[1]-><a href='../Y/232.html' title='Multiple used in 27 places.'>val</a>.<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> = (<strong class='reserved'>int</strong>)(<a href='../Y/230.html' title='Multiple used in 26 places.'>type</a> & 070); <a id='L101' name='L101'></a> 101 <em class='comment'>/* ハッシュ値の計算 */</em> <a id='L102' name='L102'></a> 102 <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a> = <a href='../S/2830.html#L3' title='Defined at 3 in src/hash.c.'>hash</a>(2, <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>, <a href='../S/2856.html#L67' title='Defined at 67 in src/struct.c.'>CMDTABSIZE</a>); <a id='L103' name='L103'></a> 103 <a href='../S/2424.html#L21' title='Defined at 21 in include/cmem.h.'>FREE</a>(<a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[0]-><a href='../Y/232.html' title='Multiple used in 27 places.'>val</a>.<a href='../Y/188.html' title='Multiple used in 74 places.'>s</a>); <a id='L104' name='L104'></a> 104 <a href='../S/2424.html#L21' title='Defined at 21 in include/cmem.h.'>FREE</a>(<a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[0]); <a id='L105' name='L105'></a> 105 <a href='../S/2424.html#L21' title='Defined at 21 in include/cmem.h.'>FREE</a>(<a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[1]); <a id='L106' name='L106'></a> 106 <em class='comment'>/* ハッシュ値を返す */</em> <a id='L107' name='L107'></a> 107 <strong class='reserved'>return</strong> <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a>; <a id='L108' name='L108'></a> 108 <em class='brace'>}</em> <a id='L109' name='L109'></a> 109 <a id='L110' name='L110'></a> 110 <em class='comment'>/**</em> <a id='L111' name='L111'></a> 111 <em class='comment'> * 命令ハッシュ表を作成する</em> <a id='L112' name='L112'></a> 112 <em class='comment'> */</em> <a id='L113' name='L113'></a> 113 <a href='../Y/25.html' title='Multiple used in 55 places.'>bool</a> <a href='../R/125.html' title='Multiple referred from 6 places.'>create_cmdtable</a>(<a href='../S/2417.html#L64' title='Defined at 64 in include/struct.h.'>CMDTAB_HASH</a> <a href='../S/2830.html#L3' title='Defined at 3 in src/hash.c.'>hash</a>) <a id='L114' name='L114'></a> 114 <em class='brace'>{</em> <a id='L115' name='L115'></a> 115 <a href='../S/2417.html#L125' title='Defined at 125 in include/struct.h.'>CMDTAB</a> *<a href='../Y/171.html' title='Multiple used in 127 places.'>p</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L116' name='L116'></a> 116 <strong class='reserved'>unsigned</strong> <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a>; <a id='L117' name='L117'></a> 117 <a id='L118' name='L118'></a> 118 <strong class='reserved'>for</strong>(<strong class='reserved'>int</strong> <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> = 0; <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> < <a href='../Y/74.html' title='Multiple used in 2 places.'>comet2cmdsize</a>; <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>++) <em class='brace'>{</em> <a id='L119' name='L119'></a> 119 <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a> = <a href='../S/2831.html#L3' title='Defined at 3 in src/cmem.c.'>malloc_chk</a>(<strong class='reserved'>sizeof</strong>(<a href='../S/2417.html#L125' title='Defined at 125 in include/struct.h.'>CMDTAB</a>), "create_cmdtable.p"); <a id='L120' name='L120'></a> 120 <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a>-><a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a> = &<a href='../Y/73.html' title='Multiple used in 5 places.'>comet2cmd</a>[<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>]; <a id='L121' name='L121'></a> 121 <strong class='reserved'>if</strong>(<a href='../S/2830.html#L3' title='Defined at 3 in src/hash.c.'>hash</a> == <a href='../S/2417.html#L61' title='Defined at 61 in include/struct.h.'>HASH_CMDTYPE</a>) <em class='brace'>{</em> <a id='L122' name='L122'></a> 122 <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a> = <a href='../S/2856.html#L88' title='Defined at 88 in src/struct.c.'>hash_cmdtype</a>(<a href='../Y/73.html' title='Multiple used in 5 places.'>comet2cmd</a>[<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>].<a href='../Y/153.html' title='Multiple used in 9 places.'>name</a>, <a href='../Y/73.html' title='Multiple used in 5 places.'>comet2cmd</a>[<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>].<a href='../Y/230.html' title='Multiple used in 26 places.'>type</a>); <a id='L123' name='L123'></a> 123 <em class='brace'>}</em> <strong class='reserved'>else</strong> <strong class='reserved'>if</strong>(<a href='../S/2830.html#L3' title='Defined at 3 in src/hash.c.'>hash</a> == <a href='../S/2417.html#L62' title='Defined at 62 in include/struct.h.'>HASH_CODE</a>) <em class='brace'>{</em> <a id='L124' name='L124'></a> 124 <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a> = <a href='../S/2856.html#L171' title='Defined at 171 in src/struct.c.'>hash_code</a>(<a href='../Y/73.html' title='Multiple used in 5 places.'>comet2cmd</a>[<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>].<a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>); <a id='L125' name='L125'></a> 125 <em class='brace'>}</em> <a id='L126' name='L126'></a> 126 <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a>-><a href='../Y/154.html' title='Multiple used in 30 places.'>next</a> = <a href='../Y/64.html' title='Multiple used in 9 places.'>cmdtab</a>[<a href='../S/2830.html#L3' title='Defined at 3 in src/hash.c.'>hash</a>][<a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a>]; <a id='L127' name='L127'></a> 127 <a href='../Y/64.html' title='Multiple used in 9 places.'>cmdtab</a>[<a href='../S/2830.html#L3' title='Defined at 3 in src/hash.c.'>hash</a>][<a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a>] = <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a>; <a id='L128' name='L128'></a> 128 <em class='brace'>}</em> <a id='L129' name='L129'></a> 129 <strong class='reserved'>return</strong> <a href='../Y/228.html' title='Multiple used in 79 places.'>true</a>; <a id='L130' name='L130'></a> 130 <em class='brace'>}</em> <a id='L131' name='L131'></a> 131 <a id='L132' name='L132'></a> 132 <em class='comment'>/**</em> <a id='L133' name='L133'></a> 133 <em class='comment'> * 命令ハッシュ表を解放する</em> <a id='L134' name='L134'></a> 134 <em class='comment'> */</em> <a id='L135' name='L135'></a> 135 <strong class='reserved'>void</strong> <a href='../R/138.html' title='Multiple referred from 9 places.'>free_cmdtable</a>(<a href='../S/2417.html#L64' title='Defined at 64 in include/struct.h.'>CMDTAB_HASH</a> <a href='../S/2830.html#L3' title='Defined at 3 in src/hash.c.'>hash</a>) <a id='L136' name='L136'></a> 136 <em class='brace'>{</em> <a id='L137' name='L137'></a> 137 <a href='../S/2417.html#L125' title='Defined at 125 in include/struct.h.'>CMDTAB</a> *<a href='../Y/171.html' title='Multiple used in 127 places.'>p</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L138' name='L138'></a> 138 <a href='../S/2417.html#L125' title='Defined at 125 in include/struct.h.'>CMDTAB</a> *<a href='../Y/181.html' title='Multiple used in 17 places.'>q</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L139' name='L139'></a> 139 <a id='L140' name='L140'></a> 140 <strong class='reserved'>for</strong>(<strong class='reserved'>int</strong> <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> = 0; <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> < <a href='../S/2856.html#L67' title='Defined at 67 in src/struct.c.'>CMDTABSIZE</a>; <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>++) <em class='brace'>{</em> <a id='L141' name='L141'></a> 141 <strong class='reserved'>for</strong>(<a href='../Y/171.html' title='Multiple used in 127 places.'>p</a> = <a href='../Y/64.html' title='Multiple used in 9 places.'>cmdtab</a>[<a href='../S/2830.html#L3' title='Defined at 3 in src/hash.c.'>hash</a>][<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>]; <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a> != <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a> = <a href='../Y/181.html' title='Multiple used in 17 places.'>q</a>) <em class='brace'>{</em> <a id='L142' name='L142'></a> 142 <a href='../Y/181.html' title='Multiple used in 17 places.'>q</a> = <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a>-><a href='../Y/154.html' title='Multiple used in 30 places.'>next</a>; <a id='L143' name='L143'></a> 143 <a href='../S/2424.html#L21' title='Defined at 21 in include/cmem.h.'>FREE</a>(<a href='../Y/171.html' title='Multiple used in 127 places.'>p</a>); <a id='L144' name='L144'></a> 144 <em class='brace'>}</em> <a id='L145' name='L145'></a> 145 <a href='../Y/64.html' title='Multiple used in 9 places.'>cmdtab</a>[<a href='../S/2830.html#L3' title='Defined at 3 in src/hash.c.'>hash</a>][<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>] = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L146' name='L146'></a> 146 <em class='brace'>}</em> <a id='L147' name='L147'></a> 147 <em class='brace'>}</em> <a id='L148' name='L148'></a> 148 <a id='L149' name='L149'></a> 149 <em class='comment'>/**</em> <a id='L150' name='L150'></a> 150 <em class='comment'> * 命令の名前とタイプから、命令コードを返す\n</em> <a id='L151' name='L151'></a> 151 <em class='comment'> * 無効な場合は0xFFFFを返す</em> <a id='L152' name='L152'></a> 152 <em class='comment'> */</em> <a id='L153' name='L153'></a> 153 <a href='../S/2425.html#L9' title='Defined at 9 in include/word.h.'>WORD</a> <a href='../R/152.html' title='Multiple referred from 7 places.'>getcmdcode</a>(<strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>, <a href='../S/2417.html#L99' title='Defined at 99 in include/struct.h.'>CMDTYPE</a> <a href='../Y/230.html' title='Multiple used in 26 places.'>type</a>) <a id='L154' name='L154'></a> 154 <em class='brace'>{</em> <a id='L155' name='L155'></a> 155 <a href='../S/2417.html#L125' title='Defined at 125 in include/struct.h.'>CMDTAB</a> *<a href='../Y/171.html' title='Multiple used in 127 places.'>p</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L156' name='L156'></a> 156 <a href='../S/2425.html#L9' title='Defined at 9 in include/word.h.'>WORD</a> <a href='../Y/235.html' title='Multiple used in 107 places.'>w</a> = 0xFFFF; <a id='L157' name='L157'></a> 157 <a id='L158' name='L158'></a> 158 <a href='../Y/20.html' title='Multiple used in 22 places.'>assert</a>(<a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a> != <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>); <a id='L159' name='L159'></a> 159 <strong class='reserved'>for</strong>(<a href='../Y/171.html' title='Multiple used in 127 places.'>p</a> = <a href='../Y/64.html' title='Multiple used in 9 places.'>cmdtab</a>[<a href='../S/2417.html#L61' title='Defined at 61 in include/struct.h.'>HASH_CMDTYPE</a>][<a href='../S/2856.html#L88' title='Defined at 88 in src/struct.c.'>hash_cmdtype</a>(<a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>, <a href='../Y/230.html' title='Multiple used in 26 places.'>type</a>)]; <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a> != <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a> = <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a>-><a href='../Y/154.html' title='Multiple used in 30 places.'>next</a>) <em class='brace'>{</em> <a id='L160' name='L160'></a> 160 <strong class='reserved'>if</strong>(<a href='../Y/207.html' title='Multiple used in 5 places.'>strcmp</a>(<a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>, <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a>-><a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>-><a href='../Y/153.html' title='Multiple used in 9 places.'>name</a>) == 0 && <a href='../Y/230.html' title='Multiple used in 26 places.'>type</a> == <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a>-><a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>-><a href='../Y/230.html' title='Multiple used in 26 places.'>type</a>) <em class='brace'>{</em> <a id='L161' name='L161'></a> 161 <a href='../Y/235.html' title='Multiple used in 107 places.'>w</a> = <a href='../Y/171.html' title='Multiple used in 127 places.'>p</a>-><a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>-><a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>; <a id='L162' name='L162'></a> 162 <strong class='reserved'>break</strong>; <a id='L163' name='L163'></a> 163 <em class='brace'>}</em> <a id='L164' name='L164'></a> 164 <em class='brace'>}</em> <a id='L165' name='L165'></a> 165 <strong class='reserved'>return</strong> <a href='../Y/235.html' title='Multiple used in 107 places.'>w</a>; <a id='L166' name='L166'></a> 166 <em class='brace'>}</em> <a id='L167' name='L167'></a> 167 <a id='L168' name='L168'></a> 168 <em class='comment'>/**</em> <a id='L169' name='L169'></a> 169 <em class='comment'> * 命令コードからハッシュ値を生成する</em> <a id='L170' name='L170'></a> 170 <em class='comment'> */</em> <a id='L171' name='L171'></a> 171 <strong class='reserved'>unsigned</strong> <a href='../R/165.html' title='Multiple referred from 5 places.'>hash_code</a>(<a href='../S/2425.html#L9' title='Defined at 9 in include/word.h.'>WORD</a> <a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>) <a id='L172' name='L172'></a> 172 <em class='brace'>{</em> <a id='L173' name='L173'></a> 173 <a href='../S/2426.html#L21' title='Defined at 21 in include/hash.h.'>HKEY</a> *<a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[1] = <em class='brace'>{</em><a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a><em class='brace'>}</em>; <a id='L174' name='L174'></a> 174 <strong class='reserved'>unsigned</strong> <a href='../Y/114.html' title='Multiple used in 19 places.'>h</a> = 0; <a id='L175' name='L175'></a> 175 <a id='L176' name='L176'></a> 176 <em class='comment'>/* 命令コードを設定 */</em> <a id='L177' name='L177'></a> 177 <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[0] = <a href='../S/2831.html#L3' title='Defined at 3 in src/cmem.c.'>malloc_chk</a>(<strong class='reserved'>sizeof</strong>(<a href='../S/2426.html#L21' title='Defined at 21 in include/hash.h.'>HKEY</a>), "hash_code.key"); <a id='L178' name='L178'></a> 178 <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[0]-><a href='../Y/230.html' title='Multiple used in 26 places.'>type</a> = <a href='../S/2426.html#L9' title='Defined at 9 in include/hash.h.'>INT</a>; <a id='L179' name='L179'></a> 179 <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[0]-><a href='../Y/232.html' title='Multiple used in 27 places.'>val</a>.<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> = (<strong class='reserved'>int</strong>)(<a href='../Y/70.html' title='Multiple used in 25 places.'>code</a> >> 8); <a id='L180' name='L180'></a> 180 <a href='../Y/114.html' title='Multiple used in 19 places.'>h</a> = <a href='../S/2830.html#L3' title='Defined at 3 in src/hash.c.'>hash</a>(1, <a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>, <a href='../S/2856.html#L67' title='Defined at 67 in src/struct.c.'>CMDTABSIZE</a>); <a id='L181' name='L181'></a> 181 <a href='../S/2424.html#L21' title='Defined at 21 in include/cmem.h.'>FREE</a>(<a href='../Y/124.html' title='Multiple used in 41 places.'>keys</a>[0]); <a id='L182' name='L182'></a> 182 <strong class='reserved'>return</strong> <a href='../Y/114.html' title='Multiple used in 19 places.'>h</a>; <a id='L183' name='L183'></a> 183 <em class='brace'>}</em> <a id='L184' name='L184'></a> 184 <a id='L185' name='L185'></a> 185 <em class='comment'>/**</em> <a id='L186' name='L186'></a> 186 <em class='comment'> * 命令コードから命令の関数ポインタを返す</em> <a id='L187' name='L187'></a> 187 <em class='comment'> */</em> <a id='L188' name='L188'></a> 188 <strong class='reserved'>const</strong> <strong class='reserved'>void</strong> (*<a href='../R/154.html' title='Multiple referred from 2 places.'>getcmdptr</a>(<a href='../S/2425.html#L9' title='Defined at 9 in include/word.h.'>WORD</a> <a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>)) <a id='L189' name='L189'></a> 189 <em class='brace'>{</em> <a id='L190' name='L190'></a> 190 <a href='../S/2417.html#L125' title='Defined at 125 in include/struct.h.'>CMDTAB</a> *<a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L191' name='L191'></a> 191 <strong class='reserved'>const</strong> <strong class='reserved'>void</strong> *<a href='../Y/178.html' title='Multiple used in 24 places.'>ptr</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L192' name='L192'></a> 192 <a id='L193' name='L193'></a> 193 <strong class='reserved'>for</strong>(<a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> = <a href='../Y/64.html' title='Multiple used in 9 places.'>cmdtab</a>[<a href='../S/2417.html#L62' title='Defined at 62 in include/struct.h.'>HASH_CODE</a>][<a href='../S/2856.html#L171' title='Defined at 171 in src/struct.c.'>hash_code</a>(<a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>)]; <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> != <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> = <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a>-><a href='../Y/154.html' title='Multiple used in 30 places.'>next</a>) <em class='brace'>{</em> <a id='L194' name='L194'></a> 194 <strong class='reserved'>if</strong>(<a href='../Y/70.html' title='Multiple used in 25 places.'>code</a> == <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a>-><a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>-><a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>) <em class='brace'>{</em> <a id='L195' name='L195'></a> 195 <a href='../Y/178.html' title='Multiple used in 24 places.'>ptr</a> = <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a>-><a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>-><a href='../Y/178.html' title='Multiple used in 24 places.'>ptr</a>; <a id='L196' name='L196'></a> 196 <strong class='reserved'>break</strong>; <a id='L197' name='L197'></a> 197 <em class='brace'>}</em> <a id='L198' name='L198'></a> 198 <em class='brace'>}</em> <a id='L199' name='L199'></a> 199 <strong class='reserved'>return</strong> <a href='../Y/178.html' title='Multiple used in 24 places.'>ptr</a>; <a id='L200' name='L200'></a> 200 <em class='brace'>}</em> <a id='L201' name='L201'></a> 201 <a id='L202' name='L202'></a> 202 <em class='comment'>/**</em> <a id='L203' name='L203'></a> 203 <em class='comment'> * 命令コードから命令のタイプを返す</em> <a id='L204' name='L204'></a> 204 <em class='comment'> */</em> <a id='L205' name='L205'></a> 205 <a href='../S/2417.html#L99' title='Defined at 99 in include/struct.h.'>CMDTYPE</a> <a href='../R/155.html' title='Multiple referred from 3 places.'>getcmdtype</a>(<a href='../S/2425.html#L9' title='Defined at 9 in include/word.h.'>WORD</a> <a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>) <a id='L206' name='L206'></a> 206 <em class='brace'>{</em> <a id='L207' name='L207'></a> 207 <a href='../S/2417.html#L125' title='Defined at 125 in include/struct.h.'>CMDTAB</a> *<a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L208' name='L208'></a> 208 <a href='../S/2417.html#L99' title='Defined at 99 in include/struct.h.'>CMDTYPE</a> <a href='../Y/230.html' title='Multiple used in 26 places.'>type</a> = <a href='../S/2417.html#L98' title='Defined at 98 in include/struct.h.'>NONE</a>; <a id='L209' name='L209'></a> 209 <a id='L210' name='L210'></a> 210 <strong class='reserved'>for</strong>(<a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> = <a href='../Y/64.html' title='Multiple used in 9 places.'>cmdtab</a>[<a href='../S/2417.html#L62' title='Defined at 62 in include/struct.h.'>HASH_CODE</a>][<a href='../S/2856.html#L171' title='Defined at 171 in src/struct.c.'>hash_code</a>(<a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>)]; <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> != <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> = <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a>-><a href='../Y/154.html' title='Multiple used in 30 places.'>next</a>) <em class='brace'>{</em> <a id='L211' name='L211'></a> 211 <strong class='reserved'>if</strong>(<a href='../Y/70.html' title='Multiple used in 25 places.'>code</a> == <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a>-><a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>-><a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>) <em class='brace'>{</em> <a id='L212' name='L212'></a> 212 <a href='../Y/230.html' title='Multiple used in 26 places.'>type</a> = <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a>-><a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>-><a href='../Y/230.html' title='Multiple used in 26 places.'>type</a>; <a id='L213' name='L213'></a> 213 <strong class='reserved'>break</strong>; <a id='L214' name='L214'></a> 214 <em class='brace'>}</em> <a id='L215' name='L215'></a> 215 <em class='brace'>}</em> <a id='L216' name='L216'></a> 216 <strong class='reserved'>return</strong> <a href='../Y/230.html' title='Multiple used in 26 places.'>type</a>; <a id='L217' name='L217'></a> 217 <em class='brace'>}</em> <a id='L218' name='L218'></a> 218 <a id='L219' name='L219'></a> 219 <em class='comment'>/**</em> <a id='L220' name='L220'></a> 220 <em class='comment'> * 命令コードから命令の名前を返す</em> <a id='L221' name='L221'></a> 221 <em class='comment'> */</em> <a id='L222' name='L222'></a> 222 <strong class='reserved'>char</strong> *<a href='../R/153.html' title='Multiple referred from 3 places.'>getcmdname</a>(<a href='../S/2425.html#L9' title='Defined at 9 in include/word.h.'>WORD</a> <a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>) <a id='L223' name='L223'></a> 223 <em class='brace'>{</em> <a id='L224' name='L224'></a> 224 <a href='../S/2417.html#L125' title='Defined at 125 in include/struct.h.'>CMDTAB</a> *<a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L225' name='L225'></a> 225 <strong class='reserved'>char</strong> *<a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L226' name='L226'></a> 226 <a id='L227' name='L227'></a> 227 <strong class='reserved'>for</strong>(<a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> = <a href='../Y/64.html' title='Multiple used in 9 places.'>cmdtab</a>[<a href='../S/2417.html#L62' title='Defined at 62 in include/struct.h.'>HASH_CODE</a>][<a href='../S/2856.html#L171' title='Defined at 171 in src/struct.c.'>hash_code</a>(<a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>)]; <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> != <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a> = <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a>-><a href='../Y/154.html' title='Multiple used in 30 places.'>next</a>) <em class='brace'>{</em> <a id='L228' name='L228'></a> 228 <strong class='reserved'>if</strong>(<a href='../Y/70.html' title='Multiple used in 25 places.'>code</a> == <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a>-><a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>-><a href='../Y/70.html' title='Multiple used in 25 places.'>code</a>) <em class='brace'>{</em> <a id='L229' name='L229'></a> 229 <a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a> = <a href='../Y/218.html' title='Multiple used in 30 places.'>t</a>-><a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>-><a href='../Y/153.html' title='Multiple used in 9 places.'>name</a>; <a id='L230' name='L230'></a> 230 <strong class='reserved'>break</strong>; <a id='L231' name='L231'></a> 231 <em class='brace'>}</em> <a id='L232' name='L232'></a> 232 <em class='brace'>}</em> <a id='L233' name='L233'></a> 233 <strong class='reserved'>return</strong> <a href='../Y/59.html' title='Multiple used in 86 places.'>cmd</a>; <a id='L234' name='L234'></a> 234 <em class='brace'>}</em> <a id='L235' name='L235'></a> 235 <a id='L236' name='L236'></a> 236 <em class='comment'>/**</em> <a id='L237' name='L237'></a> 237 <em class='comment'> * 汎用レジスタの番号からレジスタを表す文字列を返す</em> <a id='L238' name='L238'></a> 238 <em class='comment'> */</em> <a id='L239' name='L239'></a> 239 <a id='L240' name='L240'></a> 240 <strong class='reserved'>char</strong> *<a href='../R/158.html' title='Multiple referred from 6 places.'>grstr</a>(<a href='../S/2425.html#L9' title='Defined at 9 in include/word.h.'>WORD</a> <a href='../Y/237.html' title='Multiple used in 54 places.'>word</a>) <a id='L241' name='L241'></a> 241 <em class='brace'>{</em> <a id='L242' name='L242'></a> 242 <a href='../Y/20.html' title='Multiple used in 22 places.'>assert</a>(<a href='../Y/237.html' title='Multiple used in 54 places.'>word</a> <= 7); <a id='L243' name='L243'></a> 243 <strong class='reserved'>char</strong> *<a href='../Y/203.html' title='Multiple used in 103 places.'>str</a> = <a href='../Y/3.html' title='Multiple used in 191 places.'>NULL</a>; <a id='L244' name='L244'></a> 244 <a id='L245' name='L245'></a> 245 <a href='../Y/203.html' title='Multiple used in 103 places.'>str</a> = <a href='../S/2831.html#L3' title='Defined at 3 in src/cmem.c.'>malloc_chk</a>(3 + 1, "grstr.str"); <a id='L246' name='L246'></a> 246 <a href='../Y/194.html' title='Multiple used in 9 places.'>sprintf</a>(<a href='../Y/203.html' title='Multiple used in 103 places.'>str</a>, "GR%d", <a href='../Y/237.html' title='Multiple used in 54 places.'>word</a>); <a id='L247' name='L247'></a> 247 <strong class='reserved'>return</strong> <a href='../Y/203.html' title='Multiple used in 103 places.'>str</a>; <a id='L248' name='L248'></a> 248 <em class='brace'>}</em> <a id='L249' name='L249'></a> 249 <a id='L250' name='L250'></a> 250 <em class='comment'>/**</em> <a id='L251' name='L251'></a> 251 <em class='comment'> * COMET II仮想マシンのリセット</em> <a id='L252' name='L252'></a> 252 <em class='comment'> */</em> <a id='L253' name='L253'></a> 253 <strong class='reserved'>void</strong> <a href='../R/204.html' title='Multiple referred from 5 places.'>reset</a>(<strong class='reserved'>int</strong> <a href='../Y/146.html' title='Multiple used in 30 places.'>memsize</a>, <strong class='reserved'>int</strong> <a href='../Y/58.html' title='Multiple used in 15 places.'>clocks</a>) <a id='L254' name='L254'></a> 254 <em class='brace'>{</em> <a id='L255' name='L255'></a> 255 <a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a> = <a href='../S/2831.html#L3' title='Defined at 3 in src/cmem.c.'>malloc_chk</a>(<strong class='reserved'>sizeof</strong>(<a href='../S/2417.html#L50' title='Defined at 50 in include/struct.h.'>SYSTEM</a>), "sys"); <a id='L256' name='L256'></a> 256 <em class='comment'>/* メモリサイズを設定 */</em> <a id='L257' name='L257'></a> 257 <a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/146.html' title='Multiple used in 30 places.'>memsize</a> = <a href='../Y/146.html' title='Multiple used in 30 places.'>memsize</a>; <a id='L258' name='L258'></a> 258 <em class='comment'>/* クロック周波数を設定 */</em> <a id='L259' name='L259'></a> 259 <a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/58.html' title='Multiple used in 15 places.'>clocks</a> = <a href='../Y/58.html' title='Multiple used in 15 places.'>clocks</a>; <a id='L260' name='L260'></a> 260 <em class='comment'>/* メモリを初期化 */</em> <a id='L261' name='L261'></a> 261 <a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/144.html' title='Multiple used in 60 places.'>memory</a> = <a href='../S/2831.html#L14' title='Defined at 14 in src/cmem.c.'>calloc_chk</a>(<a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/146.html' title='Multiple used in 30 places.'>memsize</a>, <strong class='reserved'>sizeof</strong>(<a href='../S/2425.html#L9' title='Defined at 9 in include/word.h.'>WORD</a>), "memory"); <a id='L262' name='L262'></a> 262 <em class='comment'>/* CPUを初期化 */</em> <a id='L263' name='L263'></a> 263 <a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/77.html' title='Multiple used in 218 places.'>cpu</a> = <a href='../S/2831.html#L3' title='Defined at 3 in src/cmem.c.'>malloc_chk</a>(<strong class='reserved'>sizeof</strong>(<a href='../S/2417.html#L40' title='Defined at 40 in include/struct.h.'>CPU</a>), "cpu"); <a id='L264' name='L264'></a> 264 <strong class='reserved'>for</strong>(<strong class='reserved'>int</strong> <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> = 0; <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> < <a href='../S/2417.html#L18' title='Defined at 18 in include/struct.h.'>GRSIZE</a>; <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>++) <em class='brace'>{</em> <em class='comment'>/* 汎用レジスタ */</em> <a id='L265' name='L265'></a> 265 <a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/77.html' title='Multiple used in 218 places.'>cpu</a>-><a href='../Y/113.html' title='Multiple used in 59 places.'>gr</a>[<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>] = 0x0; <a id='L266' name='L266'></a> 266 <em class='brace'>}</em> <a id='L267' name='L267'></a> 267 <a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/77.html' title='Multiple used in 218 places.'>cpu</a>-><a href='../Y/193.html' title='Multiple used in 17 places.'>sp</a> = <a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/146.html' title='Multiple used in 30 places.'>memsize</a>; <em class='comment'>/* スタックポインタ */</em> <a id='L268' name='L268'></a> 268 <a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/77.html' title='Multiple used in 218 places.'>cpu</a>-><a href='../Y/174.html' title='Multiple used in 110 places.'>pr</a> = 0x0; <em class='comment'>/* プログラムレジスタ */</em> <a id='L269' name='L269'></a> 269 <a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/77.html' title='Multiple used in 218 places.'>cpu</a>-><a href='../Y/103.html' title='Multiple used in 44 places.'>fr</a> = 0x0; <em class='comment'>/* フラグレジスタ */</em> <a id='L270' name='L270'></a> 270 <em class='comment'>/* CASL2プログラムの開始と終了のアドレスを初期化 */</em> <a id='L271' name='L271'></a> 271 <a href='../Y/89.html' title='Multiple used in 25 places.'>execptr</a> = <a href='../S/2831.html#L3' title='Defined at 3 in src/cmem.c.'>malloc_chk</a>(<strong class='reserved'>sizeof</strong>(<a href='../S/2417.html#L134' title='Defined at 134 in include/struct.h.'>EXECPTR</a>), "execptr"); <a id='L272' name='L272'></a> 272 <a href='../Y/89.html' title='Multiple used in 25 places.'>execptr</a>-><a href='../Y/202.html' title='Multiple used in 5 places.'>stop</a> = <a href='../Y/92.html' title='Multiple used in 52 places.'>false</a>; <a id='L273' name='L273'></a> 273 <em class='brace'>}</em> <a id='L274' name='L274'></a> 274 <a id='L275' name='L275'></a> 275 <em class='comment'>/**</em> <a id='L276' name='L276'></a> 276 <em class='comment'> * COMET II仮想マシンのシャットダウン</em> <a id='L277' name='L277'></a> 277 <em class='comment'> */</em> <a id='L278' name='L278'></a> 278 <strong class='reserved'>void</strong> <a href='../R/208.html' title='Multiple referred from 7 places.'>shutdown</a>() <a id='L279' name='L279'></a> 279 <em class='brace'>{</em> <a id='L280' name='L280'></a> 280 <a href='../S/2424.html#L21' title='Defined at 21 in include/cmem.h.'>FREE</a>(<a href='../Y/89.html' title='Multiple used in 25 places.'>execptr</a>); <a id='L281' name='L281'></a> 281 <a href='../S/2424.html#L21' title='Defined at 21 in include/cmem.h.'>FREE</a>(<a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/144.html' title='Multiple used in 60 places.'>memory</a>); <a id='L282' name='L282'></a> 282 <a href='../S/2424.html#L21' title='Defined at 21 in include/cmem.h.'>FREE</a>(<a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>-><a href='../Y/77.html' title='Multiple used in 218 places.'>cpu</a>); <a id='L283' name='L283'></a> 283 <a href='../S/2424.html#L21' title='Defined at 21 in include/cmem.h.'>FREE</a>(<a href='../Y/217.html' title='Multiple used in 243 places.'>sys</a>); <a id='L284' name='L284'></a> 284 <em class='brace'>}</em> </pre> <hr /> <a id='BOTTOM' name='BOTTOM'></a> <em class='comment'>/* [<][>]<a href='#L88'>[^]</a><a href='#L278'>[v]</a><a href='#TOP'>[top]</a>[bottom]<a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</em> </body> </html>