
qsys_tutorial_lcd.elf:     file format elf32-littlenios2
qsys_tutorial_lcd.elf
architecture: nios2, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00000020

Program Header:
    LOAD off    0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x00000020 memsz 0x00000020 flags r-x
    LOAD off    0x00001020 vaddr 0x00000020 paddr 0x00000020 align 2**12
         filesz 0x00001fec memsz 0x00001fec flags r-x
    LOAD off    0x0000300c vaddr 0x0000200c paddr 0x000020fc align 2**12
         filesz 0x000000f0 memsz 0x000000f0 flags rw-
    LOAD off    0x000031ec vaddr 0x000021ec paddr 0x000021ec align 2**12
         filesz 0x00000000 memsz 0x00000174 flags rw-

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .entry        00000020  00000000  00000000  00001000  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .text         00001d1c  00000020  00000020  00001020  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .rodata       000002d0  00001d3c  00001d3c  00002d3c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .rwdata       000000f0  0000200c  000020fc  0000300c  2**2
                  CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
  4 .bss          00000174  000021ec  000021ec  000031ec  2**2
                  ALLOC, SMALL_DATA
  5 .comment      00000026  00000000  00000000  000030fc  2**0
                  CONTENTS, READONLY
  6 .debug_aranges 000002c8  00000000  00000000  00003128  2**3
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_pubnames 000005b9  00000000  00000000  000033f0  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_info   000039d5  00000000  00000000  000039a9  2**0
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_abbrev 000013f4  00000000  00000000  0000737e  2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_line   0000374c  00000000  00000000  00008772  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_frame  000005ec  00000000  00000000  0000bec0  2**2
                  CONTENTS, READONLY, DEBUGGING
 12 .debug_str    00001151  00000000  00000000  0000c4ac  2**0
                  CONTENTS, READONLY, DEBUGGING
 13 .debug_loc    00001783  00000000  00000000  0000d5fd  2**0
                  CONTENTS, READONLY, DEBUGGING
 14 .debug_alt_sim_info 00000010  00000000  00000000  0000ed80  2**2
                  CONTENTS, READONLY, DEBUGGING
 15 .debug_ranges 00000190  00000000  00000000  0000ed90  2**3
                  CONTENTS, READONLY, DEBUGGING
 16 .thread_model 00000003  00000000  00000000  000103ea  2**0
                  CONTENTS, READONLY
 17 .cpu          0000000f  00000000  00000000  000103ed  2**0
                  CONTENTS, READONLY
 18 .qsys         00000001  00000000  00000000  000103fc  2**0
                  CONTENTS, READONLY
 19 .simulation_enabled 00000001  00000000  00000000  000103fd  2**0
                  CONTENTS, READONLY
 20 .stderr_dev   00000009  00000000  00000000  000103fe  2**0
                  CONTENTS, READONLY
 21 .stdin_dev    00000009  00000000  00000000  00010407  2**0
                  CONTENTS, READONLY
 22 .stdout_dev   00000009  00000000  00000000  00010410  2**0
                  CONTENTS, READONLY
 23 .sopc_system_name 0000000b  00000000  00000000  00010419  2**0
                  CONTENTS, READONLY
 24 .quartus_project_dir 00000030  00000000  00000000  00010424  2**0
                  CONTENTS, READONLY
 25 .sopcinfo     00084495  00000000  00000000  00010454  2**0
                  CONTENTS, READONLY
SYMBOL TABLE:
00000000 l    d  .entry	00000000 .entry
00000020 l    d  .text	00000000 .text
00001d3c l    d  .rodata	00000000 .rodata
0000200c l    d  .rwdata	00000000 .rwdata
000021ec l    d  .bss	00000000 .bss
00000000 l    d  .comment	00000000 .comment
00000000 l    d  .debug_aranges	00000000 .debug_aranges
00000000 l    d  .debug_pubnames	00000000 .debug_pubnames
00000000 l    d  .debug_info	00000000 .debug_info
00000000 l    d  .debug_abbrev	00000000 .debug_abbrev
00000000 l    d  .debug_line	00000000 .debug_line
00000000 l    d  .debug_frame	00000000 .debug_frame
00000000 l    d  .debug_str	00000000 .debug_str
00000000 l    d  .debug_loc	00000000 .debug_loc
00000000 l    d  .debug_alt_sim_info	00000000 .debug_alt_sim_info
00000000 l    d  .debug_ranges	00000000 .debug_ranges
00000058 l       .text	00000000 alt_after_alt_main
00000000 l    df *ABS*	00000000 hello_world_small.c
00000000 l    df *ABS*	00000000 hex_encoder.c
00000000 l    df *ABS*	00000000 hex_out.c
00000000 l    df *ABS*	00000000 input_int.c
000021fc l     O .bss	00000001 status.1396
000021f8 l     O .bss	00000004 event_code.1397
00000000 l    df *ABS*	00000000 inst_decoder.c
00000000 l    df *ABS*	00000000 sys_memory.c
00002210 l     O .bss	00000040 memory
00002250 l     O .bss	00000100 inst_memory
00000000 l    df *ABS*	00000000 sys_register.c
00000000 l    df *ABS*	00000000 system.c
00000000 l    df *ABS*	00000000 lib2-divmod.c
00001160 l     F .text	0000007c udivmodsi4
00000000 l    df *ABS*	00000000 lib2-mul.c
00000000 l    df *ABS*	00000000 ctype_.c
00001e89 l     O .rodata	00000180 _ctype_b
00000000 l    df *ABS*	00000000 sprintf.c
00000000 l    df *ABS*	00000000 vfprintf.c
000013d8 l     F .text	00000080 print_repeat
00000000 l    df *ABS*	00000000 fvwrite_small_str.c
00000000 l    df *ABS*	00000000 impure.c
0000200c l     O .rwdata	000000e0 impure_data
00000000 l    df *ABS*	00000000 memmove.c
00000000 l    df *ABS*	00000000 strlen.c
00000000 l    df *ABS*	00000000 alt_load.c
00001c50 l     F .text	00000020 alt_load_section
00000000 l    df *ABS*	00000000 alt_main.c
00000000 l    df *ABS*	00000000 alt_sys_init.c
00000000 l    df *ABS*	00000000 alt_dcache_flush_all.c
00000000 l    df *ABS*	00000000 alt_icache_flush_all.c
00000000 l    df *ABS*	00000000 altera_nios2_qsys_irq.c
00000cf4 g     F .text	00000010 inst_load
00001cdc g     F .text	0000002c alt_main
000020fc g       *ABS*	00000000 __flash_rwdata_start
000008f8 g     F .text	00000050 clear_block
000002a0 g     F .text	000000a4 store_value
00000be4 g     F .text	00000020 inst_add
00000cb8 g     F .text	0000002c inst_jine
00001bd0 g     F .text	00000060 memmove
000020f8 g     O .rwdata	00000004 jtag_uart
00001b18 g     F .text	000000b8 __sfvwrite_small_str
00000000 g     F .entry	0000000c __reset
00000020 g       *ABS*	00000000 __flash_exceptions_start
00002208 g     O .bss	00000004 alt_argv
0000a0ec g       *ABS*	00000000 _gp
00000bc4 g     F .text	0000001c inst_jump
00000130 g     F .text	000000a0 run_proc
0000129c g     F .text	00000008 __udivsi3
00000c8c g     F .text	0000002c inst_jieq
00000d04 g     F .text	0000004c inst_output
000010a8 g     F .text	00000070 memory_store
000020f4 g     O .rwdata	00000004 _global_impure_ptr
00002360 g       *ABS*	00000000 __bss_end
000021ec g     O .bss	00000005 stack
000020ec g     O .rwdata	00000004 __ctype_ptr
00000d50 g     F .text	00000038 inst_fetch
00001d2c g     F .text	00000004 alt_dcache_flush_all
00002350 g     O .bss	0000000f global_registers
00000c3c g     F .text	00000028 inst_jeq
000020fc g       *ABS*	00000000 __ram_rwdata_end
00000000 g       *ABS*	00000000 __alt_mem_onchip_memory
0000200c g       *ABS*	00000000 __ram_rodata_end
000012a4 g     F .text	00000008 __umodsi3
00002360 g       *ABS*	00000000 end
00004000 g       *ABS*	00000000 __alt_stack_pointer
00001458 g     F .text	0000069c ___vfprintf_internal_r
00001368 g     F .text	00000070 _sprintf_r
0000005c g     F .text	0000003c wait
00000948 g     F .text	000000fc print_number
00000020 g     F .text	0000003c _start
0000081c g     F .text	000000dc print_block
00001d08 g     F .text	00000004 alt_sys_init
000012ac g     F .text	00000038 __mulsi3
0000200c g       *ABS*	00000000 __ram_rwdata_start
00001d3c g       *ABS*	00000000 __ram_rodata_start
00001134 g     F .text	0000002c panic
00002360 g       *ABS*	00000000 __alt_stack_base
00000be0 g     F .text	00000004 inst_delay
00000ce4 g     F .text	00000010 inst_store
00000344 g     F .text	000000a4 init
000021ec g       *ABS*	00000000 __bss_start
000003e8 g     F .text	0000007c main
0000220c g     O .bss	00000004 alt_envp
00000464 g     F .text	00000124 encodeNumHex
00000bc0 g     F .text	00000004 in_int
000011dc g     F .text	00000060 __divsi3
00001d3c g       *ABS*	00000000 __flash_rodata_start
00001d0c g     F .text	00000020 alt_irq_init
000012e4 g     F .text	00000084 sprintf
00000098 g     F .text	00000098 print_change_memory
00000a84 g     F .text	0000013c push_int
000020f0 g     O .rwdata	00000004 _impure_ptr
00002204 g     O .bss	00000004 alt_argc
00002200 g     O .bss	00000004 global_current_memory
00000020 g       *ABS*	00000000 __ram_exceptions_start
00000588 g     F .text	00000294 encodeLatHex
000020fc g       *ABS*	00000000 _edata
00002360 g       *ABS*	00000000 _end
00000020 g       *ABS*	00000000 __ram_exceptions_end
00000ef8 g     F .text	00000044 memory_init
00001d34 g     F .text	00000008 altera_nios2_qsys_irq_init
0000000c g       .entry	00000000 exit
00001038 g     F .text	00000070 memory_load
0000123c g     F .text	00000060 __modsi3
00004000 g       *ABS*	00000000 __alt_data_end
00000d88 g     F .text	00000170 inst_decode
00001d88 g     O .rodata	00000101 _ctype_
00000c04 g     F .text	00000038 inst_comp
00001118 g     F .text	0000001c registers_init
0000000c g       .entry	00000000 _exit
00000c64 g     F .text	00000028 inst_jne
00001c30 g     F .text	00000020 strlen
000001d0 g     F .text	000000d0 store_inst
00001d30 g     F .text	00000004 alt_icache_flush_all
00001af4 g     F .text	00000024 __vfprintf_internal
00000f3c g     F .text	00000080 inst_memory_store
00000a44 g     F .text	00000040 push_decode
00001c70 g     F .text	0000006c alt_load
000021f4 g     O .bss	00000001 PUSH_EVENT
00000fbc g     F .text	0000007c inst_memory_load



Disassembly of section .entry:

00000000 <__reset>:
 * Jump to the _start entry point in the .text section if reset code
 * is allowed or if optimizing for RTL simulation.
 */
#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE)
    /* Jump to the _start entry point in the .text section. */
    movhi r1, %hi(_start)
   0:	00400034 	movhi	at,0
    ori r1, r1, %lo(_start)
   4:	08400814 	ori	at,at,32
    jmp r1
   8:	0800683a 	jmp	at

0000000c <_exit>:
	...

Disassembly of section .text:

00000020 <_start>:
#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0)    
    /*
     * Now that the caches are initialized, set up the stack pointer.
     * The value provided by the linker is assumed to be correctly aligned.
     */
    movhi sp, %hi(__alt_stack_pointer)
      20:	06c00034 	movhi	sp,0
    ori sp, sp, %lo(__alt_stack_pointer)
      24:	ded00014 	ori	sp,sp,16384

    /* Set up the global pointer. */
    movhi gp, %hi(_gp)
      28:	06800034 	movhi	gp,0
    ori gp, gp, %lo(_gp)
      2c:	d6a83b14 	ori	gp,gp,41196
 */
#ifndef ALT_SIM_OPTIMIZE
    /* Log that the BSS is about to be cleared. */
    ALT_LOG_PUTS(alt_log_msg_bss)

    movhi r2, %hi(__bss_start)
      30:	00800034 	movhi	r2,0
    ori r2, r2, %lo(__bss_start)
      34:	10887b14 	ori	r2,r2,8684

    movhi r3, %hi(__bss_end)
      38:	00c00034 	movhi	r3,0
    ori r3, r3, %lo(__bss_end)
      3c:	18c8d814 	ori	r3,r3,9056

    beq r2, r3, 1f
      40:	10c00326 	beq	r2,r3,50 <_start+0x30>

0:
    stw zero, (r2)
      44:	10000015 	stw	zero,0(r2)
    addi r2, r2, 4
      48:	10800104 	addi	r2,r2,4
    bltu r2, r3, 0b
      4c:	10fffd36 	bltu	r2,r3,44 <_start+0x24>
     * section aren't defined until alt_load() has been called).
     */
    mov   et, zero
#endif

    call alt_load
      50:	0001c700 	call	1c70 <alt_load>

    /* Log that alt_main is about to be called. */
    ALT_LOG_PUTS(alt_log_msg_alt_main)

    /* Call the C entry point. It should never return. */
    call alt_main
      54:	0001cdc0 	call	1cdc <alt_main>

00000058 <alt_after_alt_main>:

    /* Wait in infinite loop in case alt_main does return. */
alt_after_alt_main:
    br alt_after_alt_main
      58:	003fff06 	br	58 <alt_after_alt_main>

0000005c <wait>:

#define ledrs (volatile int *) 0x00050a0

#define T_MS10 12500 //(10ms)

void wait(unsigned int s) {
      5c:	defffe04 	addi	sp,sp,-8
	volatile i;
	for (i = 0; i < T_MS10*s; i++);
      60:	014c3504 	movi	r5,12500

#define ledrs (volatile int *) 0x00050a0

#define T_MS10 12500 //(10ms)

void wait(unsigned int s) {
      64:	dfc00115 	stw	ra,4(sp)
	volatile i;
	for (i = 0; i < T_MS10*s; i++);
      68:	d8000015 	stw	zero,0(sp)
      6c:	00012ac0 	call	12ac <__mulsi3>
      70:	1007883a 	mov	r3,r2
      74:	00000306 	br	84 <wait+0x28>
      78:	d8800017 	ldw	r2,0(sp)
      7c:	10800044 	addi	r2,r2,1
      80:	d8800015 	stw	r2,0(sp)
      84:	d8800017 	ldw	r2,0(sp)
      88:	10fffb36 	bltu	r2,r3,78 <wait+0x1c>
}
      8c:	dfc00117 	ldw	ra,4(sp)
      90:	dec00204 	addi	sp,sp,8
      94:	f800283a 	ret

00000098 <print_change_memory>:
	}while( inst_rec.inst != INST_END );

	//print_block(" end", 4, HEX0_3);
}

void print_change_memory(unsigned int current_memory) {
      98:	defffb04 	addi	sp,sp,-20
      9c:	200d883a 	mov	r6,r4
	char buf[5];
	sprintf(buf, "g %2d", current_memory);
      a0:	01400034 	movhi	r5,0
      a4:	29474f04 	addi	r5,r5,7484
      a8:	d809883a 	mov	r4,sp
	}while( inst_rec.inst != INST_END );

	//print_block(" end", 4, HEX0_3);
}

void print_change_memory(unsigned int current_memory) {
      ac:	dfc00415 	stw	ra,16(sp)
      b0:	dc400315 	stw	r17,12(sp)
      b4:	dc000215 	stw	r16,8(sp)
	char buf[5];
	sprintf(buf, "g %2d", current_memory);
	print_block(buf, 4, HEX0_3);
	print_block("an", 2, HEX4_5);
      b8:	04400044 	movi	r17,1
	//print_block(" end", 4, HEX0_3);
}

void print_change_memory(unsigned int current_memory) {
	char buf[5];
	sprintf(buf, "g %2d", current_memory);
      bc:	00012e40 	call	12e4 <sprintf>
	print_block(buf, 4, HEX0_3);
	print_block("an", 2, HEX4_5);
      c0:	04000084 	movi	r16,2
}

void print_change_memory(unsigned int current_memory) {
	char buf[5];
	sprintf(buf, "g %2d", current_memory);
	print_block(buf, 4, HEX0_3);
      c4:	d809883a 	mov	r4,sp
      c8:	01400104 	movi	r5,4
      cc:	000d883a 	mov	r6,zero
      d0:	000081c0 	call	81c <print_block>
	print_block("an", 2, HEX4_5);
      d4:	800b883a 	mov	r5,r16
      d8:	880d883a 	mov	r6,r17
      dc:	01000034 	movhi	r4,0
      e0:	21075104 	addi	r4,r4,7492
      e4:	000081c0 	call	81c <print_block>
	print_block("ch", 2, HEX6_7);
      e8:	800b883a 	mov	r5,r16
      ec:	800d883a 	mov	r6,r16
      f0:	01000034 	movhi	r4,0
      f4:	21075204 	addi	r4,r4,7496
      f8:	000081c0 	call	81c <print_block>
	wait(200);
      fc:	01003204 	movi	r4,200
     100:	000005c0 	call	5c <wait>
	clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7);
     104:	0009883a 	mov	r4,zero
     108:	00008f80 	call	8f8 <clear_block>
     10c:	8809883a 	mov	r4,r17
     110:	00008f80 	call	8f8 <clear_block>
     114:	8009883a 	mov	r4,r16
     118:	00008f80 	call	8f8 <clear_block>
}
     11c:	dfc00417 	ldw	ra,16(sp)
     120:	dc400317 	ldw	r17,12(sp)
     124:	dc000217 	ldw	r16,8(sp)
     128:	dec00504 	addi	sp,sp,20
     12c:	f800283a 	ret

00000130 <run_proc>:
		print_block(buf, 4, HEX0_3);
		sprintf(buf, "%02x", global_registers[Spc]);
		print_block(buf, 2, HEX4_5);
	}
}
void run_proc() {
     130:	defffa04 	addi	sp,sp,-24
     134:	dfc00515 	stw	ra,20(sp)
     138:	dc400415 	stw	r17,16(sp)
     13c:	dc000315 	stw	r16,12(sp)
	volatile struct InstRec inst_rec;

	//print_block(" go ", 4, HEX0_3);

	global_registers[Spc] = 0;
	print_block("pc", 2, HEX6_7);
     140:	01400084 	movi	r5,2
void run_proc() {
	volatile struct InstRec inst_rec;

	//print_block(" go ", 4, HEX0_3);

	global_registers[Spc] = 0;
     144:	00800034 	movhi	r2,0
     148:	1088d404 	addi	r2,r2,9040
	print_block("pc", 2, HEX6_7);
     14c:	01000034 	movhi	r4,0
     150:	21075304 	addi	r4,r4,7500
     154:	280d883a 	mov	r6,r5
void run_proc() {
	volatile struct InstRec inst_rec;

	//print_block(" go ", 4, HEX0_3);

	global_registers[Spc] = 0;
     158:	10000045 	stb	zero,1(r2)
	print_block("pc", 2, HEX6_7);
     15c:	000081c0 	call	81c <print_block>
	do {
		// pc表示
		{
			char buf[5];
			sprintf(buf, "%02x", global_registers[Spc]);
     160:	04400034 	movhi	r17,0
     164:	8c48d404 	addi	r17,r17,9040
     168:	89800047 	ldb	r6,1(r17)
     16c:	dc000104 	addi	r16,sp,4
     170:	01400034 	movhi	r5,0
     174:	29475404 	addi	r5,r5,7504
     178:	8009883a 	mov	r4,r16
     17c:	00012e40 	call	12e4 <sprintf>
			print_block(buf, 2, HEX4_5);
     180:	8009883a 	mov	r4,r16
     184:	01400084 	movi	r5,2
     188:	01800044 	movi	r6,1
     18c:	000081c0 	call	81c <print_block>
		}
		// 命令フェッチ
		inst_rec = inst_fetch();
     190:	0000d500 	call	d50 <inst_fetch>
     194:	d8800015 	stw	r2,0(sp)
		// 命令デコード実行
		inst_decode(inst_rec);
     198:	d9000017 	ldw	r4,0(sp)
     19c:	0000d880 	call	d88 <inst_decode>
		if ( global_registers[Ssw_run] ) wait(100);
     1a0:	88800347 	ldb	r2,13(r17)
     1a4:	01001904 	movi	r4,100
     1a8:	10000126 	beq	r2,zero,1b0 <run_proc+0x80>
     1ac:	000005c0 	call	5c <wait>
	}while( inst_rec.inst != INST_END );
     1b0:	d8800017 	ldw	r2,0(sp)
     1b4:	108003cc 	andi	r2,r2,15
     1b8:	103fe91e 	bne	r2,zero,160 <run_proc+0x30>

	//print_block(" end", 4, HEX0_3);
}
     1bc:	dfc00517 	ldw	ra,20(sp)
     1c0:	dc400417 	ldw	r17,16(sp)
     1c4:	dc000317 	ldw	r16,12(sp)
     1c8:	dec00604 	addi	sp,sp,24
     1cc:	f800283a 	ret

000001d0 <store_inst>:
	print_block(buf, 2, HEX6_7);
	print_block("--", 2, HEX4_5);
	sprintf(buf, "%04d", global_registers[Ssw_data]);
	print_block(buf, 4, HEX0_3);
}
void store_inst(){
     1d0:	defffb04 	addi	sp,sp,-20
     1d4:	dc000215 	stw	r16,8(sp)
	char reg_index;
	struct InstRec inst_rec;

	// 必要な情報の取得
	inst = global_registers[Ssw_inst];
	mem_index = global_registers[Ssw_memi];
     1d8:	04000034 	movhi	r16,0
     1dc:	8408d404 	addi	r16,r16,9040
	reg_index = global_registers[Ssw_regi];
	inst_rec.inst = (unsigned int)inst;
	inst_rec.memi = (unsigned int)mem_index;
     1e0:	80c00283 	ldbu	r3,10(r16)
	print_block(buf, 2, HEX6_7);
	print_block("--", 2, HEX4_5);
	sprintf(buf, "%04d", global_registers[Ssw_data]);
	print_block(buf, 4, HEX0_3);
}
void store_inst(){
     1e4:	dc400315 	stw	r17,12(sp)

	// 必要な情報の取得
	inst = global_registers[Ssw_inst];
	mem_index = global_registers[Ssw_memi];
	reg_index = global_registers[Ssw_regi];
	inst_rec.inst = (unsigned int)inst;
     1e8:	84400203 	ldbu	r17,8(r16)
     1ec:	008003c4 	movi	r2,15
	inst_rec.memi = (unsigned int)mem_index;
	inst_rec.regi = (unsigned int)reg_index;
     1f0:	81800243 	ldbu	r6,9(r16)
	// 必要な情報の取得
	inst = global_registers[Ssw_inst];
	mem_index = global_registers[Ssw_memi];
	reg_index = global_registers[Ssw_regi];
	inst_rec.inst = (unsigned int)inst;
	inst_rec.memi = (unsigned int)mem_index;
     1f4:	1886703a 	and	r3,r3,r2

	// 必要な情報の取得
	inst = global_registers[Ssw_inst];
	mem_index = global_registers[Ssw_memi];
	reg_index = global_registers[Ssw_regi];
	inst_rec.inst = (unsigned int)inst;
     1f8:	017ffc04 	movi	r5,-16
	inst_rec.memi = (unsigned int)mem_index;
     1fc:	1806913a 	slli	r3,r3,4

	// 必要な情報の取得
	inst = global_registers[Ssw_inst];
	mem_index = global_registers[Ssw_memi];
	reg_index = global_registers[Ssw_regi];
	inst_rec.inst = (unsigned int)inst;
     200:	88a2703a 	and	r17,r17,r2
     204:	294a703a 	and	r5,r5,r5
	inst_rec.memi = (unsigned int)mem_index;
	inst_rec.regi = (unsigned int)reg_index;
     208:	308c703a 	and	r6,r6,r2

	// 必要な情報の取得
	inst = global_registers[Ssw_inst];
	mem_index = global_registers[Ssw_memi];
	reg_index = global_registers[Ssw_regi];
	inst_rec.inst = (unsigned int)inst;
     20c:	894ab03a 	or	r5,r17,r5
	inst_rec.memi = (unsigned int)mem_index;
     210:	00bfc3c4 	movi	r2,-241
	inst_rec.regi = (unsigned int)reg_index;
     214:	300c923a 	slli	r6,r6,8
	// 必要な情報の取得
	inst = global_registers[Ssw_inst];
	mem_index = global_registers[Ssw_memi];
	reg_index = global_registers[Ssw_regi];
	inst_rec.inst = (unsigned int)inst;
	inst_rec.memi = (unsigned int)mem_index;
     218:	288a703a 	and	r5,r5,r2
     21c:	28cab03a 	or	r5,r5,r3
	inst_rec.regi = (unsigned int)reg_index;

	// ストア処理
	inst_memory_store((unsigned int)global_registers[Spc], inst_rec);
     220:	81000047 	ldb	r4,1(r16)
	inst = global_registers[Ssw_inst];
	mem_index = global_registers[Ssw_memi];
	reg_index = global_registers[Ssw_regi];
	inst_rec.inst = (unsigned int)inst;
	inst_rec.memi = (unsigned int)mem_index;
	inst_rec.regi = (unsigned int)reg_index;
     224:	00bc3fc4 	movi	r2,-3841
     228:	288a703a 	and	r5,r5,r2

	// ストア処理
	inst_memory_store((unsigned int)global_registers[Spc], inst_rec);
     22c:	298ab03a 	or	r5,r5,r6
	print_block(buf, 2, HEX6_7);
	print_block("--", 2, HEX4_5);
	sprintf(buf, "%04d", global_registers[Ssw_data]);
	print_block(buf, 4, HEX0_3);
}
void store_inst(){
     230:	dfc00415 	stw	ra,16(sp)
	inst_rec.inst = (unsigned int)inst;
	inst_rec.memi = (unsigned int)mem_index;
	inst_rec.regi = (unsigned int)reg_index;

	// ストア処理
	inst_memory_store((unsigned int)global_registers[Spc], inst_rec);
     234:	0000f3c0 	call	f3c <inst_memory_store>
	global_registers[Spc]++;
     238:	80800043 	ldbu	r2,1(r16)

	{
		char buf[5];
		sprintf(buf, "%04d", inst_rec.inst);
     23c:	880d883a 	mov	r6,r17
     240:	d809883a 	mov	r4,sp
     244:	01400034 	movhi	r5,0
     248:	29475604 	addi	r5,r5,7512
	inst_rec.memi = (unsigned int)mem_index;
	inst_rec.regi = (unsigned int)reg_index;

	// ストア処理
	inst_memory_store((unsigned int)global_registers[Spc], inst_rec);
	global_registers[Spc]++;
     24c:	10800044 	addi	r2,r2,1
     250:	80800045 	stb	r2,1(r16)

	{
		char buf[5];
		sprintf(buf, "%04d", inst_rec.inst);
     254:	00012e40 	call	12e4 <sprintf>
		print_block(buf, 4, HEX0_3);
     258:	d809883a 	mov	r4,sp
     25c:	01400104 	movi	r5,4
     260:	000d883a 	mov	r6,zero
     264:	000081c0 	call	81c <print_block>
		sprintf(buf, "%02x", global_registers[Spc]);
     268:	81800047 	ldb	r6,1(r16)
     26c:	d809883a 	mov	r4,sp
     270:	01400034 	movhi	r5,0
     274:	29475404 	addi	r5,r5,7504
     278:	00012e40 	call	12e4 <sprintf>
		print_block(buf, 2, HEX4_5);
     27c:	d809883a 	mov	r4,sp
     280:	01400084 	movi	r5,2
     284:	01800044 	movi	r6,1
     288:	000081c0 	call	81c <print_block>
	}
}
     28c:	dfc00417 	ldw	ra,16(sp)
     290:	dc400317 	ldw	r17,12(sp)
     294:	dc000217 	ldw	r16,8(sp)
     298:	dec00504 	addi	sp,sp,20
     29c:	f800283a 	ret

000002a0 <store_value>:
	clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7);
}

char stack[5];

void store_value(){
     2a0:	defffa04 	addi	sp,sp,-24
     2a4:	dc800415 	stw	r18,16(sp)
	char buf[5];
	unsigned int memi = global_registers[Ssw_memi];
     2a8:	04800034 	movhi	r18,0
     2ac:	9488d404 	addi	r18,r18,9040
	clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7);
}

char stack[5];

void store_value(){
     2b0:	dc400315 	stw	r17,12(sp)
	char buf[5];
	unsigned int memi = global_registers[Ssw_memi];
     2b4:	94400287 	ldb	r17,10(r18)
	memory_store(memi, Ssw_data);
     2b8:	014001c4 	movi	r5,7
	clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7);
}

char stack[5];

void store_value(){
     2bc:	dfc00515 	stw	ra,20(sp)
	char buf[5];
	unsigned int memi = global_registers[Ssw_memi];
	memory_store(memi, Ssw_data);
     2c0:	8809883a 	mov	r4,r17
	clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7);
}

char stack[5];

void store_value(){
     2c4:	dc000215 	stw	r16,8(sp)
	char buf[5];
	unsigned int memi = global_registers[Ssw_memi];
	memory_store(memi, Ssw_data);
     2c8:	00010a80 	call	10a8 <memory_store>
	sprintf(buf, "%02x", (unsigned char)memi);
	print_block(buf, 2, HEX6_7);
     2cc:	04000084 	movi	r16,2

void store_value(){
	char buf[5];
	unsigned int memi = global_registers[Ssw_memi];
	memory_store(memi, Ssw_data);
	sprintf(buf, "%02x", (unsigned char)memi);
     2d0:	d809883a 	mov	r4,sp
     2d4:	89803fcc 	andi	r6,r17,255
     2d8:	01400034 	movhi	r5,0
     2dc:	29475404 	addi	r5,r5,7504
     2e0:	00012e40 	call	12e4 <sprintf>
	print_block(buf, 2, HEX6_7);
     2e4:	d809883a 	mov	r4,sp
     2e8:	800b883a 	mov	r5,r16
     2ec:	800d883a 	mov	r6,r16
     2f0:	000081c0 	call	81c <print_block>
	print_block("--", 2, HEX4_5);
     2f4:	800b883a 	mov	r5,r16
     2f8:	01800044 	movi	r6,1
     2fc:	01000034 	movhi	r4,0
     300:	21075804 	addi	r4,r4,7520
     304:	000081c0 	call	81c <print_block>
	sprintf(buf, "%04d", global_registers[Ssw_data]);
     308:	918001c7 	ldb	r6,7(r18)
     30c:	d809883a 	mov	r4,sp
     310:	01400034 	movhi	r5,0
     314:	29475604 	addi	r5,r5,7512
     318:	00012e40 	call	12e4 <sprintf>
	print_block(buf, 4, HEX0_3);
     31c:	d809883a 	mov	r4,sp
     320:	01400104 	movi	r5,4
     324:	000d883a 	mov	r6,zero
     328:	000081c0 	call	81c <print_block>
}
     32c:	dfc00517 	ldw	ra,20(sp)
     330:	dc800417 	ldw	r18,16(sp)
     334:	dc400317 	ldw	r17,12(sp)
     338:	dc000217 	ldw	r16,8(sp)
     33c:	dec00604 	addi	sp,sp,24
     340:	f800283a 	ret

00000344 <init>:
void wait(unsigned int s) {
	volatile i;
	for (i = 0; i < T_MS10*s; i++);
}

void init() {
     344:	defffd04 	addi	sp,sp,-12
     348:	dfc00215 	stw	ra,8(sp)
     34c:	dc400115 	stw	r17,4(sp)
     350:	dc000015 	stw	r16,0(sp)
	registers_init();
     354:	00011180 	call	1118 <registers_init>
	memory_init();
     358:	0000ef80 	call	ef8 <memory_init>
	clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7);
     35c:	04400044 	movi	r17,1
     360:	0009883a 	mov	r4,zero
     364:	04000084 	movi	r16,2
     368:	00008f80 	call	8f8 <clear_block>
     36c:	8809883a 	mov	r4,r17
     370:	00008f80 	call	8f8 <clear_block>
     374:	8009883a 	mov	r4,r16
     378:	00008f80 	call	8f8 <clear_block>
	print_block("he", 2, HEX6_7);
     37c:	800b883a 	mov	r5,r16
     380:	800d883a 	mov	r6,r16
     384:	01000034 	movhi	r4,0
     388:	21075904 	addi	r4,r4,7524
     38c:	000081c0 	call	81c <print_block>
	print_block("lo", 2, HEX4_5);
     390:	800b883a 	mov	r5,r16
     394:	880d883a 	mov	r6,r17
     398:	01000034 	movhi	r4,0
     39c:	21075a04 	addi	r4,r4,7528
     3a0:	000081c0 	call	81c <print_block>
	print_block("you1", 4, HEX0_3);
     3a4:	01400104 	movi	r5,4
     3a8:	000d883a 	mov	r6,zero
     3ac:	01000034 	movhi	r4,0
     3b0:	21075b04 	addi	r4,r4,7532
     3b4:	000081c0 	call	81c <print_block>
	wait(200);
     3b8:	01003204 	movi	r4,200
     3bc:	000005c0 	call	5c <wait>
	clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7);
     3c0:	0009883a 	mov	r4,zero
     3c4:	00008f80 	call	8f8 <clear_block>
     3c8:	8809883a 	mov	r4,r17
     3cc:	00008f80 	call	8f8 <clear_block>
     3d0:	8009883a 	mov	r4,r16
}
     3d4:	dfc00217 	ldw	ra,8(sp)
     3d8:	dc400117 	ldw	r17,4(sp)
     3dc:	dc000017 	ldw	r16,0(sp)
     3e0:	dec00304 	addi	sp,sp,12
	clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7);
	print_block("he", 2, HEX6_7);
	print_block("lo", 2, HEX4_5);
	print_block("you1", 4, HEX0_3);
	wait(200);
	clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7);
     3e4:	00008f81 	jmpi	8f8 <clear_block>

000003e8 <main>:
	wait(200);
	clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7);
}

int main()
{
     3e8:	defffe04 	addi	sp,sp,-8
     3ec:	dfc00115 	stw	ra,4(sp)
     3f0:	dc000015 	stw	r16,0(sp)
	init();
     3f4:	00003440 	call	344 <init>
	while(1) {
		// interrupt
		in_int();

		// event
		if (PUSH_EVENT == PUSH_VALSTR) {
     3f8:	04000034 	movhi	r16,0
     3fc:	84087d04 	addi	r16,r16,8692
int main()
{
	init();
	while(1) {
		// interrupt
		in_int();
     400:	0000bc00 	call	bc0 <in_int>

		// event
		if (PUSH_EVENT == PUSH_VALSTR) {
     404:	80c00003 	ldbu	r3,0(r16)
     408:	00800084 	movi	r2,2
     40c:	1880011e 	bne	r3,r2,414 <main+0x2c>
			// 値のストア
			store_value();
     410:	00002a00 	call	2a0 <store_value>
		}
		if (PUSH_EVENT == PUSH_INSSTR) {
     414:	80c00003 	ldbu	r3,0(r16)
     418:	008000c4 	movi	r2,3
     41c:	1880011e 	bne	r3,r2,424 <main+0x3c>
			// 命令のストア
			store_inst();
     420:	00001d00 	call	1d0 <store_inst>
		}
		if (PUSH_EVENT == PUSH_RUN) {
     424:	80c00003 	ldbu	r3,0(r16)
     428:	00800104 	movi	r2,4
			if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) {
     42c:	01400034 	movhi	r5,0
     430:	29488004 	addi	r5,r5,8704
		}
		if (PUSH_EVENT == PUSH_INSSTR) {
			// 命令のストア
			store_inst();
		}
		if (PUSH_EVENT == PUSH_RUN) {
     434:	18bff01e 	bne	r3,r2,3f8 <main+0x10>
			if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) {
     438:	00800034 	movhi	r2,0
     43c:	1088d404 	addi	r2,r2,9040
     440:	10c002c7 	ldb	r3,11(r2)
     444:	28800017 	ldw	r2,0(r5)
				global_current_memory = (unsigned int)global_registers[Ssw_psel];
				print_change_memory(global_current_memory);
     448:	1809883a 	mov	r4,r3
		if (PUSH_EVENT == PUSH_INSSTR) {
			// 命令のストア
			store_inst();
		}
		if (PUSH_EVENT == PUSH_RUN) {
			if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) {
     44c:	10c00326 	beq	r2,r3,45c <main+0x74>
				global_current_memory = (unsigned int)global_registers[Ssw_psel];
     450:	28c00015 	stw	r3,0(r5)
				print_change_memory(global_current_memory);
     454:	00000980 	call	98 <print_change_memory>
     458:	003fe706 	br	3f8 <main+0x10>
			}
			else {
				// プログラム実行
				run_proc();
     45c:	00001300 	call	130 <run_proc>
     460:	003fe506 	br	3f8 <main+0x10>

00000464 <encodeNumHex>:
#include "hex_encoder.h"
#include <ctype.h>

void encodeNumHex(int hex_i, int num) {
	char encoded = 0;
	switch (num) {
     464:	00800244 	movi	r2,9
     468:	11401336 	bltu	r2,r5,4b8 <encodeNumHex+0x54>
     46c:	2945883a 	add	r2,r5,r5
     470:	1085883a 	add	r2,r2,r2
     474:	00c00034 	movhi	r3,0
     478:	18c12204 	addi	r3,r3,1160
     47c:	10c5883a 	add	r2,r2,r3
     480:	10800017 	ldw	r2,0(r2)
     484:	1000683a 	jmp	r2
     488:	000004c0 	call	4c <_start+0x2c>
     48c:	000004c8 	cmpgei	zero,zero,19
     490:	000004d0 	cmplti	zero,zero,19
     494:	000004d8 	cmpnei	zero,zero,19
     498:	000004e0 	cmpeqi	zero,zero,19
     49c:	000004e8 	cmpgeui	zero,zero,19
     4a0:	000004f0 	cmpltui	zero,zero,19
     4a4:	000004f8 	rdprs	zero,zero,19
     4a8:	000004b8 	rdprs	zero,zero,18
     4ac:	000004b0 	cmpltui	zero,zero,18
     4b0:	01400404 	movi	r5,16
     4b4:	00001106 	br	4fc <encodeNumHex+0x98>
     4b8:	000b883a 	mov	r5,zero
     4bc:	00000f06 	br	4fc <encodeNumHex+0x98>
     4c0:	01401004 	movi	r5,64
     4c4:	00000d06 	br	4fc <encodeNumHex+0x98>
	case 0:
		encoded = (char)0x40;	// 100 0000
		break;
     4c8:	017ffe44 	movi	r5,-7
     4cc:	00000b06 	br	4fc <encodeNumHex+0x98>
	case 1:
		encoded = (char)0xF9;	// 111 1001
		break;
     4d0:	01400904 	movi	r5,36
     4d4:	00000906 	br	4fc <encodeNumHex+0x98>
	case 2:
		encoded = (char)0x24;	// 010 0100
		break;
     4d8:	01400c04 	movi	r5,48
     4dc:	00000706 	br	4fc <encodeNumHex+0x98>
	case 3:
		encoded = (char)0x30;	// 011 0000
		break;
     4e0:	01400644 	movi	r5,25
     4e4:	00000506 	br	4fc <encodeNumHex+0x98>
	case 4:
		encoded = (char)0x19;	// 001 1001
		break;
     4e8:	01400484 	movi	r5,18
     4ec:	00000306 	br	4fc <encodeNumHex+0x98>
	case 5:
		encoded = (char)0x12;	// 001 0010
		break;
     4f0:	01400084 	movi	r5,2
     4f4:	00000106 	br	4fc <encodeNumHex+0x98>
	case 6:
		encoded = (char)0x02;	// 000 0010
		break;
     4f8:	01401604 	movi	r5,88
	default:
		encoded = 0;
		break;
	}

	switch (hex_i) {
     4fc:	008001c4 	movi	r2,7
     500:	11002036 	bltu	r2,r4,584 <encodeNumHex+0x120>
     504:	2105883a 	add	r2,r4,r4
     508:	1085883a 	add	r2,r2,r2
     50c:	00c00034 	movhi	r3,0
     510:	18c14804 	addi	r3,r3,1312
     514:	10c5883a 	add	r2,r2,r3
     518:	10800017 	ldw	r2,0(r2)
     51c:	1000683a 	jmp	r2
     520:	00000540 	call	54 <_start+0x34>
     524:	00000548 	cmpgei	zero,zero,21
     528:	00000550 	cmplti	zero,zero,21
     52c:	00000558 	cmpnei	zero,zero,21
     530:	00000560 	cmpeqi	zero,zero,21
     534:	00000568 	cmpgeui	zero,zero,21
     538:	00000570 	cmpltui	zero,zero,21
     53c:	0000057c 	xorhi	zero,zero,21
	case 0:
		*hex0 = encoded;
     540:	00941c04 	movi	r2,20592
     544:	00000b06 	br	574 <encodeNumHex+0x110>
		break;
	case 1:
		*hex1 = encoded;
     548:	00941804 	movi	r2,20576
     54c:	00000906 	br	574 <encodeNumHex+0x110>
		break;
	case 2:
		*hex2 = encoded;
     550:	00941404 	movi	r2,20560
     554:	00000706 	br	574 <encodeNumHex+0x110>
		break;
	case 3:
		*hex3 = encoded;
     558:	00941004 	movi	r2,20544
     55c:	00000506 	br	574 <encodeNumHex+0x110>
		break;
	case 4:
		*hex4 = encoded;
     560:	00940c04 	movi	r2,20528
     564:	00000306 	br	574 <encodeNumHex+0x110>
		break;
	case 5:
		*hex5 = encoded;
     568:	00940804 	movi	r2,20512
     56c:	00000106 	br	574 <encodeNumHex+0x110>
		break;
	case 6:
		*hex6 = encoded;
     570:	00940404 	movi	r2,20496
     574:	11400005 	stb	r5,0(r2)
     578:	f800283a 	ret
		break;
	case 7:
		*hex7 = encoded;
     57c:	00940004 	movi	r2,20480
     580:	11400005 	stb	r5,0(r2)
     584:	f800283a 	ret

00000588 <encodeLatHex>:
}

void encodeLatHex(int hex_i, char c) {
	char encoded = 0;

	if (isdigit(c)) {
     588:	00800034 	movhi	r2,0
     58c:	10883b04 	addi	r2,r2,8428
     590:	10800017 	ldw	r2,0(r2)
     594:	29403fcc 	andi	r5,r5,255
     598:	2940201c 	xori	r5,r5,128
     59c:	297fe004 	addi	r5,r5,-128
     5a0:	2885883a 	add	r2,r5,r2
     5a4:	10800003 	ldbu	r2,0(r2)
	default:
		break;
	}
}

void encodeLatHex(int hex_i, char c) {
     5a8:	2007883a 	mov	r3,r4
	char encoded = 0;

	if (isdigit(c)) {
     5ac:	1080010c 	andi	r2,r2,4
     5b0:	10000226 	beq	r2,zero,5bc <encodeLatHex+0x34>
		encodeNumHex(hex_i, c-'0');
     5b4:	297ff404 	addi	r5,r5,-48
     5b8:	00004641 	jmpi	464 <encodeNumHex>
		return;
	}

	switch (c) {
     5bc:	00801b44 	movi	r2,109
     5c0:	28805a26 	beq	r5,r2,72c <encodeLatHex+0x1a4>
     5c4:	11401d16 	blt	r2,r5,63c <encodeLatHex+0xb4>
     5c8:	00801984 	movi	r2,102
     5cc:	28804926 	beq	r5,r2,6f4 <encodeLatHex+0x16c>
     5d0:	11400e16 	blt	r2,r5,60c <encodeLatHex+0x84>
     5d4:	00801884 	movi	r2,98
     5d8:	28803e26 	beq	r5,r2,6d4 <encodeLatHex+0x14c>
     5dc:	11400716 	blt	r2,r5,5fc <encodeLatHex+0x74>
     5e0:	00800b44 	movi	r2,45
     5e4:	28803726 	beq	r5,r2,6c4 <encodeLatHex+0x13c>
     5e8:	00801844 	movi	r2,97
     5ec:	28803726 	beq	r5,r2,6cc <encodeLatHex+0x144>
     5f0:	00800804 	movi	r2,32
     5f4:	28802f1e 	bne	r5,r2,6b4 <encodeLatHex+0x12c>
     5f8:	00003006 	br	6bc <encodeLatHex+0x134>
     5fc:	00801904 	movi	r2,100
     600:	28803826 	beq	r5,r2,6e4 <encodeLatHex+0x15c>
     604:	11403916 	blt	r2,r5,6ec <encodeLatHex+0x164>
     608:	00003406 	br	6dc <encodeLatHex+0x154>
     60c:	00801a44 	movi	r2,105
     610:	28803e26 	beq	r5,r2,70c <encodeLatHex+0x184>
     614:	11400516 	blt	r2,r5,62c <encodeLatHex+0xa4>
     618:	008019c4 	movi	r2,103
     61c:	28803726 	beq	r5,r2,6fc <encodeLatHex+0x174>
     620:	00801a04 	movi	r2,104
     624:	2880231e 	bne	r5,r2,6b4 <encodeLatHex+0x12c>
     628:	00003606 	br	704 <encodeLatHex+0x17c>
     62c:	00801ac4 	movi	r2,107
     630:	28803a26 	beq	r5,r2,71c <encodeLatHex+0x194>
     634:	11403b16 	blt	r2,r5,724 <encodeLatHex+0x19c>
     638:	00003606 	br	714 <encodeLatHex+0x18c>
     63c:	00801d04 	movi	r2,116
     640:	28804826 	beq	r5,r2,764 <encodeLatHex+0x1dc>
     644:	11400c16 	blt	r2,r5,678 <encodeLatHex+0xf0>
     648:	00801c04 	movi	r2,112
     64c:	28803d26 	beq	r5,r2,744 <encodeLatHex+0x1bc>
     650:	11400516 	blt	r2,r5,668 <encodeLatHex+0xe0>
     654:	00801b84 	movi	r2,110
     658:	28803626 	beq	r5,r2,734 <encodeLatHex+0x1ac>
     65c:	00801bc4 	movi	r2,111
     660:	2880141e 	bne	r5,r2,6b4 <encodeLatHex+0x12c>
     664:	00003506 	br	73c <encodeLatHex+0x1b4>
     668:	00801c84 	movi	r2,114
     66c:	28803926 	beq	r5,r2,754 <encodeLatHex+0x1cc>
     670:	11403a16 	blt	r2,r5,75c <encodeLatHex+0x1d4>
     674:	00003506 	br	74c <encodeLatHex+0x1c4>
     678:	00801dc4 	movi	r2,119
     67c:	28803f26 	beq	r5,r2,77c <encodeLatHex+0x1f4>
     680:	11400516 	blt	r2,r5,698 <encodeLatHex+0x110>
     684:	00801d44 	movi	r2,117
     688:	28803826 	beq	r5,r2,76c <encodeLatHex+0x1e4>
     68c:	00801d84 	movi	r2,118
     690:	2880081e 	bne	r5,r2,6b4 <encodeLatHex+0x12c>
     694:	00003706 	br	774 <encodeLatHex+0x1ec>
     698:	00801e44 	movi	r2,121
     69c:	28803b26 	beq	r5,r2,78c <encodeLatHex+0x204>
     6a0:	28803816 	blt	r5,r2,784 <encodeLatHex+0x1fc>
     6a4:	00801e84 	movi	r2,122
     6a8:	2880021e 	bne	r5,r2,6b4 <encodeLatHex+0x12c>
     6ac:	01401904 	movi	r5,100
     6b0:	00003706 	br	790 <encodeLatHex+0x208>
     6b4:	000b883a 	mov	r5,zero
     6b8:	00003506 	br	790 <encodeLatHex+0x208>
     6bc:	017fffc4 	movi	r5,-1
     6c0:	00003306 	br	790 <encodeLatHex+0x208>
	case ' ':
		encoded = (char)0xFF;	// 111 1111
		break;
     6c4:	01400fc4 	movi	r5,63
     6c8:	00003106 	br	790 <encodeLatHex+0x208>
	case '-':
		encoded = (char)0x3F;	// 011 1111
		break;
     6cc:	01400204 	movi	r5,8
     6d0:	00002f06 	br	790 <encodeLatHex+0x208>
	case 'a':
		encoded = (char)0x08;	// 000 1000
		break;
     6d4:	014000c4 	movi	r5,3
     6d8:	00002d06 	br	790 <encodeLatHex+0x208>
	case 'b':
		encoded = (char)0x03;	// 000 0011
		break;
     6dc:	014009c4 	movi	r5,39
     6e0:	00002b06 	br	790 <encodeLatHex+0x208>
	case 'c':
		encoded = (char)0x27;	// 010 0111
		break;
     6e4:	01400844 	movi	r5,33
     6e8:	00002906 	br	790 <encodeLatHex+0x208>
	case 'd':
		encoded = (char)0x21;	// 010 0001
		break;
     6ec:	01400184 	movi	r5,6
     6f0:	00002706 	br	790 <encodeLatHex+0x208>
	case 'e':
		encoded = (char)0x06;	// 000 0110
		break;
     6f4:	01400384 	movi	r5,14
     6f8:	00002506 	br	790 <encodeLatHex+0x208>
	case 'f':
		encoded = (char)0x0E;	// 000 1110
		break;
     6fc:	01401084 	movi	r5,66
     700:	00002306 	br	790 <encodeLatHex+0x208>
	case 'g':
		encoded = (char)0x42;	// 100 0010
		break;
     704:	014002c4 	movi	r5,11
     708:	00002106 	br	790 <encodeLatHex+0x208>
	case 'h':
		encoded = (char)0x0B;	// 000 1011
		break;
     70c:	017ffec4 	movi	r5,-5
     710:	00001f06 	br	790 <encodeLatHex+0x208>
	case 'i':
		encoded = (char)0xFB;	// 111 1011
		break;
     714:	01401844 	movi	r5,97
     718:	00001d06 	br	790 <encodeLatHex+0x208>
	case 'j':
		encoded = (char)0x61;	// 110 0001
		break;
     71c:	01400284 	movi	r5,10
     720:	00001b06 	br	790 <encodeLatHex+0x208>
	case 'k':
		encoded = (char)0x0A;	// 000 1010
		break;
     724:	014011c4 	movi	r5,71
     728:	00001906 	br	790 <encodeLatHex+0x208>
	case 'l':
		encoded = (char)0x47;	// 100 0111
		break;
     72c:	01401204 	movi	r5,72
     730:	00001706 	br	790 <encodeLatHex+0x208>
	case 'm':
		encoded = (char)0x48;	// 100 1000
		break;
     734:	01400ac4 	movi	r5,43
     738:	00001506 	br	790 <encodeLatHex+0x208>
	case 'n':
		encoded = (char)0x2B;	// 010 1011
		break;
     73c:	014008c4 	movi	r5,35
     740:	00001306 	br	790 <encodeLatHex+0x208>
	case 'o':
		encoded = (char)0x23;	// 010 0011
		break;
     744:	01400304 	movi	r5,12
     748:	00001106 	br	790 <encodeLatHex+0x208>
	case 'p':
		encoded = (char)0x0C;	// 000 1100
		break;
     74c:	01400104 	movi	r5,4
     750:	00000f06 	br	790 <encodeLatHex+0x208>
	case 'q':
		encoded = (char)0x04;	// 000 0100
		break;
     754:	01400bc4 	movi	r5,47
     758:	00000d06 	br	790 <encodeLatHex+0x208>
	case 'r':
		encoded = (char)0x2F;	// 010 1111
		break;
     75c:	014004c4 	movi	r5,19
     760:	00000b06 	br	790 <encodeLatHex+0x208>
	case 's':
		encoded = (char)0x13;	// 001 0011
		break;
     764:	014001c4 	movi	r5,7
     768:	00000906 	br	790 <encodeLatHex+0x208>
	case 't':
		encoded = (char)0x07;	// 000 0111
		break;
     76c:	014018c4 	movi	r5,99
     770:	00000706 	br	790 <encodeLatHex+0x208>
	case 'u':
		encoded = (char)0x63;	// 110 0011
		break;
     774:	01401044 	movi	r5,65
     778:	00000506 	br	790 <encodeLatHex+0x208>
	case 'v':
		encoded = (char)0x41;	// 100 0001
		break;
     77c:	01400044 	movi	r5,1
     780:	00000306 	br	790 <encodeLatHex+0x208>
	case 'w':
		encoded = (char)0x01;	// 000 0001
		break;
     784:	01400244 	movi	r5,9
     788:	00000106 	br	790 <encodeLatHex+0x208>
	case 'x':
		encoded = (char)0x09;	// 000 1001
		break;
     78c:	01400444 	movi	r5,17
	default:
		encoded = 0;
		break;
	}

	switch (hex_i) {
     790:	008001c4 	movi	r2,7
     794:	10c02036 	bltu	r2,r3,818 <encodeLatHex+0x290>
     798:	18c5883a 	add	r2,r3,r3
     79c:	1085883a 	add	r2,r2,r2
     7a0:	00c00034 	movhi	r3,0
     7a4:	18c1ed04 	addi	r3,r3,1972
     7a8:	10c5883a 	add	r2,r2,r3
     7ac:	10800017 	ldw	r2,0(r2)
     7b0:	1000683a 	jmp	r2
     7b4:	000007d4 	movui	zero,31
     7b8:	000007dc 	xori	zero,zero,31
     7bc:	000007e4 	muli	zero,zero,31
     7c0:	000007ec 	andhi	zero,zero,31
     7c4:	000007f4 	movhi	zero,31
     7c8:	000007fc 	xorhi	zero,zero,31
     7cc:	00000804 	movi	zero,32
     7d0:	00000810 	cmplti	zero,zero,32
	case 0:
		*hex0 = encoded;
     7d4:	00941c04 	movi	r2,20592
     7d8:	00000b06 	br	808 <encodeLatHex+0x280>
		break;
	case 1:
		*hex1 = encoded;
     7dc:	00941804 	movi	r2,20576
     7e0:	00000906 	br	808 <encodeLatHex+0x280>
		break;
	case 2:
		*hex2 = encoded;
     7e4:	00941404 	movi	r2,20560
     7e8:	00000706 	br	808 <encodeLatHex+0x280>
		break;
	case 3:
		*hex3 = encoded;
     7ec:	00941004 	movi	r2,20544
     7f0:	00000506 	br	808 <encodeLatHex+0x280>
		break;
	case 4:
		*hex4 = encoded;
     7f4:	00940c04 	movi	r2,20528
     7f8:	00000306 	br	808 <encodeLatHex+0x280>
		break;
	case 5:
		*hex5 = encoded;
     7fc:	00940804 	movi	r2,20512
     800:	00000106 	br	808 <encodeLatHex+0x280>
		break;
	case 6:
		*hex6 = encoded;
     804:	00940404 	movi	r2,20496
     808:	11400005 	stb	r5,0(r2)
     80c:	f800283a 	ret
		break;
	case 7:
		*hex7 = encoded;
     810:	00940004 	movi	r2,20480
     814:	11400005 	stb	r5,0(r2)
     818:	f800283a 	ret

0000081c <print_block>:
 */
#include "hex_out.h"
#include "hex_encoder.h"
#include "system.h"

void print_block(char * str, unsigned int size, enum BLOCK_N block_i) {
     81c:	defffc04 	addi	sp,sp,-16
     820:	dc400115 	stw	r17,4(sp)
     824:	dc000015 	stw	r16,0(sp)
     828:	dfc00315 	stw	ra,12(sp)
     82c:	dc800215 	stw	r18,8(sp)
     830:	2021883a 	mov	r16,r4
     834:	2823883a 	mov	r17,r5
	int i;
	if (block_i == HEX0_3) {
     838:	30000d1e 	bne	r6,zero,870 <print_block+0x54>
		if (size > 4) panic();
     83c:	00800104 	movi	r2,4
     840:	1140012e 	bgeu	r2,r5,848 <print_block+0x2c>
     844:	00011340 	call	1134 <panic>
     848:	8461883a 	add	r16,r16,r17
     84c:	0025883a 	mov	r18,zero
     850:	00000306 	br	860 <print_block+0x44>
		for (i = 0; i < size; i++) {
			encodeLatHex(i,str[size-1-i]);
     854:	81400007 	ldb	r5,0(r16)

void print_block(char * str, unsigned int size, enum BLOCK_N block_i) {
	int i;
	if (block_i == HEX0_3) {
		if (size > 4) panic();
		for (i = 0; i < size; i++) {
     858:	94800044 	addi	r18,r18,1
			encodeLatHex(i,str[size-1-i]);
     85c:	00005880 	call	588 <encodeLatHex>
     860:	9009883a 	mov	r4,r18

void print_block(char * str, unsigned int size, enum BLOCK_N block_i) {
	int i;
	if (block_i == HEX0_3) {
		if (size > 4) panic();
		for (i = 0; i < size; i++) {
     864:	843fffc4 	addi	r16,r16,-1
     868:	947ffa1e 	bne	r18,r17,854 <print_block+0x38>
     86c:	00001c06 	br	8e0 <print_block+0xc4>
			encodeLatHex(i,str[size-1-i]);
		}
	}
	else if (block_i == HEX4_5) {
     870:	00800044 	movi	r2,1
     874:	30800d1e 	bne	r6,r2,8ac <print_block+0x90>
		if (size > 2) panic();
     878:	00800084 	movi	r2,2
     87c:	1140012e 	bgeu	r2,r5,884 <print_block+0x68>
     880:	00011340 	call	1134 <panic>
     884:	8461883a 	add	r16,r16,r17
     888:	0025883a 	mov	r18,zero
     88c:	00000306 	br	89c <print_block+0x80>
		for (i = 0; i < size; i++) {
			encodeLatHex(i+4,str[size-1-i]);
     890:	81400007 	ldb	r5,0(r16)
			encodeLatHex(i,str[size-1-i]);
		}
	}
	else if (block_i == HEX4_5) {
		if (size > 2) panic();
		for (i = 0; i < size; i++) {
     894:	94800044 	addi	r18,r18,1
			encodeLatHex(i+4,str[size-1-i]);
     898:	00005880 	call	588 <encodeLatHex>
     89c:	91000104 	addi	r4,r18,4
			encodeLatHex(i,str[size-1-i]);
		}
	}
	else if (block_i == HEX4_5) {
		if (size > 2) panic();
		for (i = 0; i < size; i++) {
     8a0:	843fffc4 	addi	r16,r16,-1
     8a4:	947ffa1e 	bne	r18,r17,890 <print_block+0x74>
     8a8:	00000d06 	br	8e0 <print_block+0xc4>
			encodeLatHex(i+4,str[size-1-i]);
		}
	}
	else if (block_i == HEX6_7) {
     8ac:	00800084 	movi	r2,2
     8b0:	30800b1e 	bne	r6,r2,8e0 <print_block+0xc4>
		if (size > 2) panic();
     8b4:	3140012e 	bgeu	r6,r5,8bc <print_block+0xa0>
     8b8:	00011340 	call	1134 <panic>
     8bc:	8461883a 	add	r16,r16,r17
     8c0:	0025883a 	mov	r18,zero
     8c4:	00000306 	br	8d4 <print_block+0xb8>
		for (i = 0; i < size; i++) {
			encodeLatHex(i+6,str[size-1-i]);
     8c8:	81400007 	ldb	r5,0(r16)
			encodeLatHex(i+4,str[size-1-i]);
		}
	}
	else if (block_i == HEX6_7) {
		if (size > 2) panic();
		for (i = 0; i < size; i++) {
     8cc:	94800044 	addi	r18,r18,1
			encodeLatHex(i+6,str[size-1-i]);
     8d0:	00005880 	call	588 <encodeLatHex>
     8d4:	91000184 	addi	r4,r18,6
			encodeLatHex(i+4,str[size-1-i]);
		}
	}
	else if (block_i == HEX6_7) {
		if (size > 2) panic();
		for (i = 0; i < size; i++) {
     8d8:	843fffc4 	addi	r16,r16,-1
     8dc:	947ffa1e 	bne	r18,r17,8c8 <print_block+0xac>
			encodeLatHex(i+6,str[size-1-i]);
		}
	}
}
     8e0:	dfc00317 	ldw	ra,12(sp)
     8e4:	dc800217 	ldw	r18,8(sp)
     8e8:	dc400117 	ldw	r17,4(sp)
     8ec:	dc000017 	ldw	r16,0(sp)
     8f0:	dec00404 	addi	sp,sp,16
     8f4:	f800283a 	ret

000008f8 <clear_block>:

void clear_block(enum BLOCK_N block_i) {
     8f8:	2007883a 	mov	r3,r4
	if (block_i == HEX0_3) {
		print_block("    ", 4, HEX0_3);
     8fc:	01400104 	movi	r5,4
     900:	000d883a 	mov	r6,zero
     904:	01000034 	movhi	r4,0
     908:	21075d04 	addi	r4,r4,7540
		}
	}
}

void clear_block(enum BLOCK_N block_i) {
	if (block_i == HEX0_3) {
     90c:	18000c26 	beq	r3,zero,940 <clear_block+0x48>
		print_block("    ", 4, HEX0_3);
	}
	else if (block_i == HEX4_5) {
     910:	00800044 	movi	r2,1
		print_block("  ", 2, HEX4_5);
     914:	180d883a 	mov	r6,r3
     918:	01000034 	movhi	r4,0
     91c:	21075f04 	addi	r4,r4,7548
     920:	01400084 	movi	r5,2

void clear_block(enum BLOCK_N block_i) {
	if (block_i == HEX0_3) {
		print_block("    ", 4, HEX0_3);
	}
	else if (block_i == HEX4_5) {
     924:	18800626 	beq	r3,r2,940 <clear_block+0x48>
		print_block("  ", 2, HEX4_5);
	}
	else if (block_i == HEX6_7) {
     928:	00800084 	movi	r2,2
		print_block("  ", 2, HEX6_7);
     92c:	180b883a 	mov	r5,r3
     930:	01000034 	movhi	r4,0
     934:	21075f04 	addi	r4,r4,7548
     938:	180d883a 	mov	r6,r3
		print_block("    ", 4, HEX0_3);
	}
	else if (block_i == HEX4_5) {
		print_block("  ", 2, HEX4_5);
	}
	else if (block_i == HEX6_7) {
     93c:	1880011e 	bne	r3,r2,944 <clear_block+0x4c>
		print_block("  ", 2, HEX6_7);
     940:	000081c1 	jmpi	81c <print_block>
     944:	f800283a 	ret

00000948 <print_number>:
	}
}

void print_number(char num) {
     948:	defff804 	addi	sp,sp,-32
     94c:	dc800415 	stw	r18,16(sp)
     950:	dc400315 	stw	r17,12(sp)
     954:	dfc00715 	stw	ra,28(sp)
     958:	dd000615 	stw	r20,24(sp)
     95c:	dcc00515 	stw	r19,20(sp)
     960:	dc000215 	stw	r16,8(sp)
     964:	2023883a 	mov	r17,r4
     968:	0025883a 	mov	r18,zero
	int i;
	char buf[5];
	char val;
	for (i = 0; i < 4; i++) {
		if (num < 0) {
     96c:	88803fcc 	andi	r2,r17,255
     970:	1080201c 	xori	r2,r2,128
     974:	10bfe004 	addi	r2,r2,-128
			buf[0] = '-';
     978:	05000b44 	movi	r20,45
			val = -num;
     97c:	0461c83a 	sub	r16,zero,r17
void print_number(char num) {
	int i;
	char buf[5];
	char val;
	for (i = 0; i < 4; i++) {
		if (num < 0) {
     980:	10000216 	blt	r2,zero,98c <print_number+0x44>
			buf[0] = '-';
			val = -num;
		} else {
			buf[0] = ' ';
     984:	05000804 	movi	r20,32
     988:	8821883a 	mov	r16,r17
			val = num;
		}
		buf[1] = val/100%10 + '0';
     98c:	84003fcc 	andi	r16,r16,255
     990:	8400201c 	xori	r16,r16,128
     994:	843fe004 	addi	r16,r16,-128
     998:	8009883a 	mov	r4,r16
     99c:	01401904 	movi	r5,100
     9a0:	00011dc0 	call	11dc <__divsi3>
     9a4:	11003fcc 	andi	r4,r2,255
     9a8:	2100201c 	xori	r4,r4,128
     9ac:	213fe004 	addi	r4,r4,-128
     9b0:	01400284 	movi	r5,10
     9b4:	000123c0 	call	123c <__modsi3>
		buf[2] = val/10%10 + '0';
     9b8:	8009883a 	mov	r4,r16
     9bc:	01400284 	movi	r5,10
			val = -num;
		} else {
			buf[0] = ' ';
			val = num;
		}
		buf[1] = val/100%10 + '0';
     9c0:	14c00c04 	addi	r19,r2,48
		buf[2] = val/10%10 + '0';
     9c4:	00011dc0 	call	11dc <__divsi3>
     9c8:	11003fcc 	andi	r4,r2,255
     9cc:	2100201c 	xori	r4,r4,128
     9d0:	213fe004 	addi	r4,r4,-128
     9d4:	01400284 	movi	r5,10
     9d8:	000123c0 	call	123c <__modsi3>
		buf[3] = val%10 + '0';
     9dc:	8009883a 	mov	r4,r16
     9e0:	01400284 	movi	r5,10
		} else {
			buf[0] = ' ';
			val = num;
		}
		buf[1] = val/100%10 + '0';
		buf[2] = val/10%10 + '0';
     9e4:	14000c04 	addi	r16,r2,48
		buf[3] = val%10 + '0';
     9e8:	000123c0 	call	123c <__modsi3>
     9ec:	10c00c04 	addi	r3,r2,48

void print_number(char num) {
	int i;
	char buf[5];
	char val;
	for (i = 0; i < 4; i++) {
     9f0:	94800044 	addi	r18,r18,1
     9f4:	00800104 	movi	r2,4
     9f8:	90bfdc1e 	bne	r18,r2,96c <print_number+0x24>
		}
		buf[1] = val/100%10 + '0';
		buf[2] = val/10%10 + '0';
		buf[3] = val%10 + '0';
	}
	clear_block(HEX0_3);
     9fc:	0009883a 	mov	r4,zero
     a00:	d8c000c5 	stb	r3,3(sp)
     a04:	dc000085 	stb	r16,2(sp)
     a08:	dcc00045 	stb	r19,1(sp)
     a0c:	dd000005 	stb	r20,0(sp)
     a10:	00008f80 	call	8f8 <clear_block>
	print_block(buf, 4, HEX0_3);
     a14:	900b883a 	mov	r5,r18
     a18:	d809883a 	mov	r4,sp
     a1c:	000d883a 	mov	r6,zero
     a20:	000081c0 	call	81c <print_block>
}
     a24:	dfc00717 	ldw	ra,28(sp)
     a28:	dd000617 	ldw	r20,24(sp)
     a2c:	dcc00517 	ldw	r19,20(sp)
     a30:	dc800417 	ldw	r18,16(sp)
     a34:	dc400317 	ldw	r17,12(sp)
     a38:	dc000217 	ldw	r16,8(sp)
     a3c:	dec00804 	addi	sp,sp,32
     a40:	f800283a 	ret

00000a44 <push_decode>:
	global_registers[Ssw_rw] = (char)s.splited.rw_mode;
	global_registers[Ssw_run] = (char)s.splited.run_mode;
}

enum PushEvent push_decode(char psw) {
	switch(psw) {
     a44:	21003fcc 	andi	r4,r4,255
     a48:	2100201c 	xori	r4,r4,128
     a4c:	213fe004 	addi	r4,r4,-128
     a50:	00800144 	movi	r2,5
     a54:	20800826 	beq	r4,r2,a78 <push_decode+0x34>
     a58:	00800184 	movi	r2,6
     a5c:	00c00104 	movi	r3,4
     a60:	20800626 	beq	r4,r2,a7c <push_decode+0x38>
     a64:	008000c4 	movi	r2,3
     a68:	0007883a 	mov	r3,zero
     a6c:	2080031e 	bne	r4,r2,a7c <push_decode+0x38>
     a70:	00c00084 	movi	r3,2
     a74:	00000106 	br	a7c <push_decode+0x38>
	case 0x3:
		return PUSH_VALSTR;
     a78:	00c000c4 	movi	r3,3
	case 0x6:
		return PUSH_RUN;
		break;
	}
	return PUSH_NONE;
}
     a7c:	1805883a 	mov	r2,r3
     a80:	f800283a 	ret

00000a84 <push_int>:

void push_int() {
	static unsigned char status = 0;
	static enum PushEvent event_code;
	volatile sw_t s;
	s.sw = *switches;
     a84:	00942404 	movi	r2,20624
     a88:	10800017 	ldw	r2,0(r2)

	switch (status) {
     a8c:	d0e04403 	ldbu	r3,-32496(gp)
		break;
	}
	return PUSH_NONE;
}

void push_int() {
     a90:	deffff04 	addi	sp,sp,-4
	static unsigned char status = 0;
	static enum PushEvent event_code;
	volatile sw_t s;
	s.sw = *switches;

	switch (status) {
     a94:	01000044 	movi	r4,1

void push_int() {
	static unsigned char status = 0;
	static enum PushEvent event_code;
	volatile sw_t s;
	s.sw = *switches;
     a98:	d8800015 	stw	r2,0(sp)

	switch (status) {
     a9c:	19003726 	beq	r3,r4,b7c <push_int+0xf8>
     aa0:	19000336 	bltu	r3,r4,ab0 <push_int+0x2c>
     aa4:	00800084 	movi	r2,2
     aa8:	1880421e 	bne	r3,r2,bb4 <push_int+0x130>
     aac:	00003d06 	br	ba4 <push_int+0x120>
	case 0:
		PUSH_EVENT = PUSH_NONE;
		if (*push_switches != 7) {
     ab0:	01142004 	movi	r4,20608
     ab4:	20800003 	ldbu	r2,0(r4)
     ab8:	00c001c4 	movi	r3,7
	volatile sw_t s;
	s.sw = *switches;

	switch (status) {
	case 0:
		PUSH_EVENT = PUSH_NONE;
     abc:	d0204205 	stb	zero,-32504(gp)
		if (*push_switches != 7) {
     ac0:	10803fcc 	andi	r2,r2,255
     ac4:	1080201c 	xori	r2,r2,128
     ac8:	10bfe004 	addi	r2,r2,-128
     acc:	10c01526 	beq	r2,r3,b24 <push_int+0xa0>
			event_code = push_decode(*push_switches);
     ad0:	20800003 	ldbu	r2,0(r4)
	global_registers[Ssw_rw] = (char)s.splited.rw_mode;
	global_registers[Ssw_run] = (char)s.splited.run_mode;
}

enum PushEvent push_decode(char psw) {
	switch(psw) {
     ad4:	10c03fcc 	andi	r3,r2,255
     ad8:	18c0201c 	xori	r3,r3,128
     adc:	18ffe004 	addi	r3,r3,-128
     ae0:	00800144 	movi	r2,5
     ae4:	18800b26 	beq	r3,r2,b14 <push_int+0x90>
     ae8:	00800184 	movi	r2,6
     aec:	18800326 	beq	r3,r2,afc <push_int+0x78>
     af0:	008000c4 	movi	r2,3
     af4:	1880031e 	bne	r3,r2,b04 <push_int+0x80>
     af8:	00000406 	br	b0c <push_int+0x88>
     afc:	00800104 	movi	r2,4
     b00:	00000506 	br	b18 <push_int+0x94>
     b04:	0005883a 	mov	r2,zero
     b08:	00000306 	br	b18 <push_int+0x94>
     b0c:	00800084 	movi	r2,2
     b10:	00000106 	br	b18 <push_int+0x94>
     b14:	008000c4 	movi	r2,3

	switch (status) {
	case 0:
		PUSH_EVENT = PUSH_NONE;
		if (*push_switches != 7) {
			event_code = push_decode(*push_switches);
     b18:	d0a04315 	stw	r2,-32500(gp)
			status = 1;
     b1c:	00800044 	movi	r2,1
     b20:	d0a04405 	stb	r2,-32496(gp)
     b24:	d8800017 	ldw	r2,0(sp)
void in_int() {
	push_int();
}

static void update_sw_reg(sw_t s) {
	global_registers[Ssw_data] = (char)s.data.value;
     b28:	00c00034 	movhi	r3,0
     b2c:	18c8d404 	addi	r3,r3,9040
     b30:	1012d2ba 	srli	r9,r2,10
	global_registers[Ssw_inst] = (char)s.splited.instruction_code;
     b34:	1008d3ba 	srli	r4,r2,14
	global_registers[Ssw_memi] = (char)s.splited.memory_index;
     b38:	100ad1ba 	srli	r5,r2,6
	global_registers[Ssw_regi] = (char)s.splited.register_index;
	global_registers[Ssw_psel] = (char)s.splited.program_selecter;
     b3c:	100cd0ba 	srli	r6,r2,2
	global_registers[Ssw_rw] = (char)s.splited.rw_mode;
     b40:	100ed07a 	srli	r7,r2,1
	push_int();
}

static void update_sw_reg(sw_t s) {
	global_registers[Ssw_data] = (char)s.data.value;
	global_registers[Ssw_inst] = (char)s.splited.instruction_code;
     b44:	210003cc 	andi	r4,r4,15
	global_registers[Ssw_memi] = (char)s.splited.memory_index;
     b48:	294003cc 	andi	r5,r5,15
	global_registers[Ssw_regi] = (char)s.splited.register_index;
     b4c:	4a0003cc 	andi	r8,r9,15
	global_registers[Ssw_psel] = (char)s.splited.program_selecter;
     b50:	318003cc 	andi	r6,r6,15
	global_registers[Ssw_rw] = (char)s.splited.rw_mode;
     b54:	39c0004c 	andi	r7,r7,1
	global_registers[Ssw_run] = (char)s.splited.run_mode;
     b58:	1080004c 	andi	r2,r2,1
     b5c:	18800345 	stb	r2,13(r3)
	push_int();
}

static void update_sw_reg(sw_t s) {
	global_registers[Ssw_data] = (char)s.data.value;
	global_registers[Ssw_inst] = (char)s.splited.instruction_code;
     b60:	19000205 	stb	r4,8(r3)
	global_registers[Ssw_memi] = (char)s.splited.memory_index;
     b64:	19400285 	stb	r5,10(r3)
	global_registers[Ssw_regi] = (char)s.splited.register_index;
     b68:	1a000245 	stb	r8,9(r3)
	global_registers[Ssw_psel] = (char)s.splited.program_selecter;
     b6c:	198002c5 	stb	r6,11(r3)
	global_registers[Ssw_rw] = (char)s.splited.rw_mode;
     b70:	19c00305 	stb	r7,12(r3)
void in_int() {
	push_int();
}

static void update_sw_reg(sw_t s) {
	global_registers[Ssw_data] = (char)s.data.value;
     b74:	1a4001c5 	stb	r9,7(r3)
     b78:	00000f06 	br	bb8 <push_int+0x134>
			status = 1;
		}
		update_sw_reg(s);	// スイッチレジスタ更新
		break;
	case 1:
		if (*push_switches == 7) status = 2;
     b7c:	00942004 	movi	r2,20608
     b80:	10800003 	ldbu	r2,0(r2)
     b84:	00c001c4 	movi	r3,7
     b88:	10803fcc 	andi	r2,r2,255
     b8c:	1080201c 	xori	r2,r2,128
     b90:	10bfe004 	addi	r2,r2,-128
     b94:	10c0081e 	bne	r2,r3,bb8 <push_int+0x134>
     b98:	00800084 	movi	r2,2
     b9c:	d0a04405 	stb	r2,-32496(gp)
     ba0:	00000506 	br	bb8 <push_int+0x134>
		break;
	case 2:
		PUSH_EVENT = event_code;
     ba4:	d0a04317 	ldw	r2,-32500(gp)
		status = 0;
     ba8:	d0204405 	stb	zero,-32496(gp)
		break;
	case 1:
		if (*push_switches == 7) status = 2;
		break;
	case 2:
		PUSH_EVENT = event_code;
     bac:	d0a04205 	stb	r2,-32504(gp)
     bb0:	00000106 	br	bb8 <push_int+0x134>
		status = 0;
		break;
	default:
		status = 0;
     bb4:	d0204405 	stb	zero,-32496(gp)
		break;
	}
}
     bb8:	dec00104 	addi	sp,sp,4
     bbc:	f800283a 	ret

00000bc0 <in_int>:
#include "sys_register.h"

unsigned char PUSH_EVENT = PUSH_NONE;

void in_int() {
	push_int();
     bc0:	0000a841 	jmpi	a84 <push_int>

00000bc4 <inst_jump>:
		break;
	}
}

void inst_jump(enum Register reg, unsigned char memory_index){
	global_registers[Spc]=global_registers[reg]+memory_index;
     bc4:	00c00034 	movhi	r3,0
     bc8:	18c8d404 	addi	r3,r3,9040
     bcc:	20c9883a 	add	r4,r4,r3
     bd0:	20800003 	ldbu	r2,0(r4)
     bd4:	288b883a 	add	r5,r5,r2
     bd8:	19400045 	stb	r5,1(r3)
}
     bdc:	f800283a 	ret

00000be0 <inst_delay>:
void inst_store(enum Register reg, unsigned char memory_index){
	memory_store(memory_index, reg);
}
void inst_delay(enum Register reg, unsigned char memory_index){
	//レジスタの値*10ms待つ
}
     be0:	f800283a 	ret

00000be4 <inst_add>:
void inst_add(enum Register reg, unsigned char memory_index){
	global_registers[Sacc]+=global_registers[reg];
     be4:	00c00034 	movhi	r3,0
     be8:	18c8d404 	addi	r3,r3,9040
     bec:	20c9883a 	add	r4,r4,r3
     bf0:	21000003 	ldbu	r4,0(r4)
     bf4:	18800143 	ldbu	r2,5(r3)
     bf8:	1105883a 	add	r2,r2,r4
     bfc:	18800145 	stb	r2,5(r3)
}
     c00:	f800283a 	ret

00000c04 <inst_comp>:
void inst_comp(enum Register reg, unsigned char memory_index){
	if(global_registers[Sacc]==global_registers[reg]){
     c04:	00c00034 	movhi	r3,0
     c08:	18c8d404 	addi	r3,r3,9040
     c0c:	20c9883a 	add	r4,r4,r3
     c10:	21000007 	ldb	r4,0(r4)
     c14:	18800147 	ldb	r2,5(r3)
     c18:	1100021e 	bne	r2,r4,c24 <inst_comp+0x20>
		global_registers[Sflg]=0;
     c1c:	18000185 	stb	zero,6(r3)
     c20:	f800283a 	ret
	} else if(global_registers[Sacc] > global_registers[reg]){
     c24:	2080020e 	bge	r4,r2,c30 <inst_comp+0x2c>
		global_registers[Sflg]=-1;
     c28:	00bfffc4 	movi	r2,-1
     c2c:	00000106 	br	c34 <inst_comp+0x30>
	}else{
		global_registers[Sflg]=1;
     c30:	00800044 	movi	r2,1
     c34:	18800185 	stb	r2,6(r3)
     c38:	f800283a 	ret

00000c3c <inst_jeq>:
	}
}
void inst_jeq(enum Register reg, unsigned char memory_index){
	if(global_registers[Sflg]==global_registers[reg]){
     c3c:	01400034 	movhi	r5,0
     c40:	2948d404 	addi	r5,r5,9040
     c44:	2149883a 	add	r4,r4,r5
     c48:	20c00007 	ldb	r3,0(r4)
     c4c:	28800187 	ldb	r2,6(r5)
     c50:	10c0031e 	bne	r2,r3,c60 <inst_jeq+0x24>
		global_registers[Spc]++;
     c54:	28800043 	ldbu	r2,1(r5)
     c58:	10800044 	addi	r2,r2,1
     c5c:	28800045 	stb	r2,1(r5)
     c60:	f800283a 	ret

00000c64 <inst_jne>:
	}
}
void inst_jne(enum Register reg, unsigned char memory_index){
	if(global_registers[Sflg]!=global_registers[reg]){
     c64:	01400034 	movhi	r5,0
     c68:	2948d404 	addi	r5,r5,9040
     c6c:	2149883a 	add	r4,r4,r5
     c70:	20c00007 	ldb	r3,0(r4)
     c74:	28800187 	ldb	r2,6(r5)
     c78:	10c00326 	beq	r2,r3,c88 <inst_jne+0x24>
		global_registers[Spc]++;
     c7c:	28800043 	ldbu	r2,1(r5)
     c80:	10800044 	addi	r2,r2,1
     c84:	28800045 	stb	r2,1(r5)
     c88:	f800283a 	ret

00000c8c <inst_jieq>:
	}
}
void inst_jieq(char im, unsigned char memory_index){
	if(global_registers[Sflg]==im){
     c8c:	00c00034 	movhi	r3,0
     c90:	18c8d404 	addi	r3,r3,9040
     c94:	21003fcc 	andi	r4,r4,255
     c98:	18800187 	ldb	r2,6(r3)
     c9c:	2100201c 	xori	r4,r4,128
     ca0:	213fe004 	addi	r4,r4,-128
     ca4:	1100031e 	bne	r2,r4,cb4 <inst_jieq+0x28>
		global_registers[Spc]++;
     ca8:	18800043 	ldbu	r2,1(r3)
     cac:	10800044 	addi	r2,r2,1
     cb0:	18800045 	stb	r2,1(r3)
     cb4:	f800283a 	ret

00000cb8 <inst_jine>:
	}
}
void inst_jine(char im, unsigned char memory_index){
	if(global_registers[Sflg]!=im){
     cb8:	00c00034 	movhi	r3,0
     cbc:	18c8d404 	addi	r3,r3,9040
     cc0:	21003fcc 	andi	r4,r4,255
     cc4:	18800187 	ldb	r2,6(r3)
     cc8:	2100201c 	xori	r4,r4,128
     ccc:	213fe004 	addi	r4,r4,-128
     cd0:	11000326 	beq	r2,r4,ce0 <inst_jine+0x28>
		global_registers[Spc]++;
     cd4:	18800043 	ldbu	r2,1(r3)
     cd8:	10800044 	addi	r2,r2,1
     cdc:	18800045 	stb	r2,1(r3)
     ce0:	f800283a 	ret

00000ce4 <inst_store>:
	print_block(buf, 4, HEX0_3);
}
void inst_load(enum Register reg, unsigned char memory_index){
	memory_load(memory_index, reg);
}
void inst_store(enum Register reg, unsigned char memory_index){
     ce4:	2005883a 	mov	r2,r4
	memory_store(memory_index, reg);
     ce8:	29003fcc 	andi	r4,r5,255
     cec:	100b883a 	mov	r5,r2
     cf0:	00010a81 	jmpi	10a8 <memory_store>

00000cf4 <inst_load>:
	char buf[5];
	memory_load(memory_index, Sseg);
	sprintf(buf, "%04d", global_registers[Sseg]);
	print_block(buf, 4, HEX0_3);
}
void inst_load(enum Register reg, unsigned char memory_index){
     cf4:	2005883a 	mov	r2,r4
	memory_load(memory_index, reg);
     cf8:	29003fcc 	andi	r4,r5,255
     cfc:	100b883a 	mov	r5,r2
     d00:	00010381 	jmpi	1038 <memory_load>

00000d04 <inst_output>:
}

void inst_jump(enum Register reg, unsigned char memory_index){
	global_registers[Spc]=global_registers[reg]+memory_index;
}
void inst_output(enum Register reg, unsigned char memory_index){
     d04:	defffd04 	addi	sp,sp,-12
	//メモリの値を7セグに表示
	char buf[5];
	memory_load(memory_index, Sseg);
     d08:	29003fcc 	andi	r4,r5,255
     d0c:	01400384 	movi	r5,14
}

void inst_jump(enum Register reg, unsigned char memory_index){
	global_registers[Spc]=global_registers[reg]+memory_index;
}
void inst_output(enum Register reg, unsigned char memory_index){
     d10:	dfc00215 	stw	ra,8(sp)
	//メモリの値を7セグに表示
	char buf[5];
	memory_load(memory_index, Sseg);
     d14:	00010380 	call	1038 <memory_load>
	sprintf(buf, "%04d", global_registers[Sseg]);
     d18:	00800034 	movhi	r2,0
     d1c:	1088d404 	addi	r2,r2,9040
     d20:	11800387 	ldb	r6,14(r2)
     d24:	d809883a 	mov	r4,sp
     d28:	01400034 	movhi	r5,0
     d2c:	29475604 	addi	r5,r5,7512
     d30:	00012e40 	call	12e4 <sprintf>
	print_block(buf, 4, HEX0_3);
     d34:	d809883a 	mov	r4,sp
     d38:	01400104 	movi	r5,4
     d3c:	000d883a 	mov	r6,zero
     d40:	000081c0 	call	81c <print_block>
}
     d44:	dfc00217 	ldw	ra,8(sp)
     d48:	dec00304 	addi	sp,sp,12
     d4c:	f800283a 	ret

00000d50 <inst_fetch>:
#include "sys_register.h"
#include "hex_out.h"
#include <stdio.h>

struct InstRec inst_fetch(){
	return inst_memory_load((unsigned int)global_registers[Spc]++);
     d50:	00c00034 	movhi	r3,0
     d54:	18c8d404 	addi	r3,r3,9040
     d58:	18800043 	ldbu	r2,1(r3)
#include "sys_memory.h"
#include "sys_register.h"
#include "hex_out.h"
#include <stdio.h>

struct InstRec inst_fetch(){
     d5c:	deffff04 	addi	sp,sp,-4
     d60:	dfc00015 	stw	ra,0(sp)
	return inst_memory_load((unsigned int)global_registers[Spc]++);
     d64:	11003fcc 	andi	r4,r2,255
     d68:	2100201c 	xori	r4,r4,128
     d6c:	213fe004 	addi	r4,r4,-128
     d70:	10800044 	addi	r2,r2,1
     d74:	18800045 	stb	r2,1(r3)
     d78:	0000fbc0 	call	fbc <inst_memory_load>
}
     d7c:	dfc00017 	ldw	ra,0(sp)
     d80:	dec00104 	addi	sp,sp,4
     d84:	f800283a 	ret

00000d88 <inst_decode>:

void inst_decode(struct InstRec inst_rec){
     d88:	2004d13a 	srli	r2,r4,4
     d8c:	2006d23a 	srli	r3,r4,8
	switch(inst_rec.inst) {
     d90:	210003cc 	andi	r4,r4,15
     d94:	21bfffc4 	addi	r6,r4,-1

struct InstRec inst_fetch(){
	return inst_memory_load((unsigned int)global_registers[Spc]++);
}

void inst_decode(struct InstRec inst_rec){
     d98:	114003cc 	andi	r5,r2,15
	switch(inst_rec.inst) {
     d9c:	00800284 	movi	r2,10

struct InstRec inst_fetch(){
	return inst_memory_load((unsigned int)global_registers[Spc]++);
}

void inst_decode(struct InstRec inst_rec){
     da0:	190003cc 	andi	r4,r3,15
	switch(inst_rec.inst) {
     da4:	11805336 	bltu	r2,r6,ef4 <inst_decode+0x16c>
     da8:	3185883a 	add	r2,r6,r6
     dac:	1085883a 	add	r2,r2,r2
     db0:	00c00034 	movhi	r3,0
     db4:	18c37104 	addi	r3,r3,3524
     db8:	10c5883a 	add	r2,r2,r3
     dbc:	10800017 	ldw	r2,0(r2)
     dc0:	1000683a 	jmp	r2
     dc4:	00000df0 	cmpltui	zero,zero,55
     dc8:	00000e10 	cmplti	zero,zero,56
     dcc:	00000e1c 	xori	zero,zero,56
     dd0:	00000e28 	cmpgeui	zero,zero,56
     dd4:	00000ef4 	movhi	zero,59
     dd8:	00000e34 	movhi	zero,56
     ddc:	00000e58 	cmpnei	zero,zero,57
     de0:	00000e64 	muli	zero,zero,57
     de4:	00000e84 	movi	zero,58
     de8:	00000eb0 	cmpltui	zero,zero,58
     dec:	00000ed4 	movui	zero,59
		break;
	}
}

void inst_jump(enum Register reg, unsigned char memory_index){
	global_registers[Spc]=global_registers[reg]+memory_index;
     df0:	00c00034 	movhi	r3,0
     df4:	18c8d404 	addi	r3,r3,9040
     df8:	20803fcc 	andi	r2,r4,255
     dfc:	10c5883a 	add	r2,r2,r3
     e00:	10800003 	ldbu	r2,0(r2)
     e04:	2885883a 	add	r2,r5,r2
     e08:	18800045 	stb	r2,1(r3)
     e0c:	f800283a 	ret
		break;
	case INST_JUMP:
		inst_jump(inst_rec.regi, inst_rec.memi);
		break;
	case INST_OUTPUT:
		inst_output(inst_rec.regi, inst_rec.memi);
     e10:	21003fcc 	andi	r4,r4,255
     e14:	29403fcc 	andi	r5,r5,255
     e18:	0000d041 	jmpi	d04 <inst_output>
		break;
	case INST_LOAD:
		inst_load(inst_rec.regi, inst_rec.memi);
     e1c:	21003fcc 	andi	r4,r4,255
     e20:	29403fcc 	andi	r5,r5,255
     e24:	0000cf41 	jmpi	cf4 <inst_load>
		break;
	case INST_STORE:
		inst_store(inst_rec.regi, inst_rec.memi);
     e28:	21003fcc 	andi	r4,r4,255
     e2c:	29403fcc 	andi	r5,r5,255
     e30:	0000ce41 	jmpi	ce4 <inst_store>
}
void inst_delay(enum Register reg, unsigned char memory_index){
	//レジスタの値*10ms待つ
}
void inst_add(enum Register reg, unsigned char memory_index){
	global_registers[Sacc]+=global_registers[reg];
     e34:	00c00034 	movhi	r3,0
     e38:	18c8d404 	addi	r3,r3,9040
     e3c:	20803fcc 	andi	r2,r4,255
     e40:	10c5883a 	add	r2,r2,r3
     e44:	11000003 	ldbu	r4,0(r2)
     e48:	18800143 	ldbu	r2,5(r3)
     e4c:	1105883a 	add	r2,r2,r4
     e50:	18800145 	stb	r2,5(r3)
     e54:	f800283a 	ret
		break;
	case INST_ADD:
		inst_add(inst_rec.regi, inst_rec.memi);
		break;
	case INST_COMP:
		inst_comp(inst_rec.regi, inst_rec.memi);
     e58:	21003fcc 	andi	r4,r4,255
     e5c:	29403fcc 	andi	r5,r5,255
     e60:	0000c041 	jmpi	c04 <inst_comp>
	}else{
		global_registers[Sflg]=1;
	}
}
void inst_jeq(enum Register reg, unsigned char memory_index){
	if(global_registers[Sflg]==global_registers[reg]){
     e64:	20803fcc 	andi	r2,r4,255
     e68:	01000034 	movhi	r4,0
     e6c:	2108d404 	addi	r4,r4,9040
     e70:	1105883a 	add	r2,r2,r4
     e74:	10c00007 	ldb	r3,0(r2)
     e78:	20800187 	ldb	r2,6(r4)
     e7c:	10c01d1e 	bne	r2,r3,ef4 <inst_decode+0x16c>
     e80:	00000706 	br	ea0 <inst_decode+0x118>
		global_registers[Spc]++;
	}
}
void inst_jne(enum Register reg, unsigned char memory_index){
	if(global_registers[Sflg]!=global_registers[reg]){
     e84:	20803fcc 	andi	r2,r4,255
     e88:	01000034 	movhi	r4,0
     e8c:	2108d404 	addi	r4,r4,9040
     e90:	1105883a 	add	r2,r2,r4
     e94:	10c00007 	ldb	r3,0(r2)
     e98:	20800187 	ldb	r2,6(r4)
     e9c:	10c01526 	beq	r2,r3,ef4 <inst_decode+0x16c>
		global_registers[Spc]++;
     ea0:	20800043 	ldbu	r2,1(r4)
     ea4:	10800044 	addi	r2,r2,1
     ea8:	20800045 	stb	r2,1(r4)
     eac:	f800283a 	ret
	}
}
void inst_jieq(char im, unsigned char memory_index){
	if(global_registers[Sflg]==im){
     eb0:	01400034 	movhi	r5,0
     eb4:	2948d404 	addi	r5,r5,9040
     eb8:	28c00187 	ldb	r3,6(r5)
     ebc:	208003cc 	andi	r2,r4,15
     ec0:	18800c1e 	bne	r3,r2,ef4 <inst_decode+0x16c>
		global_registers[Spc]++;
     ec4:	28800043 	ldbu	r2,1(r5)
     ec8:	10800044 	addi	r2,r2,1
     ecc:	28800045 	stb	r2,1(r5)
     ed0:	f800283a 	ret
	}
}
void inst_jine(char im, unsigned char memory_index){
	if(global_registers[Sflg]!=im){
     ed4:	01400034 	movhi	r5,0
     ed8:	2948d404 	addi	r5,r5,9040
     edc:	28c00187 	ldb	r3,6(r5)
     ee0:	208003cc 	andi	r2,r4,15
     ee4:	18800326 	beq	r3,r2,ef4 <inst_decode+0x16c>
		global_registers[Spc]++;
     ee8:	28800043 	ldbu	r2,1(r5)
     eec:	10800044 	addi	r2,r2,1
     ef0:	28800045 	stb	r2,1(r5)
     ef4:	f800283a 	ret

00000ef8 <memory_init>:

/**************************************************
 *						Impl
 **************************************************/

void memory_init() {
     ef8:	000b883a 	mov	r5,zero
     efc:	00000806 	br	f20 <memory_init+0x28>
	int i, j;
	for (i = 0; i < MEMS_COUNT; i++)
	for (j = 0; j < MEM_SIZE; j++) {
     f00:	21000044 	addi	r4,r4,1
     f04:	00800404 	movi	r2,16
		memory[i][j] = 0;
     f08:	18000005 	stb	zero,0(r3)
 **************************************************/

void memory_init() {
	int i, j;
	for (i = 0; i < MEMS_COUNT; i++)
	for (j = 0; j < MEM_SIZE; j++) {
     f0c:	18c00044 	addi	r3,r3,1
     f10:	20bffb1e 	bne	r4,r2,f00 <memory_init+0x8>
 *						Impl
 **************************************************/

void memory_init() {
	int i, j;
	for (i = 0; i < MEMS_COUNT; i++)
     f14:	29400044 	addi	r5,r5,1
     f18:	00800104 	movi	r2,4
     f1c:	28800626 	beq	r5,r2,f38 <memory_init+0x40>
	for (j = 0; j < MEM_SIZE; j++) {
		memory[i][j] = 0;
	}
}
     f20:	2806913a 	slli	r3,r5,4
     f24:	00800034 	movhi	r2,0
     f28:	10888404 	addi	r2,r2,8720
     f2c:	0009883a 	mov	r4,zero
     f30:	1887883a 	add	r3,r3,r2
     f34:	003ff206 	br	f00 <memory_init+0x8>
     f38:	f800283a 	ret

00000f3c <inst_memory_store>:

void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){
	inst_memory[global_current_memory][mem_addr] = inst_rec;
     f3c:	d1a04517 	ldw	r6,-32492(gp)
     f40:	2810d23a 	srli	r8,r5,8
	for (j = 0; j < MEM_SIZE; j++) {
		memory[i][j] = 0;
	}
}

void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){
     f44:	024003c4 	movi	r9,15
	inst_memory[global_current_memory][mem_addr] = inst_rec;
     f48:	300c913a 	slli	r6,r6,4
	for (j = 0; j < MEM_SIZE; j++) {
		memory[i][j] = 0;
	}
}

void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){
     f4c:	280ed13a 	srli	r7,r5,4
	inst_memory[global_current_memory][mem_addr] = inst_rec;
     f50:	00800034 	movhi	r2,0
     f54:	10889404 	addi	r2,r2,8784
     f58:	310d883a 	add	r6,r6,r4
     f5c:	318d883a 	add	r6,r6,r6
     f60:	318d883a 	add	r6,r6,r6
     f64:	010003c4 	movi	r4,15
     f68:	308d883a 	add	r6,r6,r2
     f6c:	4250703a 	and	r8,r8,r9
     f70:	4110703a 	and	r8,r8,r4
     f74:	30800017 	ldw	r2,0(r6)
	for (j = 0; j < MEM_SIZE; j++) {
		memory[i][j] = 0;
	}
}

void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){
     f78:	3a4e703a 	and	r7,r7,r9
	inst_memory[global_current_memory][mem_addr] = inst_rec;
     f7c:	4010923a 	slli	r8,r8,8
     f80:	21ce703a 	and	r7,r4,r7
     f84:	00fc3fc4 	movi	r3,-3841
     f88:	10c4703a 	and	r2,r2,r3
     f8c:	380e913a 	slli	r7,r7,4
     f90:	00ffc3c4 	movi	r3,-241
     f94:	1204b03a 	or	r2,r2,r8
     f98:	10c4703a 	and	r2,r2,r3
     f9c:	11c4b03a 	or	r2,r2,r7
	for (j = 0; j < MEM_SIZE; j++) {
		memory[i][j] = 0;
	}
}

void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){
     fa0:	2a4a703a 	and	r5,r5,r9
	inst_memory[global_current_memory][mem_addr] = inst_rec;
     fa4:	00fffc04 	movi	r3,-16
     fa8:	2148703a 	and	r4,r4,r5
     fac:	10c4703a 	and	r2,r2,r3
     fb0:	1104b03a 	or	r2,r2,r4
     fb4:	30800015 	stw	r2,0(r6)
}
     fb8:	f800283a 	ret

00000fbc <inst_memory_load>:
struct InstRec inst_memory_load(unsigned int mem_addr){
	return inst_memory[global_current_memory][mem_addr];
     fbc:	d0a04517 	ldw	r2,-32492(gp)
     fc0:	00c00034 	movhi	r3,0
     fc4:	18c89404 	addi	r3,r3,8784
     fc8:	01c003c4 	movi	r7,15
     fcc:	1004913a 	slli	r2,r2,4
     fd0:	018003c4 	movi	r6,15
     fd4:	1105883a 	add	r2,r2,r4
     fd8:	1085883a 	add	r2,r2,r2
     fdc:	1085883a 	add	r2,r2,r2
     fe0:	10c5883a 	add	r2,r2,r3
     fe4:	11400017 	ldw	r5,0(r2)
     fe8:	00bc3fc4 	movi	r2,-3841
     fec:	1084703a 	and	r2,r2,r2
     ff0:	2806d23a 	srli	r3,r5,8
     ff4:	2808d13a 	srli	r4,r5,4
     ff8:	29ca703a 	and	r5,r5,r7
     ffc:	19c6703a 	and	r3,r3,r7
    1000:	1986703a 	and	r3,r3,r6
    1004:	21c8703a 	and	r4,r4,r7
    1008:	1806923a 	slli	r3,r3,8
    100c:	3108703a 	and	r4,r6,r4
    1010:	2008913a 	slli	r4,r4,4
    1014:	10c4b03a 	or	r2,r2,r3
    1018:	00ffc3c4 	movi	r3,-241
    101c:	10c4703a 	and	r2,r2,r3
    1020:	1104b03a 	or	r2,r2,r4
    1024:	00fffc04 	movi	r3,-16
    1028:	314c703a 	and	r6,r6,r5
    102c:	10c4703a 	and	r2,r2,r3
}
    1030:	1184b03a 	or	r2,r2,r6
    1034:	f800283a 	ret

00001038 <memory_load>:
	if (!(mem_addr < MEM_SIZE)) panic();
	memory[global_current_memory][mem_addr] = global_registers[reg];
	return memory[global_current_memory][mem_addr];
}

char memory_load(unsigned int mem_addr, enum Register reg) {
    1038:	defffd04 	addi	sp,sp,-12
	if (!(mem_addr < MEM_SIZE)) panic();
    103c:	008003c4 	movi	r2,15
	if (!(mem_addr < MEM_SIZE)) panic();
	memory[global_current_memory][mem_addr] = global_registers[reg];
	return memory[global_current_memory][mem_addr];
}

char memory_load(unsigned int mem_addr, enum Register reg) {
    1040:	dc400115 	stw	r17,4(sp)
    1044:	dc000015 	stw	r16,0(sp)
    1048:	dfc00215 	stw	ra,8(sp)
    104c:	2021883a 	mov	r16,r4
    1050:	2823883a 	mov	r17,r5
	if (!(mem_addr < MEM_SIZE)) panic();
    1054:	1100012e 	bgeu	r2,r4,105c <memory_load+0x24>
    1058:	00011340 	call	1134 <panic>
	global_registers[reg] = memory[global_current_memory][mem_addr];
    105c:	d0a04517 	ldw	r2,-32492(gp)
    1060:	00c00034 	movhi	r3,0
    1064:	18c88404 	addi	r3,r3,8720
    1068:	01000034 	movhi	r4,0
    106c:	2108d404 	addi	r4,r4,9040
    1070:	1004913a 	slli	r2,r2,4
    1074:	8909883a 	add	r4,r17,r4
    1078:	10c5883a 	add	r2,r2,r3
    107c:	1405883a 	add	r2,r2,r16
    1080:	10800003 	ldbu	r2,0(r2)
    1084:	20800005 	stb	r2,0(r4)
	return global_registers[reg];
}
    1088:	10803fcc 	andi	r2,r2,255
    108c:	1080201c 	xori	r2,r2,128
    1090:	10bfe004 	addi	r2,r2,-128
    1094:	dfc00217 	ldw	ra,8(sp)
    1098:	dc400117 	ldw	r17,4(sp)
    109c:	dc000017 	ldw	r16,0(sp)
    10a0:	dec00304 	addi	sp,sp,12
    10a4:	f800283a 	ret

000010a8 <memory_store>:
}
struct InstRec inst_memory_load(unsigned int mem_addr){
	return inst_memory[global_current_memory][mem_addr];
}

char memory_store(unsigned int mem_addr, enum Register reg) {
    10a8:	defffd04 	addi	sp,sp,-12
	if (!(mem_addr < MEM_SIZE)) panic();
    10ac:	008003c4 	movi	r2,15
}
struct InstRec inst_memory_load(unsigned int mem_addr){
	return inst_memory[global_current_memory][mem_addr];
}

char memory_store(unsigned int mem_addr, enum Register reg) {
    10b0:	dc400115 	stw	r17,4(sp)
    10b4:	dc000015 	stw	r16,0(sp)
    10b8:	dfc00215 	stw	ra,8(sp)
    10bc:	2023883a 	mov	r17,r4
    10c0:	2821883a 	mov	r16,r5
	if (!(mem_addr < MEM_SIZE)) panic();
    10c4:	1100012e 	bgeu	r2,r4,10cc <memory_store+0x24>
    10c8:	00011340 	call	1134 <panic>
	memory[global_current_memory][mem_addr] = global_registers[reg];
    10cc:	d0e04517 	ldw	r3,-32492(gp)
    10d0:	00800034 	movhi	r2,0
    10d4:	1088d404 	addi	r2,r2,9040
    10d8:	8085883a 	add	r2,r16,r2
    10dc:	1806913a 	slli	r3,r3,4
    10e0:	10800003 	ldbu	r2,0(r2)
    10e4:	01000034 	movhi	r4,0
    10e8:	21088404 	addi	r4,r4,8720
    10ec:	1907883a 	add	r3,r3,r4
    10f0:	1c47883a 	add	r3,r3,r17
    10f4:	18800005 	stb	r2,0(r3)
	return memory[global_current_memory][mem_addr];
}
    10f8:	10803fcc 	andi	r2,r2,255
    10fc:	1080201c 	xori	r2,r2,128
    1100:	10bfe004 	addi	r2,r2,-128
    1104:	dfc00217 	ldw	ra,8(sp)
    1108:	dc400117 	ldw	r17,4(sp)
    110c:	dc000017 	ldw	r16,0(sp)
    1110:	dec00304 	addi	sp,sp,12
    1114:	f800283a 	ret

00001118 <registers_init>:
 */
#include "sys_register.h"

char global_registers[REG_MAX_COUNT];

void registers_init() {
    1118:	00800034 	movhi	r2,0
    111c:	1088d404 	addi	r2,r2,9040
    1120:	10c003c4 	addi	r3,r2,15
	int i;
	for (i = 0; i < REG_MAX_COUNT; i++) global_registers[i] = 0;
    1124:	10000005 	stb	zero,0(r2)
    1128:	10800044 	addi	r2,r2,1
    112c:	10fffd1e 	bne	r2,r3,1124 <registers_init+0xc>
}
    1130:	f800283a 	ret

00001134 <panic>:
 *      Author: takayun
 */
#include "system.h"
#include "hex_out.h"

void panic() {
    1134:	deffff04 	addi	sp,sp,-4
	clear_block(HEX0_3);
    1138:	0009883a 	mov	r4,zero
 *      Author: takayun
 */
#include "system.h"
#include "hex_out.h"

void panic() {
    113c:	dfc00015 	stw	ra,0(sp)
	clear_block(HEX0_3);
    1140:	00008f80 	call	8f8 <clear_block>
	print_block("err ", 4, HEX0_3);
    1144:	01400104 	movi	r5,4
    1148:	01000034 	movhi	r4,0
    114c:	21076004 	addi	r4,r4,7552
    1150:	000d883a 	mov	r6,zero
}
    1154:	dfc00017 	ldw	ra,0(sp)
    1158:	dec00104 	addi	sp,sp,4
#include "system.h"
#include "hex_out.h"

void panic() {
	clear_block(HEX0_3);
	print_block("err ", 4, HEX0_3);
    115c:	000081c1 	jmpi	81c <print_block>

00001160 <udivmodsi4>:
    1160:	29001b2e 	bgeu	r5,r4,11d0 <udivmodsi4+0x70>
    1164:	28001a16 	blt	r5,zero,11d0 <udivmodsi4+0x70>
    1168:	00800044 	movi	r2,1
    116c:	0007883a 	mov	r3,zero
    1170:	01c007c4 	movi	r7,31
    1174:	00000306 	br	1184 <udivmodsi4+0x24>
    1178:	19c01326 	beq	r3,r7,11c8 <udivmodsi4+0x68>
    117c:	18c00044 	addi	r3,r3,1
    1180:	28000416 	blt	r5,zero,1194 <udivmodsi4+0x34>
    1184:	294b883a 	add	r5,r5,r5
    1188:	1085883a 	add	r2,r2,r2
    118c:	293ffa36 	bltu	r5,r4,1178 <udivmodsi4+0x18>
    1190:	10000d26 	beq	r2,zero,11c8 <udivmodsi4+0x68>
    1194:	0007883a 	mov	r3,zero
    1198:	21400236 	bltu	r4,r5,11a4 <udivmodsi4+0x44>
    119c:	2149c83a 	sub	r4,r4,r5
    11a0:	1886b03a 	or	r3,r3,r2
    11a4:	1004d07a 	srli	r2,r2,1
    11a8:	280ad07a 	srli	r5,r5,1
    11ac:	103ffa1e 	bne	r2,zero,1198 <udivmodsi4+0x38>
    11b0:	30000226 	beq	r6,zero,11bc <udivmodsi4+0x5c>
    11b4:	2005883a 	mov	r2,r4
    11b8:	f800283a 	ret
    11bc:	1809883a 	mov	r4,r3
    11c0:	2005883a 	mov	r2,r4
    11c4:	f800283a 	ret
    11c8:	0007883a 	mov	r3,zero
    11cc:	003ff806 	br	11b0 <udivmodsi4+0x50>
    11d0:	00800044 	movi	r2,1
    11d4:	0007883a 	mov	r3,zero
    11d8:	003fef06 	br	1198 <udivmodsi4+0x38>

000011dc <__divsi3>:
    11dc:	defffe04 	addi	sp,sp,-8
    11e0:	dc000015 	stw	r16,0(sp)
    11e4:	dfc00115 	stw	ra,4(sp)
    11e8:	0021883a 	mov	r16,zero
    11ec:	20000c16 	blt	r4,zero,1220 <__divsi3+0x44>
    11f0:	000d883a 	mov	r6,zero
    11f4:	28000e16 	blt	r5,zero,1230 <__divsi3+0x54>
    11f8:	00011600 	call	1160 <udivmodsi4>
    11fc:	1007883a 	mov	r3,r2
    1200:	8005003a 	cmpeq	r2,r16,zero
    1204:	1000011e 	bne	r2,zero,120c <__divsi3+0x30>
    1208:	00c7c83a 	sub	r3,zero,r3
    120c:	1805883a 	mov	r2,r3
    1210:	dfc00117 	ldw	ra,4(sp)
    1214:	dc000017 	ldw	r16,0(sp)
    1218:	dec00204 	addi	sp,sp,8
    121c:	f800283a 	ret
    1220:	0109c83a 	sub	r4,zero,r4
    1224:	04000044 	movi	r16,1
    1228:	000d883a 	mov	r6,zero
    122c:	283ff20e 	bge	r5,zero,11f8 <__divsi3+0x1c>
    1230:	014bc83a 	sub	r5,zero,r5
    1234:	8021003a 	cmpeq	r16,r16,zero
    1238:	003fef06 	br	11f8 <__divsi3+0x1c>

0000123c <__modsi3>:
    123c:	deffff04 	addi	sp,sp,-4
    1240:	dfc00015 	stw	ra,0(sp)
    1244:	01800044 	movi	r6,1
    1248:	2807883a 	mov	r3,r5
    124c:	20000416 	blt	r4,zero,1260 <__modsi3+0x24>
    1250:	28000c16 	blt	r5,zero,1284 <__modsi3+0x48>
    1254:	dfc00017 	ldw	ra,0(sp)
    1258:	dec00104 	addi	sp,sp,4
    125c:	00011601 	jmpi	1160 <udivmodsi4>
    1260:	0109c83a 	sub	r4,zero,r4
    1264:	28000b16 	blt	r5,zero,1294 <__modsi3+0x58>
    1268:	180b883a 	mov	r5,r3
    126c:	01800044 	movi	r6,1
    1270:	00011600 	call	1160 <udivmodsi4>
    1274:	0085c83a 	sub	r2,zero,r2
    1278:	dfc00017 	ldw	ra,0(sp)
    127c:	dec00104 	addi	sp,sp,4
    1280:	f800283a 	ret
    1284:	014bc83a 	sub	r5,zero,r5
    1288:	dfc00017 	ldw	ra,0(sp)
    128c:	dec00104 	addi	sp,sp,4
    1290:	00011601 	jmpi	1160 <udivmodsi4>
    1294:	0147c83a 	sub	r3,zero,r5
    1298:	003ff306 	br	1268 <__modsi3+0x2c>

0000129c <__udivsi3>:
    129c:	000d883a 	mov	r6,zero
    12a0:	00011601 	jmpi	1160 <udivmodsi4>

000012a4 <__umodsi3>:
    12a4:	01800044 	movi	r6,1
    12a8:	00011601 	jmpi	1160 <udivmodsi4>

000012ac <__mulsi3>:
    12ac:	20000a26 	beq	r4,zero,12d8 <__mulsi3+0x2c>
    12b0:	0007883a 	mov	r3,zero
    12b4:	2080004c 	andi	r2,r4,1
    12b8:	1005003a 	cmpeq	r2,r2,zero
    12bc:	2008d07a 	srli	r4,r4,1
    12c0:	1000011e 	bne	r2,zero,12c8 <__mulsi3+0x1c>
    12c4:	1947883a 	add	r3,r3,r5
    12c8:	294b883a 	add	r5,r5,r5
    12cc:	203ff91e 	bne	r4,zero,12b4 <__mulsi3+0x8>
    12d0:	1805883a 	mov	r2,r3
    12d4:	f800283a 	ret
    12d8:	0007883a 	mov	r3,zero
    12dc:	1805883a 	mov	r2,r3
    12e0:	f800283a 	ret

000012e4 <sprintf>:
    12e4:	defff504 	addi	sp,sp,-44
    12e8:	2015883a 	mov	r10,r4
    12ec:	dfc00815 	stw	ra,32(sp)
    12f0:	d9800915 	stw	r6,36(sp)
    12f4:	d9c00a15 	stw	r7,40(sp)
    12f8:	d8800904 	addi	r2,sp,36
    12fc:	d8800015 	stw	r2,0(sp)
    1300:	00800034 	movhi	r2,0
    1304:	10883c04 	addi	r2,r2,8432
    1308:	11000017 	ldw	r4,0(r2)
    130c:	d9c00017 	ldw	r7,0(sp)
    1310:	00808204 	movi	r2,520
    1314:	02200034 	movhi	r8,32768
    1318:	423fffc4 	addi	r8,r8,-1
    131c:	280d883a 	mov	r6,r5
    1320:	d880010d 	sth	r2,4(sp)
    1324:	00c00034 	movhi	r3,0
    1328:	18c6c604 	addi	r3,r3,6936
    132c:	d9400104 	addi	r5,sp,4
    1330:	00bfffc4 	movi	r2,-1
    1334:	d8c00215 	stw	r3,8(sp)
    1338:	da800315 	stw	r10,12(sp)
    133c:	da000415 	stw	r8,16(sp)
    1340:	d880018d 	sth	r2,6(sp)
    1344:	da800515 	stw	r10,20(sp)
    1348:	da000615 	stw	r8,24(sp)
    134c:	d8000715 	stw	zero,28(sp)
    1350:	00014580 	call	1458 <___vfprintf_internal_r>
    1354:	d8c00517 	ldw	r3,20(sp)
    1358:	18000005 	stb	zero,0(r3)
    135c:	dfc00817 	ldw	ra,32(sp)
    1360:	dec00b04 	addi	sp,sp,44
    1364:	f800283a 	ret

00001368 <_sprintf_r>:
    1368:	defff604 	addi	sp,sp,-40
    136c:	2815883a 	mov	r10,r5
    1370:	dfc00815 	stw	ra,32(sp)
    1374:	d9c00915 	stw	r7,36(sp)
    1378:	d8800904 	addi	r2,sp,36
    137c:	d8800015 	stw	r2,0(sp)
    1380:	100f883a 	mov	r7,r2
    1384:	00808204 	movi	r2,520
    1388:	02200034 	movhi	r8,32768
    138c:	423fffc4 	addi	r8,r8,-1
    1390:	d880010d 	sth	r2,4(sp)
    1394:	00c00034 	movhi	r3,0
    1398:	18c6c604 	addi	r3,r3,6936
    139c:	d9400104 	addi	r5,sp,4
    13a0:	00bfffc4 	movi	r2,-1
    13a4:	d8c00215 	stw	r3,8(sp)
    13a8:	da800315 	stw	r10,12(sp)
    13ac:	da000415 	stw	r8,16(sp)
    13b0:	d880018d 	sth	r2,6(sp)
    13b4:	da800515 	stw	r10,20(sp)
    13b8:	da000615 	stw	r8,24(sp)
    13bc:	d8000715 	stw	zero,28(sp)
    13c0:	00014580 	call	1458 <___vfprintf_internal_r>
    13c4:	d8c00517 	ldw	r3,20(sp)
    13c8:	18000005 	stb	zero,0(r3)
    13cc:	dfc00817 	ldw	ra,32(sp)
    13d0:	dec00a04 	addi	sp,sp,40
    13d4:	f800283a 	ret

000013d8 <print_repeat>:
    13d8:	defffb04 	addi	sp,sp,-20
    13dc:	dc800315 	stw	r18,12(sp)
    13e0:	dc400215 	stw	r17,8(sp)
    13e4:	dc000115 	stw	r16,4(sp)
    13e8:	dfc00415 	stw	ra,16(sp)
    13ec:	2025883a 	mov	r18,r4
    13f0:	2823883a 	mov	r17,r5
    13f4:	3821883a 	mov	r16,r7
    13f8:	d9800005 	stb	r6,0(sp)
    13fc:	9009883a 	mov	r4,r18
    1400:	880b883a 	mov	r5,r17
    1404:	d80d883a 	mov	r6,sp
    1408:	01c00044 	movi	r7,1
    140c:	04000b0e 	bge	zero,r16,143c <print_repeat+0x64>
    1410:	88c00117 	ldw	r3,4(r17)
    1414:	843fffc4 	addi	r16,r16,-1
    1418:	183ee83a 	callr	r3
    141c:	103ff726 	beq	r2,zero,13fc <print_repeat+0x24>
    1420:	00bfffc4 	movi	r2,-1
    1424:	dfc00417 	ldw	ra,16(sp)
    1428:	dc800317 	ldw	r18,12(sp)
    142c:	dc400217 	ldw	r17,8(sp)
    1430:	dc000117 	ldw	r16,4(sp)
    1434:	dec00504 	addi	sp,sp,20
    1438:	f800283a 	ret
    143c:	0005883a 	mov	r2,zero
    1440:	dfc00417 	ldw	ra,16(sp)
    1444:	dc800317 	ldw	r18,12(sp)
    1448:	dc400217 	ldw	r17,8(sp)
    144c:	dc000117 	ldw	r16,4(sp)
    1450:	dec00504 	addi	sp,sp,20
    1454:	f800283a 	ret

00001458 <___vfprintf_internal_r>:
    1458:	deffe304 	addi	sp,sp,-116
    145c:	df001b15 	stw	fp,108(sp)
    1460:	ddc01a15 	stw	r23,104(sp)
    1464:	dd001715 	stw	r20,92(sp)
    1468:	dc801515 	stw	r18,84(sp)
    146c:	dc001315 	stw	r16,76(sp)
    1470:	dfc01c15 	stw	ra,112(sp)
    1474:	dd801915 	stw	r22,100(sp)
    1478:	dd401815 	stw	r21,96(sp)
    147c:	dcc01615 	stw	r19,88(sp)
    1480:	dc401415 	stw	r17,80(sp)
    1484:	d9001015 	stw	r4,64(sp)
    1488:	2829883a 	mov	r20,r5
    148c:	d9c01115 	stw	r7,68(sp)
    1490:	3025883a 	mov	r18,r6
    1494:	0021883a 	mov	r16,zero
    1498:	d8000f15 	stw	zero,60(sp)
    149c:	d8000e15 	stw	zero,56(sp)
    14a0:	0039883a 	mov	fp,zero
    14a4:	d8000915 	stw	zero,36(sp)
    14a8:	d8000d15 	stw	zero,52(sp)
    14ac:	d8000c15 	stw	zero,48(sp)
    14b0:	d8000b15 	stw	zero,44(sp)
    14b4:	002f883a 	mov	r23,zero
    14b8:	91400003 	ldbu	r5,0(r18)
    14bc:	01c00044 	movi	r7,1
    14c0:	94800044 	addi	r18,r18,1
    14c4:	29003fcc 	andi	r4,r5,255
    14c8:	2100201c 	xori	r4,r4,128
    14cc:	213fe004 	addi	r4,r4,-128
    14d0:	20001526 	beq	r4,zero,1528 <___vfprintf_internal_r+0xd0>
    14d4:	81c03526 	beq	r16,r7,15ac <___vfprintf_internal_r+0x154>
    14d8:	3c002016 	blt	r7,r16,155c <___vfprintf_internal_r+0x104>
    14dc:	803ff61e 	bne	r16,zero,14b8 <___vfprintf_internal_r+0x60>
    14e0:	00800944 	movi	r2,37
    14e4:	2081501e 	bne	r4,r2,1a28 <___vfprintf_internal_r+0x5d0>
    14e8:	073fffc4 	movi	fp,-1
    14ec:	00800284 	movi	r2,10
    14f0:	d9c00c15 	stw	r7,48(sp)
    14f4:	d8000f15 	stw	zero,60(sp)
    14f8:	d8000e15 	stw	zero,56(sp)
    14fc:	df000915 	stw	fp,36(sp)
    1500:	d8800d15 	stw	r2,52(sp)
    1504:	d8000b15 	stw	zero,44(sp)
    1508:	91400003 	ldbu	r5,0(r18)
    150c:	3821883a 	mov	r16,r7
    1510:	94800044 	addi	r18,r18,1
    1514:	29003fcc 	andi	r4,r5,255
    1518:	2100201c 	xori	r4,r4,128
    151c:	213fe004 	addi	r4,r4,-128
    1520:	01c00044 	movi	r7,1
    1524:	203feb1e 	bne	r4,zero,14d4 <___vfprintf_internal_r+0x7c>
    1528:	b805883a 	mov	r2,r23
    152c:	dfc01c17 	ldw	ra,112(sp)
    1530:	df001b17 	ldw	fp,108(sp)
    1534:	ddc01a17 	ldw	r23,104(sp)
    1538:	dd801917 	ldw	r22,100(sp)
    153c:	dd401817 	ldw	r21,96(sp)
    1540:	dd001717 	ldw	r20,92(sp)
    1544:	dcc01617 	ldw	r19,88(sp)
    1548:	dc801517 	ldw	r18,84(sp)
    154c:	dc401417 	ldw	r17,80(sp)
    1550:	dc001317 	ldw	r16,76(sp)
    1554:	dec01d04 	addi	sp,sp,116
    1558:	f800283a 	ret
    155c:	00800084 	movi	r2,2
    1560:	80801726 	beq	r16,r2,15c0 <___vfprintf_internal_r+0x168>
    1564:	008000c4 	movi	r2,3
    1568:	80bfd31e 	bne	r16,r2,14b8 <___vfprintf_internal_r+0x60>
    156c:	2c7ff404 	addi	r17,r5,-48
    1570:	88c03fcc 	andi	r3,r17,255
    1574:	00800244 	movi	r2,9
    1578:	10c02136 	bltu	r2,r3,1600 <___vfprintf_internal_r+0x1a8>
    157c:	d8c00917 	ldw	r3,36(sp)
    1580:	18012716 	blt	r3,zero,1a20 <___vfprintf_internal_r+0x5c8>
    1584:	d9000917 	ldw	r4,36(sp)
    1588:	01400284 	movi	r5,10
    158c:	00012ac0 	call	12ac <__mulsi3>
    1590:	1007883a 	mov	r3,r2
    1594:	88803fcc 	andi	r2,r17,255
    1598:	1080201c 	xori	r2,r2,128
    159c:	10bfe004 	addi	r2,r2,-128
    15a0:	1887883a 	add	r3,r3,r2
    15a4:	d8c00915 	stw	r3,36(sp)
    15a8:	003fc306 	br	14b8 <___vfprintf_internal_r+0x60>
    15ac:	00800c04 	movi	r2,48
    15b0:	2080b326 	beq	r4,r2,1880 <___vfprintf_internal_r+0x428>
    15b4:	00800944 	movi	r2,37
    15b8:	20812726 	beq	r4,r2,1a58 <___vfprintf_internal_r+0x600>
    15bc:	04000084 	movi	r16,2
    15c0:	2c7ff404 	addi	r17,r5,-48
    15c4:	88c03fcc 	andi	r3,r17,255
    15c8:	00800244 	movi	r2,9
    15cc:	10c00a36 	bltu	r2,r3,15f8 <___vfprintf_internal_r+0x1a0>
    15d0:	e000b416 	blt	fp,zero,18a4 <___vfprintf_internal_r+0x44c>
    15d4:	e009883a 	mov	r4,fp
    15d8:	01400284 	movi	r5,10
    15dc:	00012ac0 	call	12ac <__mulsi3>
    15e0:	1007883a 	mov	r3,r2
    15e4:	88803fcc 	andi	r2,r17,255
    15e8:	1080201c 	xori	r2,r2,128
    15ec:	10bfe004 	addi	r2,r2,-128
    15f0:	18b9883a 	add	fp,r3,r2
    15f4:	003fb006 	br	14b8 <___vfprintf_internal_r+0x60>
    15f8:	00800b84 	movi	r2,46
    15fc:	2080a326 	beq	r4,r2,188c <___vfprintf_internal_r+0x434>
    1600:	00801b04 	movi	r2,108
    1604:	2080a326 	beq	r4,r2,1894 <___vfprintf_internal_r+0x43c>
    1608:	d8c00917 	ldw	r3,36(sp)
    160c:	1800a716 	blt	r3,zero,18ac <___vfprintf_internal_r+0x454>
    1610:	d8000f15 	stw	zero,60(sp)
    1614:	28bfea04 	addi	r2,r5,-88
    1618:	10803fcc 	andi	r2,r2,255
    161c:	00c00804 	movi	r3,32
    1620:	18802836 	bltu	r3,r2,16c4 <___vfprintf_internal_r+0x26c>
    1624:	1085883a 	add	r2,r2,r2
    1628:	1085883a 	add	r2,r2,r2
    162c:	00c00034 	movhi	r3,0
    1630:	18c59004 	addi	r3,r3,5696
    1634:	10c5883a 	add	r2,r2,r3
    1638:	11000017 	ldw	r4,0(r2)
    163c:	2000683a 	jmp	r4
    1640:	000016cc 	andi	zero,zero,91
    1644:	000016c4 	movi	zero,91
    1648:	000016c4 	movi	zero,91
    164c:	000016c4 	movi	zero,91
    1650:	000016c4 	movi	zero,91
    1654:	000016c4 	movi	zero,91
    1658:	000016c4 	movi	zero,91
    165c:	000016c4 	movi	zero,91
    1660:	000016c4 	movi	zero,91
    1664:	000016c4 	movi	zero,91
    1668:	000016c4 	movi	zero,91
    166c:	000018f8 	rdprs	zero,zero,99
    1670:	000016e0 	cmpeqi	zero,zero,91
    1674:	000016c4 	movi	zero,91
    1678:	000016c4 	movi	zero,91
    167c:	000016c4 	movi	zero,91
    1680:	000016c4 	movi	zero,91
    1684:	000016e0 	cmpeqi	zero,zero,91
    1688:	000016c4 	movi	zero,91
    168c:	000016c4 	movi	zero,91
    1690:	000016c4 	movi	zero,91
    1694:	000016c4 	movi	zero,91
    1698:	000016c4 	movi	zero,91
    169c:	00001960 	cmpeqi	zero,zero,101
    16a0:	000016c4 	movi	zero,91
    16a4:	000016c4 	movi	zero,91
    16a8:	000016c4 	movi	zero,91
    16ac:	00001970 	cmpltui	zero,zero,101
    16b0:	000016c4 	movi	zero,91
    16b4:	00001844 	movi	zero,97
    16b8:	000016c4 	movi	zero,91
    16bc:	000016c4 	movi	zero,91
    16c0:	0000183c 	xorhi	zero,zero,96
    16c4:	0021883a 	mov	r16,zero
    16c8:	003f7b06 	br	14b8 <___vfprintf_internal_r+0x60>
    16cc:	00c00404 	movi	r3,16
    16d0:	00800044 	movi	r2,1
    16d4:	d8c00d15 	stw	r3,52(sp)
    16d8:	d8000c15 	stw	zero,48(sp)
    16dc:	d8800b15 	stw	r2,44(sp)
    16e0:	d8c00e17 	ldw	r3,56(sp)
    16e4:	1805003a 	cmpeq	r2,r3,zero
    16e8:	10005a1e 	bne	r2,zero,1854 <___vfprintf_internal_r+0x3fc>
    16ec:	d8800c17 	ldw	r2,48(sp)
    16f0:	1000781e 	bne	r2,zero,18d4 <___vfprintf_internal_r+0x47c>
    16f4:	d8801117 	ldw	r2,68(sp)
    16f8:	d8000a15 	stw	zero,40(sp)
    16fc:	14400017 	ldw	r17,0(r2)
    1700:	11c00104 	addi	r7,r2,4
    1704:	d9c01115 	stw	r7,68(sp)
    1708:	88005a26 	beq	r17,zero,1874 <___vfprintf_internal_r+0x41c>
    170c:	d8c00b17 	ldw	r3,44(sp)
    1710:	dcc00044 	addi	r19,sp,1
    1714:	05800244 	movi	r22,9
    1718:	182b003a 	cmpeq	r21,r3,zero
    171c:	dcc01215 	stw	r19,72(sp)
    1720:	00000506 	br	1738 <___vfprintf_internal_r+0x2e0>
    1724:	21000c04 	addi	r4,r4,48
    1728:	99000005 	stb	r4,0(r19)
    172c:	9cc00044 	addi	r19,r19,1
    1730:	80000f26 	beq	r16,zero,1770 <___vfprintf_internal_r+0x318>
    1734:	8023883a 	mov	r17,r16
    1738:	d9400d17 	ldw	r5,52(sp)
    173c:	8809883a 	mov	r4,r17
    1740:	000129c0 	call	129c <__udivsi3>
    1744:	d9000d17 	ldw	r4,52(sp)
    1748:	100b883a 	mov	r5,r2
    174c:	1021883a 	mov	r16,r2
    1750:	00012ac0 	call	12ac <__mulsi3>
    1754:	8889c83a 	sub	r4,r17,r2
    1758:	b13ff20e 	bge	r22,r4,1724 <___vfprintf_internal_r+0x2cc>
    175c:	a8009f1e 	bne	r21,zero,19dc <___vfprintf_internal_r+0x584>
    1760:	21000dc4 	addi	r4,r4,55
    1764:	99000005 	stb	r4,0(r19)
    1768:	9cc00044 	addi	r19,r19,1
    176c:	803ff11e 	bne	r16,zero,1734 <___vfprintf_internal_r+0x2dc>
    1770:	d8801217 	ldw	r2,72(sp)
    1774:	98a3c83a 	sub	r17,r19,r2
    1778:	d8c00917 	ldw	r3,36(sp)
    177c:	1c4bc83a 	sub	r5,r3,r17
    1780:	0140130e 	bge	zero,r5,17d0 <___vfprintf_internal_r+0x378>
    1784:	d8c00044 	addi	r3,sp,1
    1788:	18800804 	addi	r2,r3,32
    178c:	9880102e 	bgeu	r19,r2,17d0 <___vfprintf_internal_r+0x378>
    1790:	00800c04 	movi	r2,48
    1794:	28ffffc4 	addi	r3,r5,-1
    1798:	98800005 	stb	r2,0(r19)
    179c:	99000044 	addi	r4,r19,1
    17a0:	00c0080e 	bge	zero,r3,17c4 <___vfprintf_internal_r+0x36c>
    17a4:	d8c00044 	addi	r3,sp,1
    17a8:	18800804 	addi	r2,r3,32
    17ac:	2080052e 	bgeu	r4,r2,17c4 <___vfprintf_internal_r+0x36c>
    17b0:	00800c04 	movi	r2,48
    17b4:	20800005 	stb	r2,0(r4)
    17b8:	21000044 	addi	r4,r4,1
    17bc:	9945883a 	add	r2,r19,r5
    17c0:	20bff81e 	bne	r4,r2,17a4 <___vfprintf_internal_r+0x34c>
    17c4:	d8801217 	ldw	r2,72(sp)
    17c8:	2027883a 	mov	r19,r4
    17cc:	20a3c83a 	sub	r17,r4,r2
    17d0:	d8c00a17 	ldw	r3,40(sp)
    17d4:	1c45883a 	add	r2,r3,r17
    17d8:	e0a1c83a 	sub	r16,fp,r2
    17dc:	d8800f17 	ldw	r2,60(sp)
    17e0:	10008026 	beq	r2,zero,19e4 <___vfprintf_internal_r+0x58c>
    17e4:	1805003a 	cmpeq	r2,r3,zero
    17e8:	1000ae26 	beq	r2,zero,1aa4 <___vfprintf_internal_r+0x64c>
    17ec:	0400a516 	blt	zero,r16,1a84 <___vfprintf_internal_r+0x62c>
    17f0:	b805883a 	mov	r2,r23
    17f4:	0440950e 	bge	zero,r17,1a4c <___vfprintf_internal_r+0x5f4>
    17f8:	102f883a 	mov	r23,r2
    17fc:	1461883a 	add	r16,r2,r17
    1800:	00000206 	br	180c <___vfprintf_internal_r+0x3b4>
    1804:	bdc00044 	addi	r23,r23,1
    1808:	85ffae26 	beq	r16,r23,16c4 <___vfprintf_internal_r+0x26c>
    180c:	9cffffc4 	addi	r19,r19,-1
    1810:	98800003 	ldbu	r2,0(r19)
    1814:	a0c00117 	ldw	r3,4(r20)
    1818:	d9001017 	ldw	r4,64(sp)
    181c:	d8800005 	stb	r2,0(sp)
    1820:	a00b883a 	mov	r5,r20
    1824:	d80d883a 	mov	r6,sp
    1828:	01c00044 	movi	r7,1
    182c:	183ee83a 	callr	r3
    1830:	103ff426 	beq	r2,zero,1804 <___vfprintf_internal_r+0x3ac>
    1834:	05ffffc4 	movi	r23,-1
    1838:	003f3b06 	br	1528 <___vfprintf_internal_r+0xd0>
    183c:	00c00404 	movi	r3,16
    1840:	d8c00d15 	stw	r3,52(sp)
    1844:	d8000c15 	stw	zero,48(sp)
    1848:	d8c00e17 	ldw	r3,56(sp)
    184c:	1805003a 	cmpeq	r2,r3,zero
    1850:	103fa626 	beq	r2,zero,16ec <___vfprintf_internal_r+0x294>
    1854:	d8c00c17 	ldw	r3,48(sp)
    1858:	1800171e 	bne	r3,zero,18b8 <___vfprintf_internal_r+0x460>
    185c:	d8c01117 	ldw	r3,68(sp)
    1860:	d8000a15 	stw	zero,40(sp)
    1864:	1c400017 	ldw	r17,0(r3)
    1868:	19c00104 	addi	r7,r3,4
    186c:	d9c01115 	stw	r7,68(sp)
    1870:	883fa61e 	bne	r17,zero,170c <___vfprintf_internal_r+0x2b4>
    1874:	dcc00044 	addi	r19,sp,1
    1878:	dcc01215 	stw	r19,72(sp)
    187c:	003fbe06 	br	1778 <___vfprintf_internal_r+0x320>
    1880:	04000084 	movi	r16,2
    1884:	d9c00f15 	stw	r7,60(sp)
    1888:	003f0b06 	br	14b8 <___vfprintf_internal_r+0x60>
    188c:	040000c4 	movi	r16,3
    1890:	003f0906 	br	14b8 <___vfprintf_internal_r+0x60>
    1894:	00800044 	movi	r2,1
    1898:	040000c4 	movi	r16,3
    189c:	d8800e15 	stw	r2,56(sp)
    18a0:	003f0506 	br	14b8 <___vfprintf_internal_r+0x60>
    18a4:	0007883a 	mov	r3,zero
    18a8:	003f4e06 	br	15e4 <___vfprintf_internal_r+0x18c>
    18ac:	00800044 	movi	r2,1
    18b0:	d8800915 	stw	r2,36(sp)
    18b4:	003f5706 	br	1614 <___vfprintf_internal_r+0x1bc>
    18b8:	d8801117 	ldw	r2,68(sp)
    18bc:	14400017 	ldw	r17,0(r2)
    18c0:	10800104 	addi	r2,r2,4
    18c4:	d8801115 	stw	r2,68(sp)
    18c8:	88000716 	blt	r17,zero,18e8 <___vfprintf_internal_r+0x490>
    18cc:	d8000a15 	stw	zero,40(sp)
    18d0:	003f8d06 	br	1708 <___vfprintf_internal_r+0x2b0>
    18d4:	d8c01117 	ldw	r3,68(sp)
    18d8:	1c400017 	ldw	r17,0(r3)
    18dc:	18c00104 	addi	r3,r3,4
    18e0:	d8c01115 	stw	r3,68(sp)
    18e4:	883ff90e 	bge	r17,zero,18cc <___vfprintf_internal_r+0x474>
    18e8:	00800044 	movi	r2,1
    18ec:	0463c83a 	sub	r17,zero,r17
    18f0:	d8800a15 	stw	r2,40(sp)
    18f4:	003f8406 	br	1708 <___vfprintf_internal_r+0x2b0>
    18f8:	04000044 	movi	r16,1
    18fc:	8700080e 	bge	r16,fp,1920 <___vfprintf_internal_r+0x4c8>
    1900:	d9001017 	ldw	r4,64(sp)
    1904:	a00b883a 	mov	r5,r20
    1908:	01800804 	movi	r6,32
    190c:	e1ffffc4 	addi	r7,fp,-1
    1910:	00013d80 	call	13d8 <print_repeat>
    1914:	103fc71e 	bne	r2,zero,1834 <___vfprintf_internal_r+0x3dc>
    1918:	e5c5883a 	add	r2,fp,r23
    191c:	15ffffc4 	addi	r23,r2,-1
    1920:	d8c01117 	ldw	r3,68(sp)
    1924:	d9001017 	ldw	r4,64(sp)
    1928:	800f883a 	mov	r7,r16
    192c:	18800017 	ldw	r2,0(r3)
    1930:	a0c00117 	ldw	r3,4(r20)
    1934:	a00b883a 	mov	r5,r20
    1938:	d8800005 	stb	r2,0(sp)
    193c:	d80d883a 	mov	r6,sp
    1940:	183ee83a 	callr	r3
    1944:	103fbb1e 	bne	r2,zero,1834 <___vfprintf_internal_r+0x3dc>
    1948:	d8801117 	ldw	r2,68(sp)
    194c:	bdc00044 	addi	r23,r23,1
    1950:	0021883a 	mov	r16,zero
    1954:	10800104 	addi	r2,r2,4
    1958:	d8801115 	stw	r2,68(sp)
    195c:	003ed606 	br	14b8 <___vfprintf_internal_r+0x60>
    1960:	00800204 	movi	r2,8
    1964:	d8800d15 	stw	r2,52(sp)
    1968:	d8000c15 	stw	zero,48(sp)
    196c:	003fb606 	br	1848 <___vfprintf_internal_r+0x3f0>
    1970:	d8c01117 	ldw	r3,68(sp)
    1974:	1cc00017 	ldw	r19,0(r3)
    1978:	9809883a 	mov	r4,r19
    197c:	0001c300 	call	1c30 <strlen>
    1980:	e0a1c83a 	sub	r16,fp,r2
    1984:	1023883a 	mov	r17,r2
    1988:	0400070e 	bge	zero,r16,19a8 <___vfprintf_internal_r+0x550>
    198c:	d9001017 	ldw	r4,64(sp)
    1990:	a00b883a 	mov	r5,r20
    1994:	01800804 	movi	r6,32
    1998:	800f883a 	mov	r7,r16
    199c:	00013d80 	call	13d8 <print_repeat>
    19a0:	103fa41e 	bne	r2,zero,1834 <___vfprintf_internal_r+0x3dc>
    19a4:	bc2f883a 	add	r23,r23,r16
    19a8:	a0c00117 	ldw	r3,4(r20)
    19ac:	d9001017 	ldw	r4,64(sp)
    19b0:	980d883a 	mov	r6,r19
    19b4:	a00b883a 	mov	r5,r20
    19b8:	880f883a 	mov	r7,r17
    19bc:	183ee83a 	callr	r3
    19c0:	103f9c1e 	bne	r2,zero,1834 <___vfprintf_internal_r+0x3dc>
    19c4:	d8801117 	ldw	r2,68(sp)
    19c8:	bc6f883a 	add	r23,r23,r17
    19cc:	0021883a 	mov	r16,zero
    19d0:	10800104 	addi	r2,r2,4
    19d4:	d8801115 	stw	r2,68(sp)
    19d8:	003eb706 	br	14b8 <___vfprintf_internal_r+0x60>
    19dc:	210015c4 	addi	r4,r4,87
    19e0:	003f5106 	br	1728 <___vfprintf_internal_r+0x2d0>
    19e4:	04003b16 	blt	zero,r16,1ad4 <___vfprintf_internal_r+0x67c>
    19e8:	d8c00a17 	ldw	r3,40(sp)
    19ec:	1805003a 	cmpeq	r2,r3,zero
    19f0:	103f7f1e 	bne	r2,zero,17f0 <___vfprintf_internal_r+0x398>
    19f4:	a0c00117 	ldw	r3,4(r20)
    19f8:	d9001017 	ldw	r4,64(sp)
    19fc:	00800b44 	movi	r2,45
    1a00:	d8800005 	stb	r2,0(sp)
    1a04:	a00b883a 	mov	r5,r20
    1a08:	d80d883a 	mov	r6,sp
    1a0c:	01c00044 	movi	r7,1
    1a10:	183ee83a 	callr	r3
    1a14:	103f871e 	bne	r2,zero,1834 <___vfprintf_internal_r+0x3dc>
    1a18:	b8800044 	addi	r2,r23,1
    1a1c:	003f7506 	br	17f4 <___vfprintf_internal_r+0x39c>
    1a20:	0007883a 	mov	r3,zero
    1a24:	003edb06 	br	1594 <___vfprintf_internal_r+0x13c>
    1a28:	a0c00117 	ldw	r3,4(r20)
    1a2c:	d9001017 	ldw	r4,64(sp)
    1a30:	d9400005 	stb	r5,0(sp)
    1a34:	d80d883a 	mov	r6,sp
    1a38:	a00b883a 	mov	r5,r20
    1a3c:	183ee83a 	callr	r3
    1a40:	103f7c1e 	bne	r2,zero,1834 <___vfprintf_internal_r+0x3dc>
    1a44:	bdc00044 	addi	r23,r23,1
    1a48:	003e9b06 	br	14b8 <___vfprintf_internal_r+0x60>
    1a4c:	102f883a 	mov	r23,r2
    1a50:	0021883a 	mov	r16,zero
    1a54:	003e9806 	br	14b8 <___vfprintf_internal_r+0x60>
    1a58:	a0c00117 	ldw	r3,4(r20)
    1a5c:	d9000005 	stb	r4,0(sp)
    1a60:	d9001017 	ldw	r4,64(sp)
    1a64:	a00b883a 	mov	r5,r20
    1a68:	d80d883a 	mov	r6,sp
    1a6c:	800f883a 	mov	r7,r16
    1a70:	183ee83a 	callr	r3
    1a74:	103f6f1e 	bne	r2,zero,1834 <___vfprintf_internal_r+0x3dc>
    1a78:	bc2f883a 	add	r23,r23,r16
    1a7c:	0021883a 	mov	r16,zero
    1a80:	003e8d06 	br	14b8 <___vfprintf_internal_r+0x60>
    1a84:	d9001017 	ldw	r4,64(sp)
    1a88:	a00b883a 	mov	r5,r20
    1a8c:	01800c04 	movi	r6,48
    1a90:	800f883a 	mov	r7,r16
    1a94:	00013d80 	call	13d8 <print_repeat>
    1a98:	103f661e 	bne	r2,zero,1834 <___vfprintf_internal_r+0x3dc>
    1a9c:	bc05883a 	add	r2,r23,r16
    1aa0:	003f5406 	br	17f4 <___vfprintf_internal_r+0x39c>
    1aa4:	a0c00117 	ldw	r3,4(r20)
    1aa8:	d9001017 	ldw	r4,64(sp)
    1aac:	00800b44 	movi	r2,45
    1ab0:	d8800005 	stb	r2,0(sp)
    1ab4:	a00b883a 	mov	r5,r20
    1ab8:	d80d883a 	mov	r6,sp
    1abc:	01c00044 	movi	r7,1
    1ac0:	183ee83a 	callr	r3
    1ac4:	103f5b1e 	bne	r2,zero,1834 <___vfprintf_internal_r+0x3dc>
    1ac8:	bdc00044 	addi	r23,r23,1
    1acc:	043f480e 	bge	zero,r16,17f0 <___vfprintf_internal_r+0x398>
    1ad0:	003fec06 	br	1a84 <___vfprintf_internal_r+0x62c>
    1ad4:	d9001017 	ldw	r4,64(sp)
    1ad8:	a00b883a 	mov	r5,r20
    1adc:	01800804 	movi	r6,32
    1ae0:	800f883a 	mov	r7,r16
    1ae4:	00013d80 	call	13d8 <print_repeat>
    1ae8:	103f521e 	bne	r2,zero,1834 <___vfprintf_internal_r+0x3dc>
    1aec:	bc2f883a 	add	r23,r23,r16
    1af0:	003fbd06 	br	19e8 <___vfprintf_internal_r+0x590>

00001af4 <__vfprintf_internal>:
    1af4:	00800034 	movhi	r2,0
    1af8:	10883c04 	addi	r2,r2,8432
    1afc:	2013883a 	mov	r9,r4
    1b00:	11000017 	ldw	r4,0(r2)
    1b04:	2805883a 	mov	r2,r5
    1b08:	300f883a 	mov	r7,r6
    1b0c:	480b883a 	mov	r5,r9
    1b10:	100d883a 	mov	r6,r2
    1b14:	00014581 	jmpi	1458 <___vfprintf_internal_r>

00001b18 <__sfvwrite_small_str>:
    1b18:	2900000b 	ldhu	r4,0(r5)
    1b1c:	defffd04 	addi	sp,sp,-12
    1b20:	dc000015 	stw	r16,0(sp)
    1b24:	20ffffcc 	andi	r3,r4,65535
    1b28:	1880020c 	andi	r2,r3,8
    1b2c:	2821883a 	mov	r16,r5
    1b30:	dfc00215 	stw	ra,8(sp)
    1b34:	dc400115 	stw	r17,4(sp)
    1b38:	300b883a 	mov	r5,r6
    1b3c:	10001d26 	beq	r2,zero,1bb4 <__sfvwrite_small_str+0x9c>
    1b40:	8080008f 	ldh	r2,2(r16)
    1b44:	1000190e 	bge	r2,zero,1bac <__sfvwrite_small_str+0x94>
    1b48:	1880800c 	andi	r2,r3,512
    1b4c:	10001726 	beq	r2,zero,1bac <__sfvwrite_small_str+0x94>
    1b50:	81800517 	ldw	r6,20(r16)
    1b54:	31c0020e 	bge	r6,r7,1b60 <__sfvwrite_small_str+0x48>
    1b58:	1880200c 	andi	r2,r3,128
    1b5c:	1000131e 	bne	r2,zero,1bac <__sfvwrite_small_str+0x94>
    1b60:	3023883a 	mov	r17,r6
    1b64:	3980010e 	bge	r7,r6,1b6c <__sfvwrite_small_str+0x54>
    1b68:	3823883a 	mov	r17,r7
    1b6c:	81000417 	ldw	r4,16(r16)
    1b70:	880d883a 	mov	r6,r17
    1b74:	0001bd00 	call	1bd0 <memmove>
    1b78:	80800417 	ldw	r2,16(r16)
    1b7c:	80c00517 	ldw	r3,20(r16)
    1b80:	0009883a 	mov	r4,zero
    1b84:	1445883a 	add	r2,r2,r17
    1b88:	1c47c83a 	sub	r3,r3,r17
    1b8c:	80800415 	stw	r2,16(r16)
    1b90:	2005883a 	mov	r2,r4
    1b94:	80c00515 	stw	r3,20(r16)
    1b98:	dfc00217 	ldw	ra,8(sp)
    1b9c:	dc400117 	ldw	r17,4(sp)
    1ba0:	dc000017 	ldw	r16,0(sp)
    1ba4:	dec00304 	addi	sp,sp,12
    1ba8:	f800283a 	ret
    1bac:	20801014 	ori	r2,r4,64
    1bb0:	8080000d 	sth	r2,0(r16)
    1bb4:	013fffc4 	movi	r4,-1
    1bb8:	2005883a 	mov	r2,r4
    1bbc:	dfc00217 	ldw	ra,8(sp)
    1bc0:	dc400117 	ldw	r17,4(sp)
    1bc4:	dc000017 	ldw	r16,0(sp)
    1bc8:	dec00304 	addi	sp,sp,12
    1bcc:	f800283a 	ret

00001bd0 <memmove>:
    1bd0:	2011883a 	mov	r8,r4
    1bd4:	2900022e 	bgeu	r5,r4,1be0 <memmove+0x10>
    1bd8:	2989883a 	add	r4,r5,r6
    1bdc:	41000a36 	bltu	r8,r4,1c08 <memmove+0x38>
    1be0:	30000726 	beq	r6,zero,1c00 <memmove+0x30>
    1be4:	000f883a 	mov	r7,zero
    1be8:	29c5883a 	add	r2,r5,r7
    1bec:	11000003 	ldbu	r4,0(r2)
    1bf0:	3a07883a 	add	r3,r7,r8
    1bf4:	39c00044 	addi	r7,r7,1
    1bf8:	19000005 	stb	r4,0(r3)
    1bfc:	31fffa1e 	bne	r6,r7,1be8 <memmove+0x18>
    1c00:	4005883a 	mov	r2,r8
    1c04:	f800283a 	ret
    1c08:	303ffd26 	beq	r6,zero,1c00 <memmove+0x30>
    1c0c:	4187883a 	add	r3,r8,r6
    1c10:	198dc83a 	sub	r6,r3,r6
    1c14:	213fffc4 	addi	r4,r4,-1
    1c18:	20800003 	ldbu	r2,0(r4)
    1c1c:	18ffffc4 	addi	r3,r3,-1
    1c20:	18800005 	stb	r2,0(r3)
    1c24:	19bffb1e 	bne	r3,r6,1c14 <memmove+0x44>
    1c28:	4005883a 	mov	r2,r8
    1c2c:	f800283a 	ret

00001c30 <strlen>:
    1c30:	20800007 	ldb	r2,0(r4)
    1c34:	10000526 	beq	r2,zero,1c4c <strlen+0x1c>
    1c38:	2007883a 	mov	r3,r4
    1c3c:	18c00044 	addi	r3,r3,1
    1c40:	18800007 	ldb	r2,0(r3)
    1c44:	103ffd1e 	bne	r2,zero,1c3c <strlen+0xc>
    1c48:	1905c83a 	sub	r2,r3,r4
    1c4c:	f800283a 	ret

00001c50 <alt_load_section>:

static void ALT_INLINE alt_load_section (alt_u32* from, 
                                         alt_u32* to, 
                                         alt_u32* end)
{
  if (to != from)
    1c50:	2900051e 	bne	r5,r4,1c68 <alt_load_section+0x18>
    1c54:	f800283a 	ret
  {
    while( to != end )
    {
      *to++ = *from++;
    1c58:	20800017 	ldw	r2,0(r4)
    1c5c:	21000104 	addi	r4,r4,4
    1c60:	28800015 	stw	r2,0(r5)
    1c64:	29400104 	addi	r5,r5,4
                                         alt_u32* to, 
                                         alt_u32* end)
{
  if (to != from)
  {
    while( to != end )
    1c68:	29bffb1e 	bne	r5,r6,1c58 <alt_load_section+0x8>
    1c6c:	f800283a 	ret

00001c70 <alt_load>:
 * there is no bootloader, so this application is responsible for loading to
 * RAM any sections that are required.
 */  

void alt_load (void)
{
    1c70:	deffff04 	addi	sp,sp,-4
  /* 
   * Copy the .rwdata section. 
   */

  alt_load_section (&__flash_rwdata_start, 
    1c74:	01000034 	movhi	r4,0
    1c78:	21083f04 	addi	r4,r4,8444
    1c7c:	01400034 	movhi	r5,0
    1c80:	29480304 	addi	r5,r5,8204
    1c84:	01800034 	movhi	r6,0
    1c88:	31883f04 	addi	r6,r6,8444
 * there is no bootloader, so this application is responsible for loading to
 * RAM any sections that are required.
 */  

void alt_load (void)
{
    1c8c:	dfc00015 	stw	ra,0(sp)
  /* 
   * Copy the .rwdata section. 
   */

  alt_load_section (&__flash_rwdata_start, 
    1c90:	0001c500 	call	1c50 <alt_load_section>

  /*
   * Copy the exception handler.
   */

  alt_load_section (&__flash_exceptions_start, 
    1c94:	01000034 	movhi	r4,0
    1c98:	21000804 	addi	r4,r4,32
    1c9c:	01400034 	movhi	r5,0
    1ca0:	29400804 	addi	r5,r5,32
    1ca4:	01800034 	movhi	r6,0
    1ca8:	31800804 	addi	r6,r6,32
    1cac:	0001c500 	call	1c50 <alt_load_section>

  /*
   * Copy the .rodata section.
   */

  alt_load_section (&__flash_rodata_start, 
    1cb0:	01000034 	movhi	r4,0
    1cb4:	21074f04 	addi	r4,r4,7484
    1cb8:	01400034 	movhi	r5,0
    1cbc:	29474f04 	addi	r5,r5,7484
    1cc0:	01800034 	movhi	r6,0
    1cc4:	31880304 	addi	r6,r6,8204
    1cc8:	0001c500 	call	1c50 <alt_load_section>
  
  /*
   * Now ensure that the caches are in synch.
   */
  
  alt_dcache_flush_all();
    1ccc:	0001d2c0 	call	1d2c <alt_dcache_flush_all>
  alt_icache_flush_all();
}
    1cd0:	dfc00017 	ldw	ra,0(sp)
    1cd4:	dec00104 	addi	sp,sp,4
  /*
   * Now ensure that the caches are in synch.
   */
  
  alt_dcache_flush_all();
  alt_icache_flush_all();
    1cd8:	0001d301 	jmpi	1d30 <alt_icache_flush_all>

00001cdc <alt_main>:
 * devices/filesystems/components in the system; and call the entry point for
 * the users application, i.e. main().
 */

void alt_main (void)
{
    1cdc:	deffff04 	addi	sp,sp,-4
#endif

  /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */
  ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n");
  /* Initialize the interrupt controller. */
  alt_irq_init (NULL);
    1ce0:	0009883a 	mov	r4,zero
 * devices/filesystems/components in the system; and call the entry point for
 * the users application, i.e. main().
 */

void alt_main (void)
{
    1ce4:	dfc00015 	stw	ra,0(sp)
#endif

  /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */
  ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n");
  /* Initialize the interrupt controller. */
  alt_irq_init (NULL);
    1ce8:	0001d0c0 	call	1d0c <alt_irq_init>
  ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n");
  ALT_SEM_CREATE (&alt_fd_list_lock, 1);

  /* Initialize the device drivers/software components. */
  ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n");
  alt_sys_init();
    1cec:	0001d080 	call	1d08 <alt_sys_init>
   */

  ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n");

#ifdef ALT_NO_EXIT
  main (alt_argc, alt_argv, alt_envp);
    1cf0:	d1204617 	ldw	r4,-32488(gp)
    1cf4:	d1604717 	ldw	r5,-32484(gp)
    1cf8:	d1a04817 	ldw	r6,-32480(gp)
  close(STDOUT_FILENO);
  exit (result);
#endif

  ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n");
}
    1cfc:	dfc00017 	ldw	ra,0(sp)
    1d00:	dec00104 	addi	sp,sp,4
   */

  ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n");

#ifdef ALT_NO_EXIT
  main (alt_argc, alt_argv, alt_envp);
    1d04:	00003e81 	jmpi	3e8 <main>

00001d08 <alt_sys_init>:
 */

void alt_sys_init( void )
{
    ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart);
}
    1d08:	f800283a 	ret

00001d0c <alt_irq_init>:
 * The "base" parameter is ignored and only
 * present for backwards-compatibility.
 */

void alt_irq_init ( const void* base )
{
    1d0c:	deffff04 	addi	sp,sp,-4
    1d10:	dfc00015 	stw	ra,0(sp)
    ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor);
    1d14:	0001d340 	call	1d34 <altera_nios2_qsys_irq_init>
 * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts.
 */
static ALT_INLINE void ALT_ALWAYS_INLINE 
       alt_irq_cpu_enable_interrupts ()
{
    NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK
    1d18:	00800044 	movi	r2,1
    1d1c:	1001703a 	wrctl	status,r2
    alt_irq_cpu_enable_interrupts();
}
    1d20:	dfc00017 	ldw	ra,0(sp)
    1d24:	dec00104 	addi	sp,sp,4
    1d28:	f800283a 	ret

00001d2c <alt_dcache_flush_all>:
  for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE)
  { 
    __asm__ volatile ("flushd (%0)" :: "r" (i));
  }
#endif /* NIOS2_DCACHE_SIZE > 0 */
}
    1d2c:	f800283a 	ret

00001d30 <alt_icache_flush_all>:
void alt_icache_flush_all (void)
{
#if NIOS2_ICACHE_SIZE > 0
  alt_icache_flush (0, NIOS2_ICACHE_SIZE);
#endif
}
    1d30:	f800283a 	ret

00001d34 <altera_nios2_qsys_irq_init>:
 * To initialize the internal interrupt controller, just clear the IENABLE
 * register so that all possible IRQs are disabled.
 */
void altera_nios2_qsys_irq_init(void) 
{
    NIOS2_WRITE_IENABLE(0);
    1d34:	000170fa 	wrctl	ienable,zero
}
    1d38:	f800283a 	ret
