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

Program Header:
    LOAD off    0x00001000 vaddr 0x00120000 paddr 0x00120000 align 2**12
         filesz 0x00004068 memsz 0x00004068 flags r-x
    LOAD off    0x00005068 vaddr 0x00124068 paddr 0x00124630 align 2**12
         filesz 0x000005c8 memsz 0x000005c8 flags rw-
    LOAD off    0x00005bf8 vaddr 0x00124bf8 paddr 0x00124bf8 align 2**12
         filesz 0x00000000 memsz 0x000006d4 flags rw-
    LOAD off    0x00006000 vaddr 0x00148000 paddr 0x00148000 align 2**12
         filesz 0x00000020 memsz 0x00000020 flags r-x

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .entry        00000020  00148000  00148000  00006000  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .text         0000367c  00120000  00120000  00001000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .rodata       000009ec  0012367c  0012367c  0000467c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .rwdata       000005c8  00124068  00124630  00005068  2**2
                  CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
  4 .bss          000006d4  00124bf8  00124bf8  00005bf8  2**2
                  ALLOC, SMALL_DATA
  5 .comment      00000023  00000000  00000000  00006020  2**0
                  CONTENTS, READONLY
  6 .debug_aranges 00000408  00000000  00000000  00006048  2**3
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_info   000058b1  00000000  00000000  00006450  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_abbrev 00001a9c  00000000  00000000  0000bd01  2**0
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_line   00001cd9  00000000  00000000  0000d79d  2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_frame  00000cac  00000000  00000000  0000f478  2**2
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_str    00001617  00000000  00000000  00010124  2**0
                  CONTENTS, READONLY, DEBUGGING
 12 .debug_loc    000019c0  00000000  00000000  0001173b  2**0
                  CONTENTS, READONLY, DEBUGGING
 13 .debug_alt_sim_info 00000010  00000000  00000000  000130fc  2**2
                  CONTENTS, READONLY, DEBUGGING
 14 .debug_ranges 00000038  00000000  00000000  00013110  2**3
                  CONTENTS, READONLY, DEBUGGING
 15 .thread_model 00000003  00000000  00000000  00014fcc  2**0
                  CONTENTS, READONLY
 16 .cpu          00000004  00000000  00000000  00014fcf  2**0
                  CONTENTS, READONLY
 17 .qsys         00000001  00000000  00000000  00014fd3  2**0
                  CONTENTS, READONLY
 18 .simulation_enabled 00000001  00000000  00000000  00014fd4  2**0
                  CONTENTS, READONLY
 19 .sysid_hash   00000004  00000000  00000000  00014fd5  2**0
                  CONTENTS, READONLY
 20 .sysid_base   00000004  00000000  00000000  00014fd9  2**0
                  CONTENTS, READONLY
 21 .sysid_time   00000004  00000000  00000000  00014fdd  2**0
                  CONTENTS, READONLY
 22 .stderr_dev   00000004  00000000  00000000  00014fe1  2**0
                  CONTENTS, READONLY
 23 .stdin_dev    00000004  00000000  00000000  00014fe5  2**0
                  CONTENTS, READONLY
 24 .stdout_dev   00000004  00000000  00000000  00014fe9  2**0
                  CONTENTS, READONLY
 25 .sopc_system_name 00000004  00000000  00000000  00014fed  2**0
                  CONTENTS, READONLY
 26 .quartus_project_dir 00000042  00000000  00000000  00014ff1  2**0
                  CONTENTS, READONLY
 27 .sopcinfo     000539e8  00000000  00000000  00015033  2**0
                  CONTENTS, READONLY
SYMBOL TABLE:
00148000 l    d  .entry	00000000 .entry
00120000 l    d  .text	00000000 .text
0012367c l    d  .rodata	00000000 .rodata
00124068 l    d  .rwdata	00000000 .rwdata
00124bf8 l    d  .bss	00000000 .bss
00000000 l    d  .comment	00000000 .comment
00000000 l    d  .debug_aranges	00000000 .debug_aranges
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
00000000 l    df *ABS*	00000000 ../osc_bsp//obj/HAL/src/crt0.o
00120038 l       .text	00000000 alt_after_alt_main
00000000 l    df *ABS*	00000000 char712.c
00000000 l    df *ABS*	00000000 keyproc.c
00000000 l    df *ABS*	00000000 lcdout.c
00000000 l    df *ABS*	00000000 mainloop.c
00000000 l    df *ABS*	00000000 menu.c
00000000 l    df *ABS*	00000000 menuact.c
00000000 l    df *ABS*	00000000 stubfncs.c
00000000 l    df *ABS*	00000000 testcode.c
00000000 l    df *ABS*	00000000 tracutil.c
00000000 l    df *ABS*	00000000 obj/default/testvram.o
00080000 l       *ABS*	00000000 VRAM_OFFSET
00122c14 l       .text	00000000 TestVRAMdone
00000000 l    df *ABS*	00000000 lib2-divmod.c
00122c18 l     F .text	00000074 udivmodsi4
00000000 l    df *ABS*	00000000 lib2-mul.c
00000000 l    df *ABS*	00000000 memcpy.c
00000000 l    df *ABS*	00000000 alt_load.c
00122eb0 l     F .text	0000006c 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_close.c
0012304c l     F .text	00000050 alt_get_errno
00000000 l    df *ABS*	00000000 alt_dcache_flush_all.c
00000000 l    df *ABS*	00000000 alt_dev.c
00123184 l     F .text	0000002c alt_dev_null_write
00000000 l    df *ABS*	00000000 alt_do_ctors.c
00000000 l    df *ABS*	00000000 alt_do_dtors.c
00000000 l    df *ABS*	00000000 alt_errno.c
00000000 l    df *ABS*	00000000 alt_icache_flush_all.c
00000000 l    df *ABS*	00000000 alt_release_fd.c
00000000 l    df *ABS*	00000000 altera_nios2_qsys_irq.c
00000000 l    df *ABS*	00000000 atexit.c
00000000 l    df *ABS*	00000000 exit.c
00000000 l    df *ABS*	00000000 impure.c
00124210 l     O .rwdata	00000400 impure_data
00000000 l    df *ABS*	00000000 int_errno.c
00000000 l    df *ABS*	00000000 __atexit.c
00000000 l    df *ABS*	00000000 __call_atexit.c
00000000 l    df *ABS*	00000000 alt_exit.c
00000000 l    df *ABS*	00000000 
00122f9c g     F .text	0000005c alt_main
00122bf8 g     F .text	00000000 TestVRAM
001214fc g     F .text	00000048 trg_delay_down
00124630 g       *ABS*	00000000 __flash_rwdata_start
00120fc8 g     F .text	00000084 display_scale
00124c18 g     O .bss	00000004 cur_scale
00121de0 g     F .text	00000028 trace_rearm
00121b4c g     F .text	00000020 sample_done
00120d54 g     F .text	00000020 get_trigger_mode
00123cb4 g     O .rodata	00000070 menu
00120cc8 g     F .text	00000020 no_menu_action
00121b04 g     F .text	00000024 set_delay
00000000  w      *UND*	00000000 __errno
00148000 g     F .entry	0000000c __reset
00120000 g       *ABS*	00000000 __flash_exceptions_start
0012003c g     F .text	00000024 no_action
00124c44 g     O .bss	00000004 errno
00124c00 g     O .bss	00000004 trigger_mode
00120140 g     F .text	00000030 menu_right
00121218 g     F .text	00000048 set_trg_level
00124c3c g     O .bss	00000004 alt_argv
00120794 g     F .text	00000064 init_menu
0012c610 g       *ABS*	00000000 _gp
00121d48 g     F .text	00000020 is_sampling
00120000 g       *ABS*	00000000 __alt_mem_RAM_ctrl
00120110 g     F .text	00000030 menu_left
00124090 g     O .rwdata	00000180 alt_fd_list
00122d70 g     F .text	00000140 memcpy
001212b0 g     F .text	00000054 trg_level_up
0012367c g       *ABS*	00000000 __DTOR_END__
00120d14 g     F .text	00000040 set_trigger_mode
00121a8c g     F .text	0000002c plot_pixel
00000000  w      *UND*	00000000 malloc
00122d38 g     F .text	00000008 __udivsi3
001225e0 g     F .text	00000120 restore_trace
00121894 g     F .text	00000198 cvt_num_field
00124c1c g     O .bss	00000004 trace_status
00122508 g     F .text	000000d8 set_save_area
00121b28 g     F .text	00000024 start_sample
00120f00 g     F .text	00000064 scale_down
00124620 g     O .rwdata	00000004 alt_max_fd
00121a2c g     F .text	00000020 key_available
00124bf8 g     O .bss	00000004 menu_entry
00130000 g       *ABS*	00000000 __alt_mem_ROM_ctrl
001211b0 g     F .text	00000068 display_sweep
00121e34 g     F .text	000003f8 set_display_scale
00122700 g     F .text	00000048 do_trace
00124628 g     O .rwdata	00000004 _global_impure_ptr
001252cc g       *ABS*	00000000 __bss_end
00121cac g     F .text	00000064 init_trace
001214bc g     F .text	00000040 set_trg_delay
001200e0 g     F .text	00000030 menu_down
00121b6c g     F .text	00000140 get_test_sample
00124068 g     O .rwdata	00000028 alt_dev_null
00120170 g     F .text	000000a8 clear_region
0012367c g     O .rodata	00000600 char_patterns
00123168 g     F .text	0000001c alt_dcache_flush_all
001209b4 g     F .text	0000006c previous_entry
00124630 g       *ABS*	00000000 __ram_rwdata_end
00124618 g     O .rwdata	00000008 alt_dev_list
00121d10 g     F .text	00000038 set_mode
00120bf8 g     F .text	000000d0 display_entry
00124068 g       *ABS*	00000000 __ram_rodata_end
00124c20 g     O .bss	00000004 saved_end_y
00122d40 g     F .text	00000008 __umodsi3
00120e3c g     F .text	00000084 display_mode
00124bfc g     O .bss	00000004 menu_display
001252cc g       *ABS*	00000000 end
00120ce8 g     F .text	0000002c no_display
00121304 g     F .text	000000a4 display_trg_level
0012112c g     F .text	00000084 sweep_up
001208e8 g     F .text	0000005c reset_menu
001207f8 g     F .text	00000038 clear_menu
00121544 g     F .text	0000004c trg_delay_up
0012367c g       *ABS*	00000000 __CTOR_LIST__
00130000 g       *ABS*	00000000 __alt_stack_pointer
001234a0 g     F .text	000001a0 __call_exitprocs
00120000 g     F .text	0000003c _start
00124c04 g     O .bss	00000004 level
00124c24 g     O .bss	00000004 saved_pos_y
001213f0 g     F .text	00000054 trg_slope_toggle
0012302c g     F .text	00000020 alt_sys_init
00123370 g     F .text	00000130 __register_exitproc
00122d48 g     F .text	00000028 __mulsi3
00124068 g       *ABS*	00000000 __ram_rwdata_start
0012367c g       *ABS*	00000000 __ram_rodata_start
00124c28 g     O .bss	00000004 sample_size
00123dac g     O .rodata	00000088 sweep_rates
00121a6c g     F .text	00000020 clear_display
00124c2c g     O .bss	00000004 saved_end_x
001252cc g       *ABS*	00000000 __alt_stack_base
001223f4 g     F .text	00000114 restore_menu_trace
00121e08 g     F .text	0000002c set_trace_size
001204e8 g     F .text	00000098 plot_string
00124bf8 g       *ABS*	00000000 __bss_start
00124c30 g     O .bss	00000004 saved_pos_x
00120580 g     F .text	00000138 main
00124c40 g     O .bss	00000004 alt_envp
00121590 g     F .text	000000d4 adjust_trg_delay
00122748 g     F .text	000004b0 plot_trace
0012513c g     O .bss	00000190 _atexit0
001210ac g     F .text	00000080 sweep_down
00124624 g     O .rwdata	00000004 alt_errno
00124c08 g     O .bss	00000004 sweep
00120d74 g     F .text	00000064 mode_down
00121ab8 g     F .text	00000024 set_sample_rate
00122c8c g     F .text	00000050 __divsi3
00121adc g     F .text	00000028 set_trigger
0012367c g       *ABS*	00000000 __CTOR_END__
00148000 g       *ABS*	00000000 __alt_mem_ONCHIP_mem
001208b0 g     F .text	00000038 refresh_menu
0012367c g       *ABS*	00000000 __flash_rodata_start
0012367c g       *ABS*	00000000 __DTOR_LIST__
001200b0 g     F .text	00000030 menu_up
00120b0c g     F .text	000000ec menu_entry_right
00124c0c g     O .bss	00000004 delay
00122ff8 g     F .text	00000034 alt_irq_init
00123284 g     F .text	00000080 alt_release_fd
00123324 g     F .text	00000014 atexit
00121da0 g     F .text	00000040 trace_done
0012462c g     O .rwdata	00000004 _impure_ptr
00124c38 g     O .bss	00000004 alt_argc
001213a8 g     F .text	00000048 set_trg_slope
00121260 g     F .text	00000050 trg_level_down
0012320c g     F .text	0000005c _do_dtors
00121a4c g     F .text	00000020 getkey
00120370 g     F .text	00000178 plot_char
00124c48 g     O .bss	000002a0 saved_menu
00120a20 g     F .text	000000ec menu_entry_left
00124610 g     O .rwdata	00000008 alt_fs_list
0012222c g     F .text	000001c8 clear_saved_areas
00120218 g     F .text	000000ac plot_hline
00148020 g       *ABS*	00000000 __ram_exceptions_start
00120ec0 g     F .text	00000040 set_scale
00124ee8 g     O .bss	000000b0 saved_axis_y
00124630 g       *ABS*	00000000 _edata
001252cc g       *ABS*	00000000 _end
00120dd8 g     F .text	00000064 mode_up
00148020 g       *ABS*	00000000 __ram_exceptions_end
00124f98 g     O .bss	000000b4 saved_axis_x
00123304 g     F .text	00000020 altera_nios2_qsys_irq_init
00123338 g     F .text	00000038 exit
00121664 g     F .text	00000230 display_trg_delay
00122cdc g     F .text	0000005c __modsi3
00130000 g       *ABS*	00000000 __alt_data_end
00121444 g     F .text	00000078 display_trg_slope
0012504c g     O .bss	000000f0 saved_area
00124c34 g     O .bss	00000004 sampling
00123640 g     F .text	0000003c _exit
00080000 g       *ABS*	00000000 __alt_mem_VRAM_ctrl
00124c10 g     O .bss	00000004 scale
001206b8 g     F .text	000000dc key_lookup
00123268 g     F .text	0000001c alt_icache_flush_all
001202c4 g     F .text	000000ac plot_vline
00120830 g     F .text	00000080 display_menu
001231b0 g     F .text	0000005c _do_ctors
00120944 g     F .text	00000070 next_entry
0012309c g     F .text	000000cc close
00121d68 g     F .text	00000038 trace_rdy
00124c14 g     O .bss	00000004 slope
00122f1c g     F .text	00000080 alt_load
0012104c g     F .text	00000060 set_sweep
00120f64 g     F .text	00000064 scale_up
00120060 g     F .text	00000050 menu_key
00000000  w      *UND*	00000000 free



Disassembly of section .entry:

00148000 <__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)
  148000:	004004b4 	movhi	at,18
    ori r1, r1, %lo(_start)
  148004:	08400014 	ori	at,at,0
    jmp r1
  148008:	0800683a 	jmp	at
	...

Disassembly of section .text:

00120000 <_start>:

    /*
     * Now that the caches are initialized, set up the stack pointer and global pointer.
     * The values provided by the linker are assumed to be correctly aligned.
     */
    movhi sp, %hi(__alt_stack_pointer)
  120000:	06c004f4 	movhi	sp,19
    ori sp, sp, %lo(__alt_stack_pointer)
  120004:	dec00014 	ori	sp,sp,0
    movhi gp, %hi(_gp)
  120008:	068004b4 	movhi	gp,18
    ori gp, gp, %lo(_gp)
  12000c:	d6b18414 	ori	gp,gp,50704
 */
#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)
  120010:	008004b4 	movhi	r2,18
    ori r2, r2, %lo(__bss_start)
  120014:	1092fe14 	ori	r2,r2,19448

    movhi r3, %hi(__bss_end)
  120018:	00c004b4 	movhi	r3,18
    ori r3, r3, %lo(__bss_end)
  12001c:	18d4b314 	ori	r3,r3,21196

    beq r2, r3, 1f
  120020:	10c00326 	beq	r2,r3,120030 <_start+0x30>

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

    call alt_load
  120030:	0122f1c0 	call	122f1c <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
  120034:	0122f9c0 	call	122f9c <alt_main>

00120038 <alt_after_alt_main>:

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

0012003c <no_action>:
   Last Modified:    Mar. 8, 1994

*/

enum status  no_action(enum status cur_state)
{
  12003c:	defffe04 	addi	sp,sp,-8
  120040:	df000115 	stw	fp,4(sp)
  120044:	df000104 	addi	fp,sp,4
  120048:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* return the current state */
    return  cur_state;
  12004c:	e0bfff17 	ldw	r2,-4(fp)

}
  120050:	e037883a 	mov	sp,fp
  120054:	df000017 	ldw	fp,0(sp)
  120058:	dec00104 	addi	sp,sp,4
  12005c:	f800283a 	ret

00120060 <menu_key>:
   Last Modified:    Mar. 8, 1994

*/

enum status  menu_key(enum status cur_state)
{
  120060:	defffd04 	addi	sp,sp,-12
  120064:	dfc00215 	stw	ra,8(sp)
  120068:	df000115 	stw	fp,4(sp)
  12006c:	df000104 	addi	fp,sp,4
  120070:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* check if need to turn the menu on or off */
    if (cur_state == MENU_ON)
  120074:	e0bfff17 	ldw	r2,-4(fp)
  120078:	1000021e 	bne	r2,zero,120084 <menu_key+0x24>
        /* currently the menu is on, turn it off */
	clear_menu();
  12007c:	01207f80 	call	1207f8 <clear_menu>
  120080:	00000106 	br	120088 <menu_key+0x28>
    else
        /* currently the menu is off, turn it on */
	display_menu();
  120084:	01208300 	call	120830 <display_menu>


    /* all done, return the "opposite" of the current state */
    if (cur_state == MENU_ON)
  120088:	e0bfff17 	ldw	r2,-4(fp)
  12008c:	1000021e 	bne	r2,zero,120098 <menu_key+0x38>
        /* state was MENU_ON, change it to MENU_OFF */
        return  MENU_OFF;
  120090:	00800044 	movi	r2,1
  120094:	00000106 	br	12009c <menu_key+0x3c>
    else
        /* state was MENU_OFF, change it to MENU_ON */
        return  MENU_ON;
  120098:	0005883a 	mov	r2,zero

}
  12009c:	e037883a 	mov	sp,fp
  1200a0:	dfc00117 	ldw	ra,4(sp)
  1200a4:	df000017 	ldw	fp,0(sp)
  1200a8:	dec00204 	addi	sp,sp,8
  1200ac:	f800283a 	ret

001200b0 <menu_up>:
   Last Modified:    Mar. 8, 1994

*/

enum status  menu_up(enum status cur_state)
{
  1200b0:	defffd04 	addi	sp,sp,-12
  1200b4:	dfc00215 	stw	ra,8(sp)
  1200b8:	df000115 	stw	fp,4(sp)
  1200bc:	df000104 	addi	fp,sp,4
  1200c0:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* go to the previous menu entry */
    previous_entry();
  1200c4:	01209b40 	call	1209b4 <previous_entry>


    /* return the current state */
    return  cur_state;
  1200c8:	e0bfff17 	ldw	r2,-4(fp)

}
  1200cc:	e037883a 	mov	sp,fp
  1200d0:	dfc00117 	ldw	ra,4(sp)
  1200d4:	df000017 	ldw	fp,0(sp)
  1200d8:	dec00204 	addi	sp,sp,8
  1200dc:	f800283a 	ret

001200e0 <menu_down>:
   Last Modified:    Mar. 8, 1994

*/

enum status  menu_down(enum status cur_state)
{
  1200e0:	defffd04 	addi	sp,sp,-12
  1200e4:	dfc00215 	stw	ra,8(sp)
  1200e8:	df000115 	stw	fp,4(sp)
  1200ec:	df000104 	addi	fp,sp,4
  1200f0:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* go to the next menu entry */
    next_entry();
  1200f4:	01209440 	call	120944 <next_entry>


    /* return the current state */
    return  cur_state;
  1200f8:	e0bfff17 	ldw	r2,-4(fp)

}
  1200fc:	e037883a 	mov	sp,fp
  120100:	dfc00117 	ldw	ra,4(sp)
  120104:	df000017 	ldw	fp,0(sp)
  120108:	dec00204 	addi	sp,sp,8
  12010c:	f800283a 	ret

00120110 <menu_left>:
   Last Modified:    Mar. 8, 1994

*/

enum status  menu_left(enum status cur_state)
{
  120110:	defffd04 	addi	sp,sp,-12
  120114:	dfc00215 	stw	ra,8(sp)
  120118:	df000115 	stw	fp,4(sp)
  12011c:	df000104 	addi	fp,sp,4
  120120:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* invoke the <Left> key function for the current menu entry */
    menu_entry_left();
  120124:	0120a200 	call	120a20 <menu_entry_left>


    /* return the current state */
    return  cur_state;
  120128:	e0bfff17 	ldw	r2,-4(fp)

}
  12012c:	e037883a 	mov	sp,fp
  120130:	dfc00117 	ldw	ra,4(sp)
  120134:	df000017 	ldw	fp,0(sp)
  120138:	dec00204 	addi	sp,sp,8
  12013c:	f800283a 	ret

00120140 <menu_right>:
   Last Modified:    Mar. 8, 1994

*/

enum status  menu_right(enum status cur_state)
{
  120140:	defffd04 	addi	sp,sp,-12
  120144:	dfc00215 	stw	ra,8(sp)
  120148:	df000115 	stw	fp,4(sp)
  12014c:	df000104 	addi	fp,sp,4
  120150:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* invoke the <Right> key function for the current menu entry */
    menu_entry_right();
  120154:	0120b0c0 	call	120b0c <menu_entry_right>


    /* return the current state */
    return  cur_state;
  120158:	e0bfff17 	ldw	r2,-4(fp)

}
  12015c:	e037883a 	mov	sp,fp
  120160:	dfc00117 	ldw	ra,4(sp)
  120164:	df000017 	ldw	fp,0(sp)
  120168:	dec00204 	addi	sp,sp,8
  12016c:	f800283a 	ret

00120170 <clear_region>:
   Last Modified:    Mar. 8, 1994

*/

void  clear_region(int x_ul, int y_ul, int x_size, int y_size)
{
  120170:	defff804 	addi	sp,sp,-32
  120174:	dfc00715 	stw	ra,28(sp)
  120178:	df000615 	stw	fp,24(sp)
  12017c:	df000604 	addi	fp,sp,24
  120180:	e13ffc15 	stw	r4,-16(fp)
  120184:	e17ffd15 	stw	r5,-12(fp)
  120188:	e1bffe15 	stw	r6,-8(fp)
  12018c:	e1ffff15 	stw	r7,-4(fp)
    int  y;		/* y coordinate to clear */



    /* loop, clearing the display */
    for (x = x_ul; x < (x_ul + x_size); x++)  {
  120190:	e0bffc17 	ldw	r2,-16(fp)
  120194:	e0bffa15 	stw	r2,-24(fp)
  120198:	00001406 	br	1201ec <clear_region+0x7c>
        for (y = y_ul; y < (y_ul + y_size); y++)  {
  12019c:	e0bffd17 	ldw	r2,-12(fp)
  1201a0:	e0bffb15 	stw	r2,-20(fp)
  1201a4:	00000906 	br	1201cc <clear_region+0x5c>

	    /* clear this pixel */
	    plot_pixel(x, y, PIXEL_WHITE);
  1201a8:	e0fffa17 	ldw	r3,-24(fp)
  1201ac:	e0bffb17 	ldw	r2,-20(fp)
  1201b0:	1809883a 	mov	r4,r3
  1201b4:	100b883a 	mov	r5,r2
  1201b8:	000d883a 	mov	r6,zero
  1201bc:	0121a8c0 	call	121a8c <plot_pixel>



    /* loop, clearing the display */
    for (x = x_ul; x < (x_ul + x_size); x++)  {
        for (y = y_ul; y < (y_ul + y_size); y++)  {
  1201c0:	e0bffb17 	ldw	r2,-20(fp)
  1201c4:	10800044 	addi	r2,r2,1
  1201c8:	e0bffb15 	stw	r2,-20(fp)
  1201cc:	e0fffd17 	ldw	r3,-12(fp)
  1201d0:	e0bfff17 	ldw	r2,-4(fp)
  1201d4:	1885883a 	add	r2,r3,r2
  1201d8:	e0fffb17 	ldw	r3,-20(fp)
  1201dc:	18bff216 	blt	r3,r2,1201a8 <clear_region+0x38>
    int  y;		/* y coordinate to clear */



    /* loop, clearing the display */
    for (x = x_ul; x < (x_ul + x_size); x++)  {
  1201e0:	e0bffa17 	ldw	r2,-24(fp)
  1201e4:	10800044 	addi	r2,r2,1
  1201e8:	e0bffa15 	stw	r2,-24(fp)
  1201ec:	e0fffc17 	ldw	r3,-16(fp)
  1201f0:	e0bffe17 	ldw	r2,-8(fp)
  1201f4:	1885883a 	add	r2,r3,r2
  1201f8:	e0fffa17 	ldw	r3,-24(fp)
  1201fc:	18bfe716 	blt	r3,r2,12019c <clear_region+0x2c>
        }
    }


    /* done clearing the display region - return */
    return;
  120200:	0001883a 	nop

}
  120204:	e037883a 	mov	sp,fp
  120208:	dfc00117 	ldw	ra,4(sp)
  12020c:	df000017 	ldw	fp,0(sp)
  120210:	dec00204 	addi	sp,sp,8
  120214:	f800283a 	ret

00120218 <plot_hline>:
   Last Modified:    Mar. 7, 1994

*/

void  plot_hline(int start_x, int start_y, int length)
{
  120218:	defff804 	addi	sp,sp,-32
  12021c:	dfc00715 	stw	ra,28(sp)
  120220:	df000615 	stw	fp,24(sp)
  120224:	df000604 	addi	fp,sp,24
  120228:	e13ffd15 	stw	r4,-12(fp)
  12022c:	e17ffe15 	stw	r5,-8(fp)
  120230:	e1bfff15 	stw	r6,-4(fp)
    int  end_x;		/* ending x position to plot */



    /* check if a line to the "right" or "left" */
    if (length > 0)  {
  120234:	e0bfff17 	ldw	r2,-4(fp)
  120238:	0080070e 	bge	zero,r2,120258 <plot_hline+0x40>

        /* line to the "right" - start at start_x, end at start_x + length */
	init_x = start_x;
  12023c:	e0bffd17 	ldw	r2,-12(fp)
  120240:	e0bffb15 	stw	r2,-20(fp)
	end_x = start_x + length;
  120244:	e0fffd17 	ldw	r3,-12(fp)
  120248:	e0bfff17 	ldw	r2,-4(fp)
  12024c:	1885883a 	add	r2,r3,r2
  120250:	e0bffc15 	stw	r2,-16(fp)
  120254:	00000606 	br	120270 <plot_hline+0x58>
    }
    else  {

        /* line to the "left" - start at start_x + length, end at start_x */
	init_x = start_x + length;
  120258:	e0fffd17 	ldw	r3,-12(fp)
  12025c:	e0bfff17 	ldw	r2,-4(fp)
  120260:	1885883a 	add	r2,r3,r2
  120264:	e0bffb15 	stw	r2,-20(fp)
	end_x = start_x;
  120268:	e0bffd17 	ldw	r2,-12(fp)
  12026c:	e0bffc15 	stw	r2,-16(fp)
    }


    /* loop, outputting points for the line (always draw to the "right") */
    for (x = init_x; x < end_x; x++)
  120270:	e0bffb17 	ldw	r2,-20(fp)
  120274:	e0bffa15 	stw	r2,-24(fp)
  120278:	00000906 	br	1202a0 <plot_hline+0x88>
        /* plot a point of the line */
	plot_pixel(x, start_y, PIXEL_BLACK);
  12027c:	e0fffa17 	ldw	r3,-24(fp)
  120280:	e0bffe17 	ldw	r2,-8(fp)
  120284:	1809883a 	mov	r4,r3
  120288:	100b883a 	mov	r5,r2
  12028c:	01800044 	movi	r6,1
  120290:	0121a8c0 	call	121a8c <plot_pixel>
	end_x = start_x;
    }


    /* loop, outputting points for the line (always draw to the "right") */
    for (x = init_x; x < end_x; x++)
  120294:	e0bffa17 	ldw	r2,-24(fp)
  120298:	10800044 	addi	r2,r2,1
  12029c:	e0bffa15 	stw	r2,-24(fp)
  1202a0:	e0fffa17 	ldw	r3,-24(fp)
  1202a4:	e0bffc17 	ldw	r2,-16(fp)
  1202a8:	18bff416 	blt	r3,r2,12027c <plot_hline+0x64>
        /* plot a point of the line */
	plot_pixel(x, start_y, PIXEL_BLACK);


    /* done plotting the line - return */
    return;
  1202ac:	0001883a 	nop

}
  1202b0:	e037883a 	mov	sp,fp
  1202b4:	dfc00117 	ldw	ra,4(sp)
  1202b8:	df000017 	ldw	fp,0(sp)
  1202bc:	dec00204 	addi	sp,sp,8
  1202c0:	f800283a 	ret

001202c4 <plot_vline>:
   Last Modified:    Mar. 7, 1994

*/

void  plot_vline(int start_x, int start_y, int length)
{
  1202c4:	defff804 	addi	sp,sp,-32
  1202c8:	dfc00715 	stw	ra,28(sp)
  1202cc:	df000615 	stw	fp,24(sp)
  1202d0:	df000604 	addi	fp,sp,24
  1202d4:	e13ffd15 	stw	r4,-12(fp)
  1202d8:	e17ffe15 	stw	r5,-8(fp)
  1202dc:	e1bfff15 	stw	r6,-4(fp)
    int  end_y;		/* ending y position to plot */



    /* check if an "up" or "down" line */
    if (length > 0)  {
  1202e0:	e0bfff17 	ldw	r2,-4(fp)
  1202e4:	0080070e 	bge	zero,r2,120304 <plot_vline+0x40>

        /* line going "down" - start at start_y, end at start_y + length */
	init_y = start_y;
  1202e8:	e0bffe17 	ldw	r2,-8(fp)
  1202ec:	e0bffb15 	stw	r2,-20(fp)
	end_y = start_y + length;
  1202f0:	e0fffe17 	ldw	r3,-8(fp)
  1202f4:	e0bfff17 	ldw	r2,-4(fp)
  1202f8:	1885883a 	add	r2,r3,r2
  1202fc:	e0bffc15 	stw	r2,-16(fp)
  120300:	00000606 	br	12031c <plot_vline+0x58>
    }
    else  {

        /* line going "up" - start at start_y + length, end at start_y */
	init_y = start_y + length;
  120304:	e0fffe17 	ldw	r3,-8(fp)
  120308:	e0bfff17 	ldw	r2,-4(fp)
  12030c:	1885883a 	add	r2,r3,r2
  120310:	e0bffb15 	stw	r2,-20(fp)
	end_y = start_y;
  120314:	e0bffe17 	ldw	r2,-8(fp)
  120318:	e0bffc15 	stw	r2,-16(fp)
    }


    /* loop, outputting points for the line (always draw "down") */
    for (y = init_y; y < end_y; y++)
  12031c:	e0bffb17 	ldw	r2,-20(fp)
  120320:	e0bffa15 	stw	r2,-24(fp)
  120324:	00000906 	br	12034c <plot_vline+0x88>
        /* plot a point of the line */
	plot_pixel(start_x, y, PIXEL_BLACK);
  120328:	e0fffd17 	ldw	r3,-12(fp)
  12032c:	e0bffa17 	ldw	r2,-24(fp)
  120330:	1809883a 	mov	r4,r3
  120334:	100b883a 	mov	r5,r2
  120338:	01800044 	movi	r6,1
  12033c:	0121a8c0 	call	121a8c <plot_pixel>
	end_y = start_y;
    }


    /* loop, outputting points for the line (always draw "down") */
    for (y = init_y; y < end_y; y++)
  120340:	e0bffa17 	ldw	r2,-24(fp)
  120344:	10800044 	addi	r2,r2,1
  120348:	e0bffa15 	stw	r2,-24(fp)
  12034c:	e0fffa17 	ldw	r3,-24(fp)
  120350:	e0bffc17 	ldw	r2,-16(fp)
  120354:	18bff416 	blt	r3,r2,120328 <plot_vline+0x64>
        /* plot a point of the line */
	plot_pixel(start_x, y, PIXEL_BLACK);


    /* done plotting the line - return */
    return;
  120358:	0001883a 	nop

}
  12035c:	e037883a 	mov	sp,fp
  120360:	dfc00117 	ldw	ra,4(sp)
  120364:	df000017 	ldw	fp,0(sp)
  120368:	dec00204 	addi	sp,sp,8
  12036c:	f800283a 	ret

00120370 <plot_char>:
   Last Modified:    May 27, 2008

*/

void  plot_char(int pos_x, int pos_y, char c, enum char_style style)
{
  120370:	defff504 	addi	sp,sp,-44
  120374:	dfc00a15 	stw	ra,40(sp)
  120378:	df000915 	stw	fp,36(sp)
  12037c:	df000904 	addi	fp,sp,36
  120380:	e13ffc15 	stw	r4,-16(fp)
  120384:	e17ffd15 	stw	r5,-12(fp)
  120388:	3005883a 	mov	r2,r6
  12038c:	e1ffff15 	stw	r7,-4(fp)
  120390:	e0bffe05 	stb	r2,-8(fp)
    int  y;		/* y pixel position for the character */



    /* setup the pixel positions for the character */
    x = pos_x * HORIZ_SIZE;
  120394:	e13ffc17 	ldw	r4,-16(fp)
  120398:	01400184 	movi	r5,6
  12039c:	0122d480 	call	122d48 <__mulsi3>
  1203a0:	e0bffb15 	stw	r2,-20(fp)
    y = pos_y * VERT_SIZE;
  1203a4:	e0bffd17 	ldw	r2,-12(fp)
  1203a8:	100490fa 	slli	r2,r2,3
  1203ac:	e0bffa15 	stw	r2,-24(fp)


    /* loop outputting the bits to the screen */
    for (row = 0; row < VERT_SIZE; row++)  {
  1203b0:	e03ff915 	stw	zero,-28(fp)
  1203b4:	00004306 	br	1204c4 <plot_char+0x154>

        /* get the character bits for this row from the character table */
	if (row == (VERT_SIZE - 1))
  1203b8:	e0bff917 	ldw	r2,-28(fp)
  1203bc:	108001d8 	cmpnei	r2,r2,7
  1203c0:	1000021e 	bne	r2,zero,1203cc <plot_char+0x5c>
	    /* last row - blank it */
	    bits = 0;
  1203c4:	e03ff715 	stw	zero,-36(fp)
  1203c8:	00000d06 	br	120400 <plot_char+0x90>
	else
	    /* in middle of character, get the row from the bit patterns */
            bits = char_patterns[(c * (VERT_SIZE - 1)) + row];
  1203cc:	e0bffe07 	ldb	r2,-8(fp)
  1203d0:	1009883a 	mov	r4,r2
  1203d4:	014001c4 	movi	r5,7
  1203d8:	0122d480 	call	122d48 <__mulsi3>
  1203dc:	1007883a 	mov	r3,r2
  1203e0:	e0bff917 	ldw	r2,-28(fp)
  1203e4:	1885883a 	add	r2,r3,r2
  1203e8:	00c004b4 	movhi	r3,18
  1203ec:	18cd9f04 	addi	r3,r3,13948
  1203f0:	1885883a 	add	r2,r3,r2
  1203f4:	10800003 	ldbu	r2,0(r2)
  1203f8:	10803fcc 	andi	r2,r2,255
  1203fc:	e0bff715 	stw	r2,-36(fp)

	/* take care of "normal/reverse video" */
	if (style == REVERSE)
  120400:	e0bfff17 	ldw	r2,-4(fp)
  120404:	10800058 	cmpnei	r2,r2,1
  120408:	1000031e 	bne	r2,zero,120418 <plot_char+0xa8>
	    /* invert the bits for "reverse video" */
	    bits = ~bits;
  12040c:	e0bff717 	ldw	r2,-36(fp)
  120410:	0084303a 	nor	r2,zero,r2
  120414:	e0bff715 	stw	r2,-36(fp)

        /* get the bits "in position" (high bit is output first */
	bits <<= (8 - HORIZ_SIZE);
  120418:	e0bff717 	ldw	r2,-36(fp)
  12041c:	1085883a 	add	r2,r2,r2
  120420:	1085883a 	add	r2,r2,r2
  120424:	e0bff715 	stw	r2,-36(fp)


	/* now output the row of the character, pixel by pixel */
	for (col = 0; col < HORIZ_SIZE; col++)  {
  120428:	e03ff815 	stw	zero,-32(fp)
  12042c:	00001c06 	br	1204a0 <plot_char+0x130>

            /* output this pixel in the appropriate color */
	    if ((bits & 0x80) == 0)
  120430:	e0bff717 	ldw	r2,-36(fp)
  120434:	1080200c 	andi	r2,r2,128
  120438:	10000a1e 	bne	r2,zero,120464 <plot_char+0xf4>
	        /* blank pixel - output in PIXEL_WHITE */
		plot_pixel(x + col, y, PIXEL_WHITE);
  12043c:	e0fffb17 	ldw	r3,-20(fp)
  120440:	e0bff817 	ldw	r2,-32(fp)
  120444:	1885883a 	add	r2,r3,r2
  120448:	1007883a 	mov	r3,r2
  12044c:	e0bffa17 	ldw	r2,-24(fp)
  120450:	1809883a 	mov	r4,r3
  120454:	100b883a 	mov	r5,r2
  120458:	000d883a 	mov	r6,zero
  12045c:	0121a8c0 	call	121a8c <plot_pixel>
  120460:	00000906 	br	120488 <plot_char+0x118>
	    else
	        /* black pixel - output in PIXEL_BLACK */
		plot_pixel(x + col, y, PIXEL_BLACK);
  120464:	e0fffb17 	ldw	r3,-20(fp)
  120468:	e0bff817 	ldw	r2,-32(fp)
  12046c:	1885883a 	add	r2,r3,r2
  120470:	1007883a 	mov	r3,r2
  120474:	e0bffa17 	ldw	r2,-24(fp)
  120478:	1809883a 	mov	r4,r3
  12047c:	100b883a 	mov	r5,r2
  120480:	01800044 	movi	r6,1
  120484:	0121a8c0 	call	121a8c <plot_pixel>

	    /* shift the next bit into position */
	    bits <<= 1;
  120488:	e0bff717 	ldw	r2,-36(fp)
  12048c:	1085883a 	add	r2,r2,r2
  120490:	e0bff715 	stw	r2,-36(fp)
        /* get the bits "in position" (high bit is output first */
	bits <<= (8 - HORIZ_SIZE);


	/* now output the row of the character, pixel by pixel */
	for (col = 0; col < HORIZ_SIZE; col++)  {
  120494:	e0bff817 	ldw	r2,-32(fp)
  120498:	10800044 	addi	r2,r2,1
  12049c:	e0bff815 	stw	r2,-32(fp)
  1204a0:	e0bff817 	ldw	r2,-32(fp)
  1204a4:	10800190 	cmplti	r2,r2,6
  1204a8:	103fe11e 	bne	r2,zero,120430 <plot_char+0xc0>
	    bits <<= 1;
        }


	/* next row - update the y position */
	y++;
  1204ac:	e0bffa17 	ldw	r2,-24(fp)
  1204b0:	10800044 	addi	r2,r2,1
  1204b4:	e0bffa15 	stw	r2,-24(fp)
    x = pos_x * HORIZ_SIZE;
    y = pos_y * VERT_SIZE;


    /* loop outputting the bits to the screen */
    for (row = 0; row < VERT_SIZE; row++)  {
  1204b8:	e0bff917 	ldw	r2,-28(fp)
  1204bc:	10800044 	addi	r2,r2,1
  1204c0:	e0bff915 	stw	r2,-28(fp)
  1204c4:	e0bff917 	ldw	r2,-28(fp)
  1204c8:	10800210 	cmplti	r2,r2,8
  1204cc:	103fba1e 	bne	r2,zero,1203b8 <plot_char+0x48>
	y++;
    }


    /* all done, return */
    return;
  1204d0:	0001883a 	nop

}
  1204d4:	e037883a 	mov	sp,fp
  1204d8:	dfc00117 	ldw	ra,4(sp)
  1204dc:	df000017 	ldw	fp,0(sp)
  1204e0:	dec00204 	addi	sp,sp,8
  1204e4:	f800283a 	ret

001204e8 <plot_string>:
   Last Modified:    Mar. 17, 1997

*/

void  plot_string(int pos_x, int pos_y, const char *s, enum char_style style)
{
  1204e8:	defffa04 	addi	sp,sp,-24
  1204ec:	dfc00515 	stw	ra,20(sp)
  1204f0:	df000415 	stw	fp,16(sp)
  1204f4:	df000404 	addi	fp,sp,16
  1204f8:	e13ffc15 	stw	r4,-16(fp)
  1204fc:	e17ffd15 	stw	r5,-12(fp)
  120500:	e1bffe15 	stw	r6,-8(fp)
  120504:	e1ffff15 	stw	r7,-4(fp)
      /* none */



    /* loop, outputting characters from string s */
    while (*s != '\0')
  120508:	00001106 	br	120550 <plot_string+0x68>

        /* output this character and move to the next character and screen position */
	plot_char(pos_x++, pos_y, *s++, style);
  12050c:	e0fffc17 	ldw	r3,-16(fp)
  120510:	e0bffc17 	ldw	r2,-16(fp)
  120514:	10800044 	addi	r2,r2,1
  120518:	e0bffc15 	stw	r2,-16(fp)
  12051c:	e0bffe17 	ldw	r2,-8(fp)
  120520:	10800003 	ldbu	r2,0(r2)
  120524:	10803fcc 	andi	r2,r2,255
  120528:	1080201c 	xori	r2,r2,128
  12052c:	10bfe004 	addi	r2,r2,-128
  120530:	e13ffe17 	ldw	r4,-8(fp)
  120534:	21000044 	addi	r4,r4,1
  120538:	e13ffe15 	stw	r4,-8(fp)
  12053c:	1809883a 	mov	r4,r3
  120540:	e17ffd17 	ldw	r5,-12(fp)
  120544:	100d883a 	mov	r6,r2
  120548:	e1ffff17 	ldw	r7,-4(fp)
  12054c:	01203700 	call	120370 <plot_char>
      /* none */



    /* loop, outputting characters from string s */
    while (*s != '\0')
  120550:	e0bffe17 	ldw	r2,-8(fp)
  120554:	10800003 	ldbu	r2,0(r2)
  120558:	10803fcc 	andi	r2,r2,255
  12055c:	1080201c 	xori	r2,r2,128
  120560:	10bfe004 	addi	r2,r2,-128
  120564:	103fe91e 	bne	r2,zero,12050c <plot_string+0x24>
        /* output this character and move to the next character and screen position */
	plot_char(pos_x++, pos_y, *s++, style);


    /* all done, return */
    return;
  120568:	0001883a 	nop

}
  12056c:	e037883a 	mov	sp,fp
  120570:	dfc00117 	ldw	ra,4(sp)
  120574:	df000017 	ldw	fp,0(sp)
  120578:	dec00204 	addi	sp,sp,8
  12057c:	f800283a 	ret

00120580 <main>:

   Author:           Glen George
   Last Modified:    May 27, 2008

*/
int  main() {
  120580:	deffef04 	addi	sp,sp,-68
  120584:	dfc01015 	stw	ra,64(sp)
  120588:	df000f15 	stw	fp,60(sp)
  12058c:	df000f04 	addi	fp,sp,60
    	srampt++;
    	c++;
    	if(c >= 100) c = 0;
    }*/

	TestVRAM();
  120590:	0122bf80 	call	122bf8 <TestVRAM>
	}*/

	/* variables */
    enum keycode        key;		    /* an input key */

    enum status         state = MENU_ON;    /* current program state */
  120594:	e03ff115 	stw	zero,-60(fp)

    unsigned char      *sample;		    /* a captured trace */

    /* key processing functions (one for each system state type and key) */
    enum status  (* const process_key[NUM_KEYCODES][NUM_STATES])(enum status) =
  120598:	008004b4 	movhi	r2,18
  12059c:	10801804 	addi	r2,r2,96
  1205a0:	e0bff415 	stw	r2,-48(fp)
  1205a4:	008004b4 	movhi	r2,18
  1205a8:	10801804 	addi	r2,r2,96
  1205ac:	e0bff515 	stw	r2,-44(fp)
  1205b0:	008004b4 	movhi	r2,18
  1205b4:	10802c04 	addi	r2,r2,176
  1205b8:	e0bff615 	stw	r2,-40(fp)
  1205bc:	008004b4 	movhi	r2,18
  1205c0:	10800f04 	addi	r2,r2,60
  1205c4:	e0bff715 	stw	r2,-36(fp)
  1205c8:	008004b4 	movhi	r2,18
  1205cc:	10803804 	addi	r2,r2,224
  1205d0:	e0bff815 	stw	r2,-32(fp)
  1205d4:	008004b4 	movhi	r2,18
  1205d8:	10800f04 	addi	r2,r2,60
  1205dc:	e0bff915 	stw	r2,-28(fp)
  1205e0:	008004b4 	movhi	r2,18
  1205e4:	10804404 	addi	r2,r2,272
  1205e8:	e0bffa15 	stw	r2,-24(fp)
  1205ec:	008004b4 	movhi	r2,18
  1205f0:	10800f04 	addi	r2,r2,60
  1205f4:	e0bffb15 	stw	r2,-20(fp)
  1205f8:	008004b4 	movhi	r2,18
  1205fc:	10805004 	addi	r2,r2,320
  120600:	e0bffc15 	stw	r2,-16(fp)
  120604:	008004b4 	movhi	r2,18
  120608:	10800f04 	addi	r2,r2,60
  12060c:	e0bffd15 	stw	r2,-12(fp)
  120610:	008004b4 	movhi	r2,18
  120614:	10800f04 	addi	r2,r2,60
  120618:	e0bffe15 	stw	r2,-8(fp)
  12061c:	008004b4 	movhi	r2,18
  120620:	10800f04 	addi	r2,r2,60
  120624:	e0bfff15 	stw	r2,-4(fp)
        {  no_action,   no_action   } }; /* illegal key */



    /* first initialize everything */
    clear_display();		/* clear the display */
  120628:	0121a6c0 	call	121a6c <clear_display>

    init_trace();		/* initialize the trace routines */
  12062c:	0121cac0 	call	121cac <init_trace>
    init_menu();		/* initialize the menu system */
  120630:	01207940 	call	120794 <init_menu>
  120634:	00000106 	br	12063c <main+0xbc>
	    key = key_lookup();

	    /* execute processing routine for that key */
	    state = process_key[key][state](state);
	}
    }
  120638:	0001883a 	nop

    /* infinite loop processing input */
    while(TRUE)  {

        /* check if ready to do a trace */
	if (trace_rdy())
  12063c:	0121d680 	call	121d68 <trace_rdy>
  120640:	10000126 	beq	r2,zero,120648 <main+0xc8>
	    /* ready for a trace - do it */
	    do_trace();
  120644:	01227000 	call	122700 <do_trace>


	/* check if have a trace to display */
	if (is_sampling() && ((sample = sample_done()) != NULL))  {
  120648:	0121d480 	call	121d48 <is_sampling>
  12064c:	10000726 	beq	r2,zero,12066c <main+0xec>
  120650:	0121b4c0 	call	121b4c <sample_done>
  120654:	e0bff215 	stw	r2,-56(fp)
  120658:	e0bff217 	ldw	r2,-56(fp)
  12065c:	10000326 	beq	r2,zero,12066c <main+0xec>

	    /* have a trace - output it */
	    plot_trace(sample);
  120660:	e13ff217 	ldw	r4,-56(fp)
  120664:	01227480 	call	122748 <plot_trace>
	    /* done processing this trace */
	    trace_done();
  120668:	0121da00 	call	121da0 <trace_done>
	}


	/* now check for keypad input */
	if (key_available())  {
  12066c:	0121a2c0 	call	121a2c <key_available>
  120670:	10803fcc 	andi	r2,r2,255
  120674:	103ff026 	beq	r2,zero,120638 <main+0xb8>

	    /* have keypad input - get the key */
	    key = key_lookup();
  120678:	01206b80 	call	1206b8 <key_lookup>
  12067c:	e0bff315 	stw	r2,-52(fp)

	    /* execute processing routine for that key */
	    state = process_key[key][state](state);
  120680:	e0bff317 	ldw	r2,-52(fp)
  120684:	1087883a 	add	r3,r2,r2
  120688:	e0bff117 	ldw	r2,-60(fp)
  12068c:	1885883a 	add	r2,r3,r2
  120690:	1085883a 	add	r2,r2,r2
  120694:	1085883a 	add	r2,r2,r2
  120698:	e0fff104 	addi	r3,fp,-60
  12069c:	1885883a 	add	r2,r3,r2
  1206a0:	10800304 	addi	r2,r2,12
  1206a4:	10800017 	ldw	r2,0(r2)
  1206a8:	e13ff117 	ldw	r4,-60(fp)
  1206ac:	103ee83a 	callr	r2
  1206b0:	e0bff115 	stw	r2,-60(fp)
	}
    }
  1206b4:	003fe006 	br	120638 <main+0xb8>

001206b8 <key_lookup>:
   Last Modified:    Mar. 17, 1997

*/

enum keycode  	key_lookup()
{
  1206b8:	defff104 	addi	sp,sp,-60
  1206bc:	dfc00e15 	stw	ra,56(sp)
  1206c0:	df000d15 	stw	fp,52(sp)
  1206c4:	df000d04 	addi	fp,sp,52
    /* variables */

    const enum keycode  keycodes[] = /* array of keycodes */
  1206c8:	e03ff515 	stw	zero,-44(fp)
  1206cc:	00800044 	movi	r2,1
  1206d0:	e0bff615 	stw	r2,-40(fp)
  1206d4:	00800084 	movi	r2,2
  1206d8:	e0bff715 	stw	r2,-36(fp)
  1206dc:	008000c4 	movi	r2,3
  1206e0:	e0bff815 	stw	r2,-32(fp)
  1206e4:	00800104 	movi	r2,4
  1206e8:	e0bff915 	stw	r2,-28(fp)
  1206ec:	00800144 	movi	r2,5
  1206f0:	e0bffa15 	stw	r2,-24(fp)
	   KEYCODE_LEFT,      /* <Left>     */
	   KEYCODE_RIGHT,     /* <Right>    */
	   KEYCODE_ILLEGAL    /* other keys */
        }; 

    const int  keys[] =   /* array of key values */
  1206f4:	e03ffb15 	stw	zero,-20(fp)
  1206f8:	00800044 	movi	r2,1
  1206fc:	e0bffc15 	stw	r2,-16(fp)
  120700:	00800084 	movi	r2,2
  120704:	e0bffd15 	stw	r2,-12(fp)
  120708:	008000c4 	movi	r2,3
  12070c:	e0bffe15 	stw	r2,-8(fp)
  120710:	00800104 	movi	r2,4
  120714:	e0bfff15 	stw	r2,-4(fp)
    int  i;           	/* general loop index */



    /* get a key */
    key = getkey();
  120718:	0121a4c0 	call	121a4c <getkey>
  12071c:	e0bff415 	stw	r2,-48(fp)


    /* lookup key in keys array */
    for (i = 0; ((i < (sizeof(keys)/sizeof(int))) && (key != keys[i])); i++);
  120720:	e03ff315 	stw	zero,-52(fp)
  120724:	00000306 	br	120734 <key_lookup+0x7c>
  120728:	e0bff317 	ldw	r2,-52(fp)
  12072c:	10800044 	addi	r2,r2,1
  120730:	e0bff315 	stw	r2,-52(fp)
  120734:	e0bff317 	ldw	r2,-52(fp)
  120738:	10800168 	cmpgeui	r2,r2,5
  12073c:	1000091e 	bne	r2,zero,120764 <key_lookup+0xac>
  120740:	e0bff317 	ldw	r2,-52(fp)
  120744:	1085883a 	add	r2,r2,r2
  120748:	1085883a 	add	r2,r2,r2
  12074c:	e0fff304 	addi	r3,fp,-52
  120750:	1885883a 	add	r2,r3,r2
  120754:	10800804 	addi	r2,r2,32
  120758:	10c00017 	ldw	r3,0(r2)
  12075c:	e0bff417 	ldw	r2,-48(fp)
  120760:	18bff11e 	bne	r3,r2,120728 <key_lookup+0x70>


    /* return the appropriate key type */
    return  keycodes[i];
  120764:	e0bff317 	ldw	r2,-52(fp)
  120768:	1085883a 	add	r2,r2,r2
  12076c:	1085883a 	add	r2,r2,r2
  120770:	e0fff304 	addi	r3,fp,-52
  120774:	1885883a 	add	r2,r3,r2
  120778:	10800204 	addi	r2,r2,8
  12077c:	10800017 	ldw	r2,0(r2)

}
  120780:	e037883a 	mov	sp,fp
  120784:	dfc00117 	ldw	ra,4(sp)
  120788:	df000017 	ldw	fp,0(sp)
  12078c:	dec00204 	addi	sp,sp,8
  120790:	f800283a 	ret

00120794 <init_menu>:
   Last Modified:    Mar. 17, 1997

*/

void  init_menu(void)
{
  120794:	defffe04 	addi	sp,sp,-8
  120798:	dfc00115 	stw	ra,4(sp)
  12079c:	df000015 	stw	fp,0(sp)
  1207a0:	d839883a 	mov	fp,sp
      /* none */



    /* set the menu parameters */
    menu_entry = 0;		/* first menu entry */
  1207a4:	d0217a15 	stw	zero,-31256(gp)
    menu_display = FALSE;	/* menu is not currently displayed (but it will be shortly) */
  1207a8:	d0217b15 	stw	zero,-31252(gp)


    /* set the scope (option) parameters */
    set_trigger_mode(NORMAL_TRIGGER);	/* normal triggering */
  1207ac:	0009883a 	mov	r4,zero
  1207b0:	0120d140 	call	120d14 <set_trigger_mode>
    set_scale(SCALE_AXES);		/* scale is axes */
  1207b4:	01000044 	movi	r4,1
  1207b8:	0120ec00 	call	120ec0 <set_scale>
    set_sweep(0);			/* first sweep rate */
  1207bc:	0009883a 	mov	r4,zero
  1207c0:	012104c0 	call	12104c <set_sweep>
    set_trg_level((MIN_TRG_LEVEL_SET + MAX_TRG_LEVEL_SET) / 2);	/* middle trigger level */
  1207c4:	01000fc4 	movi	r4,63
  1207c8:	01212180 	call	121218 <set_trg_level>
    set_trg_slope(SLOPE_POSITIVE);	/* positive slope */
  1207cc:	0009883a 	mov	r4,zero
  1207d0:	01213a80 	call	1213a8 <set_trg_slope>
    set_trg_delay(MIN_DELAY);		/* minimum delay */
  1207d4:	0009883a 	mov	r4,zero
  1207d8:	01214bc0 	call	1214bc <set_trg_delay>


    /* now display the menu */
    display_menu();
  1207dc:	01208300 	call	120830 <display_menu>


    /* done initializing, return */
    return;
  1207e0:	0001883a 	nop

}
  1207e4:	e037883a 	mov	sp,fp
  1207e8:	dfc00117 	ldw	ra,4(sp)
  1207ec:	df000017 	ldw	fp,0(sp)
  1207f0:	dec00204 	addi	sp,sp,8
  1207f4:	f800283a 	ret

001207f8 <clear_menu>:
   Last Modified:    Mar. 13, 1994

*/

void  clear_menu(void)
{
  1207f8:	defffe04 	addi	sp,sp,-8
  1207fc:	dfc00115 	stw	ra,4(sp)
  120800:	df000015 	stw	fp,0(sp)
  120804:	d839883a 	mov	fp,sp
      /* none */



    /* check if the menu is currently being displayed */
    if (menu_display)  {
  120808:	d0a17b17 	ldw	r2,-31252(gp)
  12080c:	10000126 	beq	r2,zero,120814 <clear_menu+0x1c>

        /* menu is being displayed - turn it off and restore the trace in that area */
	restore_menu_trace();
  120810:	01223f40 	call	1223f4 <restore_menu_trace>
    }


    /* no longer displaying the menu */
    menu_display = FALSE;
  120814:	d0217b15 	stw	zero,-31252(gp)


    /* all done, return */
    return;
  120818:	0001883a 	nop

}
  12081c:	e037883a 	mov	sp,fp
  120820:	dfc00117 	ldw	ra,4(sp)
  120824:	df000017 	ldw	fp,0(sp)
  120828:	dec00204 	addi	sp,sp,8
  12082c:	f800283a 	ret

00120830 <display_menu>:
   Last Modified:    Mar. 13, 1994

*/

void  display_menu(void)
{
  120830:	defffd04 	addi	sp,sp,-12
  120834:	dfc00215 	stw	ra,8(sp)
  120838:	df000115 	stw	fp,4(sp)
  12083c:	df000104 	addi	fp,sp,4
    int  i;		/* loop index */



    /* check if the menu is currently being displayed */
    if (!menu_display)  {
  120840:	d0a17b17 	ldw	r2,-31252(gp)
  120844:	1000121e 	bne	r2,zero,120890 <display_menu+0x60>

        /* menu is not being displayed - turn it on */
	/* display it entry by entry */
	for (i = 0; i < NO_MENU_ENTRIES; i++)  {
  120848:	e03fff15 	stw	zero,-4(fp)
  12084c:	00000d06 	br	120884 <display_menu+0x54>

	    /* display this entry - check if it should be highlighted */
	    if (i == menu_entry)
  120850:	d0a17a17 	ldw	r2,-31256(gp)
  120854:	e0ffff17 	ldw	r3,-4(fp)
  120858:	1880041e 	bne	r3,r2,12086c <display_menu+0x3c>
	        /* currently selected entry - highlight it */
	        display_entry(i, TRUE);
  12085c:	e13fff17 	ldw	r4,-4(fp)
  120860:	01400044 	movi	r5,1
  120864:	0120bf80 	call	120bf8 <display_entry>
  120868:	00000306 	br	120878 <display_menu+0x48>
	    else
	        /* not the currently selected entry - "normal video" */
	        display_entry(i, FALSE);
  12086c:	e13fff17 	ldw	r4,-4(fp)
  120870:	000b883a 	mov	r5,zero
  120874:	0120bf80 	call	120bf8 <display_entry>
    /* check if the menu is currently being displayed */
    if (!menu_display)  {

        /* menu is not being displayed - turn it on */
	/* display it entry by entry */
	for (i = 0; i < NO_MENU_ENTRIES; i++)  {
  120878:	e0bfff17 	ldw	r2,-4(fp)
  12087c:	10800044 	addi	r2,r2,1
  120880:	e0bfff15 	stw	r2,-4(fp)
  120884:	e0bfff17 	ldw	r2,-4(fp)
  120888:	108001f0 	cmpltui	r2,r2,7
  12088c:	103ff01e 	bne	r2,zero,120850 <display_menu+0x20>
        }
    }


    /* now are displaying the menu */
    menu_display = TRUE;
  120890:	00800044 	movi	r2,1
  120894:	d0a17b15 	stw	r2,-31252(gp)


    /* all done, return */
    return;
  120898:	0001883a 	nop

}
  12089c:	e037883a 	mov	sp,fp
  1208a0:	dfc00117 	ldw	ra,4(sp)
  1208a4:	df000017 	ldw	fp,0(sp)
  1208a8:	dec00204 	addi	sp,sp,8
  1208ac:	f800283a 	ret

001208b0 <refresh_menu>:
   Last Modified:    Mar. 8, 1994

*/

void  refresh_menu(void)
{
  1208b0:	defffe04 	addi	sp,sp,-8
  1208b4:	dfc00115 	stw	ra,4(sp)
  1208b8:	df000015 	stw	fp,0(sp)
  1208bc:	d839883a 	mov	fp,sp
      /* none */



    /* check if the menu is currently being displayed */
    if (menu_display)  {
  1208c0:	d0a17b17 	ldw	r2,-31252(gp)
  1208c4:	10000226 	beq	r2,zero,1208d0 <refresh_menu+0x20>

    	/* menu is currently being displayed - need to refresh it */
	/* do this by turning off the display, then forcing it back on */
	menu_display = FALSE;
  1208c8:	d0217b15 	stw	zero,-31252(gp)
	display_menu();
  1208cc:	01208300 	call	120830 <display_menu>
    }


    /* refreshed the menu if it was displayed, now return */
    return;
  1208d0:	0001883a 	nop

}
  1208d4:	e037883a 	mov	sp,fp
  1208d8:	dfc00117 	ldw	ra,4(sp)
  1208dc:	df000017 	ldw	fp,0(sp)
  1208e0:	dec00204 	addi	sp,sp,8
  1208e4:	f800283a 	ret

001208e8 <reset_menu>:
   Last Modified:    Mar. 17, 1997

*/

void  reset_menu(void)
{
  1208e8:	defffe04 	addi	sp,sp,-8
  1208ec:	dfc00115 	stw	ra,4(sp)
  1208f0:	df000015 	stw	fp,0(sp)
  1208f4:	d839883a 	mov	fp,sp
      /* none */



    /* check if the menu is currently being displayed */
    if (menu_display)  {
  1208f8:	d0a17b17 	ldw	r2,-31252(gp)
  1208fc:	10000426 	beq	r2,zero,120910 <reset_menu+0x28>

        /* menu is being displayed */
	/* remove highlight from currently selected entry */
	display_entry(menu_entry, FALSE);
  120900:	d0a17a17 	ldw	r2,-31256(gp)
  120904:	1009883a 	mov	r4,r2
  120908:	000b883a 	mov	r5,zero
  12090c:	0120bf80 	call	120bf8 <display_entry>
    }


    /* reset the currently selected entry */
    menu_entry = 0;
  120910:	d0217a15 	stw	zero,-31256(gp)


    /* finally, highlight the first entry if the menu is being displayed */
    if (menu_display)
  120914:	d0a17b17 	ldw	r2,-31252(gp)
  120918:	10000426 	beq	r2,zero,12092c <reset_menu+0x44>
	display_entry(menu_entry, TRUE);
  12091c:	d0a17a17 	ldw	r2,-31256(gp)
  120920:	1009883a 	mov	r4,r2
  120924:	01400044 	movi	r5,1
  120928:	0120bf80 	call	120bf8 <display_entry>



    /* all done, return */
    return;
  12092c:	0001883a 	nop

}
  120930:	e037883a 	mov	sp,fp
  120934:	dfc00117 	ldw	ra,4(sp)
  120938:	df000017 	ldw	fp,0(sp)
  12093c:	dec00204 	addi	sp,sp,8
  120940:	f800283a 	ret

00120944 <next_entry>:
   Last Modified:    Mar. 13, 1994

*/

void  next_entry(void)
{
  120944:	defffe04 	addi	sp,sp,-8
  120948:	dfc00115 	stw	ra,4(sp)
  12094c:	df000015 	stw	fp,0(sp)
  120950:	d839883a 	mov	fp,sp
      /* none */



    /* only update if not at end of the menu */
    if (menu_entry < (NO_MENU_ENTRIES - 1))  {
  120954:	d0a17a17 	ldw	r2,-31256(gp)
  120958:	108001a8 	cmpgeui	r2,r2,6
  12095c:	10000f1e 	bne	r2,zero,12099c <next_entry+0x58>

        /* not at the end of the menu */

	/* turn off current entry if displaying */
	if (menu_display)
  120960:	d0a17b17 	ldw	r2,-31252(gp)
  120964:	10000426 	beq	r2,zero,120978 <next_entry+0x34>
            /* displaying menu - turn off currently selected entry */
	    display_entry(menu_entry, FALSE);
  120968:	d0a17a17 	ldw	r2,-31256(gp)
  12096c:	1009883a 	mov	r4,r2
  120970:	000b883a 	mov	r5,zero
  120974:	0120bf80 	call	120bf8 <display_entry>

	/* update the menu entry to the next one */
	menu_entry++;
  120978:	d0a17a17 	ldw	r2,-31256(gp)
  12097c:	10800044 	addi	r2,r2,1
  120980:	d0a17a15 	stw	r2,-31256(gp)

	/* now highlight this entry if displaying the menu */
	if (menu_display)
  120984:	d0a17b17 	ldw	r2,-31252(gp)
  120988:	10000426 	beq	r2,zero,12099c <next_entry+0x58>
            /* displaying menu - highlight newly selected entry */
	    display_entry(menu_entry, TRUE);
  12098c:	d0a17a17 	ldw	r2,-31256(gp)
  120990:	1009883a 	mov	r4,r2
  120994:	01400044 	movi	r5,1
  120998:	0120bf80 	call	120bf8 <display_entry>
    }


    /* all done, return */
    return;
  12099c:	0001883a 	nop

}
  1209a0:	e037883a 	mov	sp,fp
  1209a4:	dfc00117 	ldw	ra,4(sp)
  1209a8:	df000017 	ldw	fp,0(sp)
  1209ac:	dec00204 	addi	sp,sp,8
  1209b0:	f800283a 	ret

001209b4 <previous_entry>:
   Last Modified:    Mar. 13, 1994

*/

void  previous_entry(void)
{
  1209b4:	defffe04 	addi	sp,sp,-8
  1209b8:	dfc00115 	stw	ra,4(sp)
  1209bc:	df000015 	stw	fp,0(sp)
  1209c0:	d839883a 	mov	fp,sp
      /* none */



    /* only update if not at the start of the menu */
    if (menu_entry > 0)  {
  1209c4:	d0a17a17 	ldw	r2,-31256(gp)
  1209c8:	00800f0e 	bge	zero,r2,120a08 <previous_entry+0x54>

        /* not at the start of the menu */

	/* turn off current entry if displaying */
	if (menu_display)
  1209cc:	d0a17b17 	ldw	r2,-31252(gp)
  1209d0:	10000426 	beq	r2,zero,1209e4 <previous_entry+0x30>
            /* displaying menu - turn off currently selected entry */
	    display_entry(menu_entry, FALSE);
  1209d4:	d0a17a17 	ldw	r2,-31256(gp)
  1209d8:	1009883a 	mov	r4,r2
  1209dc:	000b883a 	mov	r5,zero
  1209e0:	0120bf80 	call	120bf8 <display_entry>

	/* update the menu entry to the previous one */
	menu_entry--;
  1209e4:	d0a17a17 	ldw	r2,-31256(gp)
  1209e8:	10bfffc4 	addi	r2,r2,-1
  1209ec:	d0a17a15 	stw	r2,-31256(gp)

	/* now highlight this entry if displaying the menu */
	if (menu_display)
  1209f0:	d0a17b17 	ldw	r2,-31252(gp)
  1209f4:	10000426 	beq	r2,zero,120a08 <previous_entry+0x54>
            /* displaying menu - highlight newly selected entry */
	    display_entry(menu_entry, TRUE);
  1209f8:	d0a17a17 	ldw	r2,-31256(gp)
  1209fc:	1009883a 	mov	r4,r2
  120a00:	01400044 	movi	r5,1
  120a04:	0120bf80 	call	120bf8 <display_entry>

    }


    /* all done, return */
    return;
  120a08:	0001883a 	nop

}
  120a0c:	e037883a 	mov	sp,fp
  120a10:	dfc00117 	ldw	ra,4(sp)
  120a14:	df000017 	ldw	fp,0(sp)
  120a18:	dec00204 	addi	sp,sp,8
  120a1c:	f800283a 	ret

00120a20 <menu_entry_left>:
   Last Modified:    May 9, 2006

*/

void  menu_entry_left(void)
{
  120a20:	defff704 	addi	sp,sp,-36
  120a24:	dfc00815 	stw	ra,32(sp)
  120a28:	df000715 	stw	fp,28(sp)
  120a2c:	df000704 	addi	fp,sp,28
    /* variables */

    /* key processing functions */
    void  (* const process[])(void) =
  120a30:	008004b4 	movhi	r2,18
  120a34:	10835d04 	addi	r2,r2,3444
  120a38:	e0bff915 	stw	r2,-28(fp)
  120a3c:	008004b4 	movhi	r2,18
  120a40:	1083c004 	addi	r2,r2,3840
  120a44:	e0bffa15 	stw	r2,-24(fp)
  120a48:	008004b4 	movhi	r2,18
  120a4c:	10842b04 	addi	r2,r2,4268
  120a50:	e0bffb15 	stw	r2,-20(fp)
  120a54:	008004b4 	movhi	r2,18
  120a58:	10877804 	addi	r2,r2,7648
  120a5c:	e0bffc15 	stw	r2,-16(fp)
  120a60:	008004b4 	movhi	r2,18
  120a64:	10849804 	addi	r2,r2,4704
  120a68:	e0bffd15 	stw	r2,-12(fp)
  120a6c:	008004b4 	movhi	r2,18
  120a70:	1084fc04 	addi	r2,r2,5104
  120a74:	e0bffe15 	stw	r2,-8(fp)
  120a78:	008004b4 	movhi	r2,18
  120a7c:	10853f04 	addi	r2,r2,5372
  120a80:	e0bfff15 	stw	r2,-4(fp)
       /*  Level           Slope             Delay                        */



    /* invoke the appropriate <Left> key function */
    process[menu_entry]();
  120a84:	d0a17a17 	ldw	r2,-31256(gp)
  120a88:	1085883a 	add	r2,r2,r2
  120a8c:	1085883a 	add	r2,r2,r2
  120a90:	e0fff904 	addi	r3,fp,-28
  120a94:	1885883a 	add	r2,r3,r2
  120a98:	10800017 	ldw	r2,0(r2)
  120a9c:	103ee83a 	callr	r2

    /* if displaying menu entries, display the new value */
    /* note: since it is being changed - know this option is selected */
    if (menu_display)  {
  120aa0:	d0a17b17 	ldw	r2,-31252(gp)
  120aa4:	10001426 	beq	r2,zero,120af8 <menu_entry_left+0xd8>
        menu[menu_entry].display((MENU_X + menu[menu_entry].opt_off),
  120aa8:	d0a17a17 	ldw	r2,-31256(gp)
  120aac:	00c004b4 	movhi	r3,18
  120ab0:	18cf2d04 	addi	r3,r3,15540
  120ab4:	1004913a 	slli	r2,r2,4
  120ab8:	1885883a 	add	r2,r3,r2
  120abc:	10800304 	addi	r2,r2,12
  120ac0:	11c00017 	ldw	r7,0(r2)
  120ac4:	d0a17a17 	ldw	r2,-31256(gp)
  120ac8:	00c004b4 	movhi	r3,18
  120acc:	18cf2d04 	addi	r3,r3,15540
  120ad0:	1004913a 	slli	r2,r2,4
  120ad4:	1885883a 	add	r2,r3,r2
  120ad8:	10800204 	addi	r2,r2,8
  120adc:	10800017 	ldw	r2,0(r2)
  120ae0:	10c00fc4 	addi	r3,r2,63
  120ae4:	d0a17a17 	ldw	r2,-31256(gp)
  120ae8:	1809883a 	mov	r4,r3
  120aec:	100b883a 	mov	r5,r2
  120af0:	000d883a 	mov	r6,zero
  120af4:	383ee83a 	callr	r7


    /* all done, return */
    return;

}
  120af8:	e037883a 	mov	sp,fp
  120afc:	dfc00117 	ldw	ra,4(sp)
  120b00:	df000017 	ldw	fp,0(sp)
  120b04:	dec00204 	addi	sp,sp,8
  120b08:	f800283a 	ret

00120b0c <menu_entry_right>:
   Last Modified:    May 9, 2006

*/

void  menu_entry_right(void)
{
  120b0c:	defff704 	addi	sp,sp,-36
  120b10:	dfc00815 	stw	ra,32(sp)
  120b14:	df000715 	stw	fp,28(sp)
  120b18:	df000704 	addi	fp,sp,28
    /* variables */

    /* key processing functions */
    void  (* const process[])(void) =
  120b1c:	008004b4 	movhi	r2,18
  120b20:	10837604 	addi	r2,r2,3544
  120b24:	e0bff915 	stw	r2,-28(fp)
  120b28:	008004b4 	movhi	r2,18
  120b2c:	1083d904 	addi	r2,r2,3940
  120b30:	e0bffa15 	stw	r2,-24(fp)
  120b34:	008004b4 	movhi	r2,18
  120b38:	10844b04 	addi	r2,r2,4396
  120b3c:	e0bffb15 	stw	r2,-20(fp)
  120b40:	008004b4 	movhi	r2,18
  120b44:	10877804 	addi	r2,r2,7648
  120b48:	e0bffc15 	stw	r2,-16(fp)
  120b4c:	008004b4 	movhi	r2,18
  120b50:	1084ac04 	addi	r2,r2,4784
  120b54:	e0bffd15 	stw	r2,-12(fp)
  120b58:	008004b4 	movhi	r2,18
  120b5c:	1084fc04 	addi	r2,r2,5104
  120b60:	e0bffe15 	stw	r2,-8(fp)
  120b64:	008004b4 	movhi	r2,18
  120b68:	10855104 	addi	r2,r2,5444
  120b6c:	e0bfff15 	stw	r2,-4(fp)
       /*  Level         Slope             Delay                        */



    /* invoke the appropriate <Right> key function */
    process[menu_entry]();
  120b70:	d0a17a17 	ldw	r2,-31256(gp)
  120b74:	1085883a 	add	r2,r2,r2
  120b78:	1085883a 	add	r2,r2,r2
  120b7c:	e0fff904 	addi	r3,fp,-28
  120b80:	1885883a 	add	r2,r3,r2
  120b84:	10800017 	ldw	r2,0(r2)
  120b88:	103ee83a 	callr	r2

    /* if displaying menu entries, display the new value */
    /* note: since it is being changed - know this option is selected */
    if (menu_display)  {
  120b8c:	d0a17b17 	ldw	r2,-31252(gp)
  120b90:	10001426 	beq	r2,zero,120be4 <menu_entry_right+0xd8>
        menu[menu_entry].display((MENU_X + menu[menu_entry].opt_off),
  120b94:	d0a17a17 	ldw	r2,-31256(gp)
  120b98:	00c004b4 	movhi	r3,18
  120b9c:	18cf2d04 	addi	r3,r3,15540
  120ba0:	1004913a 	slli	r2,r2,4
  120ba4:	1885883a 	add	r2,r3,r2
  120ba8:	10800304 	addi	r2,r2,12
  120bac:	11c00017 	ldw	r7,0(r2)
  120bb0:	d0a17a17 	ldw	r2,-31256(gp)
  120bb4:	00c004b4 	movhi	r3,18
  120bb8:	18cf2d04 	addi	r3,r3,15540
  120bbc:	1004913a 	slli	r2,r2,4
  120bc0:	1885883a 	add	r2,r3,r2
  120bc4:	10800204 	addi	r2,r2,8
  120bc8:	10800017 	ldw	r2,0(r2)
  120bcc:	10c00fc4 	addi	r3,r2,63
  120bd0:	d0a17a17 	ldw	r2,-31256(gp)
  120bd4:	1809883a 	mov	r4,r3
  120bd8:	100b883a 	mov	r5,r2
  120bdc:	000d883a 	mov	r6,zero
  120be0:	383ee83a 	callr	r7


    /* all done, return */
    return;

}
  120be4:	e037883a 	mov	sp,fp
  120be8:	dfc00117 	ldw	ra,4(sp)
  120bec:	df000017 	ldw	fp,0(sp)
  120bf0:	dec00204 	addi	sp,sp,8
  120bf4:	f800283a 	ret

00120bf8 <display_entry>:
   Last Modified:    Aug. 13, 2004

*/

void  display_entry(int entry, int selected)
{
  120bf8:	defffc04 	addi	sp,sp,-16
  120bfc:	dfc00315 	stw	ra,12(sp)
  120c00:	df000215 	stw	fp,8(sp)
  120c04:	df000204 	addi	fp,sp,8
  120c08:	e13ffe15 	stw	r4,-8(fp)
  120c0c:	e17fff15 	stw	r5,-4(fp)
      /* none */



    /* output the menu entry with the appropriate color */
    plot_string((MENU_X + menu[entry].h_off), (MENU_Y + entry), menu[entry].s,
  120c10:	00c004b4 	movhi	r3,18
  120c14:	18cf2d04 	addi	r3,r3,15540
  120c18:	e0bffe17 	ldw	r2,-8(fp)
  120c1c:	1004913a 	slli	r2,r2,4
  120c20:	1885883a 	add	r2,r3,r2
  120c24:	10800104 	addi	r2,r2,4
  120c28:	10800017 	ldw	r2,0(r2)
  120c2c:	11000fc4 	addi	r4,r2,63
  120c30:	00c004b4 	movhi	r3,18
  120c34:	18cf2d04 	addi	r3,r3,15540
  120c38:	e0bffe17 	ldw	r2,-8(fp)
  120c3c:	1004913a 	slli	r2,r2,4
  120c40:	1885883a 	add	r2,r3,r2
  120c44:	10c00017 	ldw	r3,0(r2)
  120c48:	e0bfff17 	ldw	r2,-4(fp)
  120c4c:	1004c03a 	cmpne	r2,r2,zero
  120c50:	10803fcc 	andi	r2,r2,255
  120c54:	e17ffe17 	ldw	r5,-8(fp)
  120c58:	180d883a 	mov	r6,r3
  120c5c:	100f883a 	mov	r7,r2
  120c60:	01204e80 	call	1204e8 <plot_string>
    		(selected ? SELECTED : NORMAL));
    /* also output the menu option with the appropriate color */
    menu[entry].display((MENU_X + menu[entry].opt_off), (MENU_Y + entry),
  120c64:	00c004b4 	movhi	r3,18
  120c68:	18cf2d04 	addi	r3,r3,15540
  120c6c:	e0bffe17 	ldw	r2,-8(fp)
  120c70:	1004913a 	slli	r2,r2,4
  120c74:	1885883a 	add	r2,r3,r2
  120c78:	10800304 	addi	r2,r2,12
  120c7c:	10c00017 	ldw	r3,0(r2)
  120c80:	010004b4 	movhi	r4,18
  120c84:	210f2d04 	addi	r4,r4,15540
  120c88:	e0bffe17 	ldw	r2,-8(fp)
  120c8c:	1004913a 	slli	r2,r2,4
  120c90:	2085883a 	add	r2,r4,r2
  120c94:	10800204 	addi	r2,r2,8
  120c98:	10800017 	ldw	r2,0(r2)
  120c9c:	10800fc4 	addi	r2,r2,63
  120ca0:	1009883a 	mov	r4,r2
  120ca4:	e17ffe17 	ldw	r5,-8(fp)
  120ca8:	000d883a 	mov	r6,zero
  120cac:	183ee83a 	callr	r3
    			(selected ? OPTION_SELECTED : OPTION_NORMAL));


    /* all done outputting this menu entry - return */
    return;
  120cb0:	0001883a 	nop

}
  120cb4:	e037883a 	mov	sp,fp
  120cb8:	dfc00117 	ldw	ra,4(sp)
  120cbc:	df000017 	ldw	fp,0(sp)
  120cc0:	dec00204 	addi	sp,sp,8
  120cc4:	f800283a 	ret

00120cc8 <no_menu_action>:
   Last Modified:    Mar. 8, 1994

*/

void  no_menu_action()
{
  120cc8:	deffff04 	addi	sp,sp,-4
  120ccc:	df000015 	stw	fp,0(sp)
  120cd0:	d839883a 	mov	fp,sp
      /* none */



    /* nothing to do - return */
    return;
  120cd4:	0001883a 	nop

}
  120cd8:	e037883a 	mov	sp,fp
  120cdc:	df000017 	ldw	fp,0(sp)
  120ce0:	dec00104 	addi	sp,sp,4
  120ce4:	f800283a 	ret

00120ce8 <no_display>:
   Last Modified:    Mar. 8, 1994

*/

void  no_display(int x_pos, int y_pos, int style)
{
  120ce8:	defffc04 	addi	sp,sp,-16
  120cec:	df000315 	stw	fp,12(sp)
  120cf0:	df000304 	addi	fp,sp,12
  120cf4:	e13ffd15 	stw	r4,-12(fp)
  120cf8:	e17ffe15 	stw	r5,-8(fp)
  120cfc:	e1bfff15 	stw	r6,-4(fp)
      /* none */



    /* nothing to do - return */
    return;
  120d00:	0001883a 	nop

}
  120d04:	e037883a 	mov	sp,fp
  120d08:	df000017 	ldw	fp,0(sp)
  120d0c:	dec00104 	addi	sp,sp,4
  120d10:	f800283a 	ret

00120d14 <set_trigger_mode>:
   Last Modified:    Mar. 8, 1994

*/

void  set_trigger_mode(enum trigger_type m)
{
  120d14:	defffd04 	addi	sp,sp,-12
  120d18:	dfc00215 	stw	ra,8(sp)
  120d1c:	df000115 	stw	fp,4(sp)
  120d20:	df000104 	addi	fp,sp,4
  120d24:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* set the trigger mode */
    trigger_mode = m;
  120d28:	e0bfff17 	ldw	r2,-4(fp)
  120d2c:	d0a17c15 	stw	r2,-31248(gp)

    /* set the new mode */
    set_mode(trigger_mode);
  120d30:	d0a17c17 	ldw	r2,-31248(gp)
  120d34:	1009883a 	mov	r4,r2
  120d38:	0121d100 	call	121d10 <set_mode>


    /* all done setting the trigger mode - return */
    return;
  120d3c:	0001883a 	nop

}
  120d40:	e037883a 	mov	sp,fp
  120d44:	dfc00117 	ldw	ra,4(sp)
  120d48:	df000017 	ldw	fp,0(sp)
  120d4c:	dec00204 	addi	sp,sp,8
  120d50:	f800283a 	ret

00120d54 <get_trigger_mode>:
   Last Modified:    May 9, 2006

*/

enum trigger_type  get_trigger_mode()
{
  120d54:	deffff04 	addi	sp,sp,-4
  120d58:	df000015 	stw	fp,0(sp)
  120d5c:	d839883a 	mov	fp,sp
      /* none */



    /* return the current trigger mode */
    return  trigger_mode;
  120d60:	d0a17c17 	ldw	r2,-31248(gp)

}
  120d64:	e037883a 	mov	sp,fp
  120d68:	df000017 	ldw	fp,0(sp)
  120d6c:	dec00104 	addi	sp,sp,4
  120d70:	f800283a 	ret

00120d74 <mode_down>:
   Last Modified:    May 9, 2006

*/

void  mode_down()
{
  120d74:	defffe04 	addi	sp,sp,-8
  120d78:	dfc00115 	stw	ra,4(sp)
  120d7c:	df000015 	stw	fp,0(sp)
  120d80:	d839883a 	mov	fp,sp
      /* none */



    /* move to the "next" triggering mode */
    if (trigger_mode == NORMAL_TRIGGER)
  120d84:	d0a17c17 	ldw	r2,-31248(gp)
  120d88:	1000031e 	bne	r2,zero,120d98 <mode_down+0x24>
        trigger_mode = AUTO_TRIGGER;
  120d8c:	00800044 	movi	r2,1
  120d90:	d0a17c15 	stw	r2,-31248(gp)
  120d94:	00000706 	br	120db4 <mode_down+0x40>
    else if (trigger_mode == AUTO_TRIGGER)
  120d98:	d0a17c17 	ldw	r2,-31248(gp)
  120d9c:	10800058 	cmpnei	r2,r2,1
  120da0:	1000031e 	bne	r2,zero,120db0 <mode_down+0x3c>
        trigger_mode = ONESHOT_TRIGGER;
  120da4:	00800084 	movi	r2,2
  120da8:	d0a17c15 	stw	r2,-31248(gp)
  120dac:	00000106 	br	120db4 <mode_down+0x40>
    else
        trigger_mode = NORMAL_TRIGGER;
  120db0:	d0217c15 	stw	zero,-31248(gp)

    /* set the new mode */
    set_mode(trigger_mode);
  120db4:	d0a17c17 	ldw	r2,-31248(gp)
  120db8:	1009883a 	mov	r4,r2
  120dbc:	0121d100 	call	121d10 <set_mode>


    /* all done with the trigger mode - return */
    return;
  120dc0:	0001883a 	nop

}
  120dc4:	e037883a 	mov	sp,fp
  120dc8:	dfc00117 	ldw	ra,4(sp)
  120dcc:	df000017 	ldw	fp,0(sp)
  120dd0:	dec00204 	addi	sp,sp,8
  120dd4:	f800283a 	ret

00120dd8 <mode_up>:
   Last Modified:    May 9, 2006

*/

void  mode_up()
{
  120dd8:	defffe04 	addi	sp,sp,-8
  120ddc:	dfc00115 	stw	ra,4(sp)
  120de0:	df000015 	stw	fp,0(sp)
  120de4:	d839883a 	mov	fp,sp
      /* none */



    /* move to the "previous" triggering mode */
    if (trigger_mode == NORMAL_TRIGGER)
  120de8:	d0a17c17 	ldw	r2,-31248(gp)
  120dec:	1000031e 	bne	r2,zero,120dfc <mode_up+0x24>
        trigger_mode = ONESHOT_TRIGGER;
  120df0:	00800084 	movi	r2,2
  120df4:	d0a17c15 	stw	r2,-31248(gp)
  120df8:	00000706 	br	120e18 <mode_up+0x40>
    else if (trigger_mode == AUTO_TRIGGER)
  120dfc:	d0a17c17 	ldw	r2,-31248(gp)
  120e00:	10800058 	cmpnei	r2,r2,1
  120e04:	1000021e 	bne	r2,zero,120e10 <mode_up+0x38>
        trigger_mode = NORMAL_TRIGGER;
  120e08:	d0217c15 	stw	zero,-31248(gp)
  120e0c:	00000206 	br	120e18 <mode_up+0x40>
    else
        trigger_mode = AUTO_TRIGGER;
  120e10:	00800044 	movi	r2,1
  120e14:	d0a17c15 	stw	r2,-31248(gp)

    /* set the new mode */
    set_mode(trigger_mode);
  120e18:	d0a17c17 	ldw	r2,-31248(gp)
  120e1c:	1009883a 	mov	r4,r2
  120e20:	0121d100 	call	121d10 <set_mode>


    /* all done with the trigger mode - return */
    return;
  120e24:	0001883a 	nop

}
  120e28:	e037883a 	mov	sp,fp
  120e2c:	dfc00117 	ldw	ra,4(sp)
  120e30:	df000017 	ldw	fp,0(sp)
  120e34:	dec00204 	addi	sp,sp,8
  120e38:	f800283a 	ret

00120e3c <display_mode>:
   Last Modified:    May 9, 2006

*/

void  display_mode(int x_pos, int y_pos, int style)
{
  120e3c:	defff804 	addi	sp,sp,-32
  120e40:	dfc00715 	stw	ra,28(sp)
  120e44:	df000615 	stw	fp,24(sp)
  120e48:	df000604 	addi	fp,sp,24
  120e4c:	e13ffd15 	stw	r4,-12(fp)
  120e50:	e17ffe15 	stw	r5,-8(fp)
  120e54:	e1bfff15 	stw	r6,-4(fp)
    /* variables */

    /* the mode strings (must match enumerated type) */
    const char * const  modes[] =  {  " Normal   ",
  120e58:	008004b4 	movhi	r2,18
  120e5c:	108f8d04 	addi	r2,r2,15924
  120e60:	e0bffa15 	stw	r2,-24(fp)
  120e64:	008004b4 	movhi	r2,18
  120e68:	108f9004 	addi	r2,r2,15936
  120e6c:	e0bffb15 	stw	r2,-20(fp)
  120e70:	008004b4 	movhi	r2,18
  120e74:	108f9304 	addi	r2,r2,15948
  120e78:	e0bffc15 	stw	r2,-16(fp)
                                             " One-Shot "  };



    /* display the trigger mode */
    plot_string(x_pos, y_pos, modes[trigger_mode], style);
  120e7c:	d0a17c17 	ldw	r2,-31248(gp)
  120e80:	1085883a 	add	r2,r2,r2
  120e84:	1085883a 	add	r2,r2,r2
  120e88:	e0fffa04 	addi	r3,fp,-24
  120e8c:	1885883a 	add	r2,r3,r2
  120e90:	10c00017 	ldw	r3,0(r2)
  120e94:	e0bfff17 	ldw	r2,-4(fp)
  120e98:	e13ffd17 	ldw	r4,-12(fp)
  120e9c:	e17ffe17 	ldw	r5,-8(fp)
  120ea0:	180d883a 	mov	r6,r3
  120ea4:	100f883a 	mov	r7,r2
  120ea8:	01204e80 	call	1204e8 <plot_string>


    /* all done displaying the trigger mode - return */
    return;

}
  120eac:	e037883a 	mov	sp,fp
  120eb0:	dfc00117 	ldw	ra,4(sp)
  120eb4:	df000017 	ldw	fp,0(sp)
  120eb8:	dec00204 	addi	sp,sp,8
  120ebc:	f800283a 	ret

00120ec0 <set_scale>:
   Last Modified:    Mar. 13, 1994

*/

void  set_scale(enum scale_type s)
{
  120ec0:	defffd04 	addi	sp,sp,-12
  120ec4:	dfc00215 	stw	ra,8(sp)
  120ec8:	df000115 	stw	fp,4(sp)
  120ecc:	df000104 	addi	fp,sp,4
  120ed0:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* set the scale type */
    scale = s;
  120ed4:	e0bfff17 	ldw	r2,-4(fp)
  120ed8:	d0a18015 	stw	r2,-31232(gp)

    /* output the scale appropriately */
    set_display_scale(scale);
  120edc:	d0a18017 	ldw	r2,-31232(gp)
  120ee0:	1009883a 	mov	r4,r2
  120ee4:	0121e340 	call	121e34 <set_display_scale>


    /* all done setting the scale type - return */
    return;
  120ee8:	0001883a 	nop

}
  120eec:	e037883a 	mov	sp,fp
  120ef0:	dfc00117 	ldw	ra,4(sp)
  120ef4:	df000017 	ldw	fp,0(sp)
  120ef8:	dec00204 	addi	sp,sp,8
  120efc:	f800283a 	ret

00120f00 <scale_down>:
   Last Modified:    May 9, 2006

*/

void  scale_down()
{
  120f00:	defffe04 	addi	sp,sp,-8
  120f04:	dfc00115 	stw	ra,4(sp)
  120f08:	df000015 	stw	fp,0(sp)
  120f0c:	d839883a 	mov	fp,sp
      /* none */



    /* change to the "next" scale type */
    if (scale == SCALE_NONE)
  120f10:	d0a18017 	ldw	r2,-31232(gp)
  120f14:	1000031e 	bne	r2,zero,120f24 <scale_down+0x24>
        scale = SCALE_AXES;
  120f18:	00800044 	movi	r2,1
  120f1c:	d0a18015 	stw	r2,-31232(gp)
  120f20:	00000706 	br	120f40 <scale_down+0x40>
    else if (scale == SCALE_AXES)
  120f24:	d0a18017 	ldw	r2,-31232(gp)
  120f28:	10800058 	cmpnei	r2,r2,1
  120f2c:	1000031e 	bne	r2,zero,120f3c <scale_down+0x3c>
        scale = SCALE_GRID;
  120f30:	00800084 	movi	r2,2
  120f34:	d0a18015 	stw	r2,-31232(gp)
  120f38:	00000106 	br	120f40 <scale_down+0x40>
    else
        scale = SCALE_NONE;
  120f3c:	d0218015 	stw	zero,-31232(gp)

    /* set the scale type */
    set_display_scale(scale);
  120f40:	d0a18017 	ldw	r2,-31232(gp)
  120f44:	1009883a 	mov	r4,r2
  120f48:	0121e340 	call	121e34 <set_display_scale>


    /* all done with toggling the scale type - return */
    return;
  120f4c:	0001883a 	nop

}
  120f50:	e037883a 	mov	sp,fp
  120f54:	dfc00117 	ldw	ra,4(sp)
  120f58:	df000017 	ldw	fp,0(sp)
  120f5c:	dec00204 	addi	sp,sp,8
  120f60:	f800283a 	ret

00120f64 <scale_up>:
   Last Modified:    May 9, 2006

*/

void  scale_up()
{
  120f64:	defffe04 	addi	sp,sp,-8
  120f68:	dfc00115 	stw	ra,4(sp)
  120f6c:	df000015 	stw	fp,0(sp)
  120f70:	d839883a 	mov	fp,sp
      /* none */



    /* change to the "previous" scale type */
    if (scale == SCALE_NONE)
  120f74:	d0a18017 	ldw	r2,-31232(gp)
  120f78:	1000031e 	bne	r2,zero,120f88 <scale_up+0x24>
        scale = SCALE_GRID;
  120f7c:	00800084 	movi	r2,2
  120f80:	d0a18015 	stw	r2,-31232(gp)
  120f84:	00000706 	br	120fa4 <scale_up+0x40>
    else if (scale == SCALE_AXES)
  120f88:	d0a18017 	ldw	r2,-31232(gp)
  120f8c:	10800058 	cmpnei	r2,r2,1
  120f90:	1000021e 	bne	r2,zero,120f9c <scale_up+0x38>
        scale = SCALE_NONE;
  120f94:	d0218015 	stw	zero,-31232(gp)
  120f98:	00000206 	br	120fa4 <scale_up+0x40>
    else
        scale = SCALE_AXES;
  120f9c:	00800044 	movi	r2,1
  120fa0:	d0a18015 	stw	r2,-31232(gp)

    /* set the scale type */
    set_display_scale(scale);
  120fa4:	d0a18017 	ldw	r2,-31232(gp)
  120fa8:	1009883a 	mov	r4,r2
  120fac:	0121e340 	call	121e34 <set_display_scale>


    /* all done with toggling the scale type - return */
    return;
  120fb0:	0001883a 	nop

}
  120fb4:	e037883a 	mov	sp,fp
  120fb8:	dfc00117 	ldw	ra,4(sp)
  120fbc:	df000017 	ldw	fp,0(sp)
  120fc0:	dec00204 	addi	sp,sp,8
  120fc4:	f800283a 	ret

00120fc8 <display_scale>:
   Last Modified:    Mar. 13, 1994

*/

void  display_scale(int x_pos, int y_pos, int style)
{
  120fc8:	defff804 	addi	sp,sp,-32
  120fcc:	dfc00715 	stw	ra,28(sp)
  120fd0:	df000615 	stw	fp,24(sp)
  120fd4:	df000604 	addi	fp,sp,24
  120fd8:	e13ffd15 	stw	r4,-12(fp)
  120fdc:	e17ffe15 	stw	r5,-8(fp)
  120fe0:	e1bfff15 	stw	r6,-4(fp)
    /* variables */

    /* the scale type strings (must match enumerated type) */
    const char * const  scale_stat[] =  {  " None",
  120fe4:	008004b4 	movhi	r2,18
  120fe8:	108f9604 	addi	r2,r2,15960
  120fec:	e0bffa15 	stw	r2,-24(fp)
  120ff0:	008004b4 	movhi	r2,18
  120ff4:	108f9804 	addi	r2,r2,15968
  120ff8:	e0bffb15 	stw	r2,-20(fp)
  120ffc:	008004b4 	movhi	r2,18
  121000:	108f9a04 	addi	r2,r2,15976
  121004:	e0bffc15 	stw	r2,-16(fp)
                                                  " Grid"  };



    /* display the scale status */
    plot_string(x_pos, y_pos, scale_stat[scale], style);
  121008:	d0a18017 	ldw	r2,-31232(gp)
  12100c:	1085883a 	add	r2,r2,r2
  121010:	1085883a 	add	r2,r2,r2
  121014:	e0fffa04 	addi	r3,fp,-24
  121018:	1885883a 	add	r2,r3,r2
  12101c:	10c00017 	ldw	r3,0(r2)
  121020:	e0bfff17 	ldw	r2,-4(fp)
  121024:	e13ffd17 	ldw	r4,-12(fp)
  121028:	e17ffe17 	ldw	r5,-8(fp)
  12102c:	180d883a 	mov	r6,r3
  121030:	100f883a 	mov	r7,r2
  121034:	01204e80 	call	1204e8 <plot_string>


    /* all done displaying the scale status - return */
    return;

}
  121038:	e037883a 	mov	sp,fp
  12103c:	dfc00117 	ldw	ra,4(sp)
  121040:	df000017 	ldw	fp,0(sp)
  121044:	dec00204 	addi	sp,sp,8
  121048:	f800283a 	ret

0012104c <set_sweep>:
   Last Modified:    Mar. 8, 1994

*/

void  set_sweep(int s)
{
  12104c:	defffc04 	addi	sp,sp,-16
  121050:	dfc00315 	stw	ra,12(sp)
  121054:	df000215 	stw	fp,8(sp)
  121058:	df000204 	addi	fp,sp,8
  12105c:	e13fff15 	stw	r4,-4(fp)
    int  sample_size;		/* sample size for this sweep rate */



    /* set the new sweep rate */
    sweep = s;
  121060:	e0bfff17 	ldw	r2,-4(fp)
  121064:	d0a17e15 	stw	r2,-31240(gp)

    /* set the sweep rate for the hardware */
    sample_size = set_sample_rate(sweep_rates[sweep].sample_rate);
  121068:	d0a17e17 	ldw	r2,-31240(gp)
  12106c:	00c004b4 	movhi	r3,18
  121070:	18cf6b04 	addi	r3,r3,15788
  121074:	100490fa 	slli	r2,r2,3
  121078:	1885883a 	add	r2,r3,r2
  12107c:	10800017 	ldw	r2,0(r2)
  121080:	1009883a 	mov	r4,r2
  121084:	0121ab80 	call	121ab8 <set_sample_rate>
  121088:	e0bffe15 	stw	r2,-8(fp)
    /* also set the sample size for the trace capture */
    set_trace_size(sample_size);
  12108c:	e13ffe17 	ldw	r4,-8(fp)
  121090:	0121e080 	call	121e08 <set_trace_size>


    /* all done initializing the sweep rate - return */
    return;
  121094:	0001883a 	nop

}
  121098:	e037883a 	mov	sp,fp
  12109c:	dfc00117 	ldw	ra,4(sp)
  1210a0:	df000017 	ldw	fp,0(sp)
  1210a4:	dec00204 	addi	sp,sp,8
  1210a8:	f800283a 	ret

001210ac <sweep_down>:
   Last Modified:    Mar. 8, 1994

*/

void  sweep_down()
{
  1210ac:	defffd04 	addi	sp,sp,-12
  1210b0:	dfc00215 	stw	ra,8(sp)
  1210b4:	df000115 	stw	fp,4(sp)
  1210b8:	df000104 	addi	fp,sp,4
    int  sample_size;		/* sample size for the new sweep rate */



    /* decrease the sweep rate, if not already the minimum */
    if (sweep > 0)  {
  1210bc:	d0a17e17 	ldw	r2,-31240(gp)
  1210c0:	0080090e 	bge	zero,r2,1210e8 <sweep_down+0x3c>
        /* not at minimum, adjust delay for new sweep */
	adjust_trg_delay(sweep, (sweep - 1));
  1210c4:	d0e17e17 	ldw	r3,-31240(gp)
  1210c8:	d0a17e17 	ldw	r2,-31240(gp)
  1210cc:	10bfffc4 	addi	r2,r2,-1
  1210d0:	1809883a 	mov	r4,r3
  1210d4:	100b883a 	mov	r5,r2
  1210d8:	01215900 	call	121590 <adjust_trg_delay>
	/* now set new sweep rate */
        sweep--;
  1210dc:	d0a17e17 	ldw	r2,-31240(gp)
  1210e0:	10bfffc4 	addi	r2,r2,-1
  1210e4:	d0a17e15 	stw	r2,-31240(gp)
    }

    /* set the sweep rate for the hardware */
    sample_size = set_sample_rate(sweep_rates[sweep].sample_rate);
  1210e8:	d0a17e17 	ldw	r2,-31240(gp)
  1210ec:	00c004b4 	movhi	r3,18
  1210f0:	18cf6b04 	addi	r3,r3,15788
  1210f4:	100490fa 	slli	r2,r2,3
  1210f8:	1885883a 	add	r2,r3,r2
  1210fc:	10800017 	ldw	r2,0(r2)
  121100:	1009883a 	mov	r4,r2
  121104:	0121ab80 	call	121ab8 <set_sample_rate>
  121108:	e0bfff15 	stw	r2,-4(fp)
    /* also set the sample size for the trace capture */
    set_trace_size(sample_size);
  12110c:	e13fff17 	ldw	r4,-4(fp)
  121110:	0121e080 	call	121e08 <set_trace_size>


    /* all done with lowering the sweep rate - return */
    return;
  121114:	0001883a 	nop

}
  121118:	e037883a 	mov	sp,fp
  12111c:	dfc00117 	ldw	ra,4(sp)
  121120:	df000017 	ldw	fp,0(sp)
  121124:	dec00204 	addi	sp,sp,8
  121128:	f800283a 	ret

0012112c <sweep_up>:
   Last Modified:    Mar. 8, 1994

*/

void  sweep_up()
{
  12112c:	defffd04 	addi	sp,sp,-12
  121130:	dfc00215 	stw	ra,8(sp)
  121134:	df000115 	stw	fp,4(sp)
  121138:	df000104 	addi	fp,sp,4
    int  sample_size;		/* sample size for the new sweep rate */



    /* increase the sweep rate, if not already the maximum */
    if (sweep < (NO_SWEEP_RATES - 1))  {
  12113c:	d0a17e17 	ldw	r2,-31240(gp)
  121140:	10800428 	cmpgeui	r2,r2,16
  121144:	1000091e 	bne	r2,zero,12116c <sweep_up+0x40>
        /* not at maximum, adjust delay for new sweep */
	adjust_trg_delay(sweep, (sweep + 1));
  121148:	d0e17e17 	ldw	r3,-31240(gp)
  12114c:	d0a17e17 	ldw	r2,-31240(gp)
  121150:	10800044 	addi	r2,r2,1
  121154:	1809883a 	mov	r4,r3
  121158:	100b883a 	mov	r5,r2
  12115c:	01215900 	call	121590 <adjust_trg_delay>
	/* now set new sweep rate */
        sweep++;
  121160:	d0a17e17 	ldw	r2,-31240(gp)
  121164:	10800044 	addi	r2,r2,1
  121168:	d0a17e15 	stw	r2,-31240(gp)
    }

    /* set the sweep rate for the hardware */
    sample_size = set_sample_rate(sweep_rates[sweep].sample_rate);
  12116c:	d0a17e17 	ldw	r2,-31240(gp)
  121170:	00c004b4 	movhi	r3,18
  121174:	18cf6b04 	addi	r3,r3,15788
  121178:	100490fa 	slli	r2,r2,3
  12117c:	1885883a 	add	r2,r3,r2
  121180:	10800017 	ldw	r2,0(r2)
  121184:	1009883a 	mov	r4,r2
  121188:	0121ab80 	call	121ab8 <set_sample_rate>
  12118c:	e0bfff15 	stw	r2,-4(fp)
    /* also set the sample size for the trace capture */
    set_trace_size(sample_size);
  121190:	e13fff17 	ldw	r4,-4(fp)
  121194:	0121e080 	call	121e08 <set_trace_size>


    /* all done with raising the sweep rate - return */
    return;
  121198:	0001883a 	nop

}
  12119c:	e037883a 	mov	sp,fp
  1211a0:	dfc00117 	ldw	ra,4(sp)
  1211a4:	df000017 	ldw	fp,0(sp)
  1211a8:	dec00204 	addi	sp,sp,8
  1211ac:	f800283a 	ret

001211b0 <display_sweep>:
   Last Modified:    Mar. 8, 1994

*/

void  display_sweep(int x_pos, int y_pos, int style)
{
  1211b0:	defffb04 	addi	sp,sp,-20
  1211b4:	dfc00415 	stw	ra,16(sp)
  1211b8:	df000315 	stw	fp,12(sp)
  1211bc:	df000304 	addi	fp,sp,12
  1211c0:	e13ffd15 	stw	r4,-12(fp)
  1211c4:	e17ffe15 	stw	r5,-8(fp)
  1211c8:	e1bfff15 	stw	r6,-4(fp)
      /* none */



    /* display the sweep rate */
    plot_string(x_pos, y_pos, sweep_rates[sweep].s, style);
  1211cc:	d0a17e17 	ldw	r2,-31240(gp)
  1211d0:	00c004b4 	movhi	r3,18
  1211d4:	18cf6b04 	addi	r3,r3,15788
  1211d8:	100490fa 	slli	r2,r2,3
  1211dc:	1885883a 	add	r2,r3,r2
  1211e0:	10800104 	addi	r2,r2,4
  1211e4:	10c00017 	ldw	r3,0(r2)
  1211e8:	e0bfff17 	ldw	r2,-4(fp)
  1211ec:	e13ffd17 	ldw	r4,-12(fp)
  1211f0:	e17ffe17 	ldw	r5,-8(fp)
  1211f4:	180d883a 	mov	r6,r3
  1211f8:	100f883a 	mov	r7,r2
  1211fc:	01204e80 	call	1204e8 <plot_string>


    /* all done displaying the sweep rate - return */
    return;
  121200:	0001883a 	nop

}
  121204:	e037883a 	mov	sp,fp
  121208:	dfc00117 	ldw	ra,4(sp)
  12120c:	df000017 	ldw	fp,0(sp)
  121210:	dec00204 	addi	sp,sp,8
  121214:	f800283a 	ret

00121218 <set_trg_level>:
   Last Modified:    Mar. 8, 1994

*/

void  set_trg_level(int l)
{
  121218:	defffd04 	addi	sp,sp,-12
  12121c:	dfc00215 	stw	ra,8(sp)
  121220:	df000115 	stw	fp,4(sp)
  121224:	df000104 	addi	fp,sp,4
  121228:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* set the trigger level */
    level = l;
  12122c:	e0bfff17 	ldw	r2,-4(fp)
  121230:	d0a17d15 	stw	r2,-31244(gp)

    /* set the trigger level in hardware too */
    set_trigger(level, slope);
  121234:	d0e17d17 	ldw	r3,-31244(gp)
  121238:	d0a18117 	ldw	r2,-31228(gp)
  12123c:	1809883a 	mov	r4,r3
  121240:	100b883a 	mov	r5,r2
  121244:	0121adc0 	call	121adc <set_trigger>


    /* all done initializing the trigger level - return */
    return;
  121248:	0001883a 	nop

}
  12124c:	e037883a 	mov	sp,fp
  121250:	dfc00117 	ldw	ra,4(sp)
  121254:	df000017 	ldw	fp,0(sp)
  121258:	dec00204 	addi	sp,sp,8
  12125c:	f800283a 	ret

00121260 <trg_level_down>:
   Last Modified:    Mar. 8, 1994

*/

void  trg_level_down()
{
  121260:	defffe04 	addi	sp,sp,-8
  121264:	dfc00115 	stw	ra,4(sp)
  121268:	df000015 	stw	fp,0(sp)
  12126c:	d839883a 	mov	fp,sp
      /* none */



    /* decrease the trigger level, if not already the minimum */
    if (level > MIN_TRG_LEVEL_SET)
  121270:	d0a17d17 	ldw	r2,-31244(gp)
  121274:	0080030e 	bge	zero,r2,121284 <trg_level_down+0x24>
        level--;
  121278:	d0a17d17 	ldw	r2,-31244(gp)
  12127c:	10bfffc4 	addi	r2,r2,-1
  121280:	d0a17d15 	stw	r2,-31244(gp)

    /* set the trigger level for the hardware */
    set_trigger(level, slope);
  121284:	d0e17d17 	ldw	r3,-31244(gp)
  121288:	d0a18117 	ldw	r2,-31228(gp)
  12128c:	1809883a 	mov	r4,r3
  121290:	100b883a 	mov	r5,r2
  121294:	0121adc0 	call	121adc <set_trigger>


    /* all done with lowering the trigger level - return */
    return;
  121298:	0001883a 	nop

}
  12129c:	e037883a 	mov	sp,fp
  1212a0:	dfc00117 	ldw	ra,4(sp)
  1212a4:	df000017 	ldw	fp,0(sp)
  1212a8:	dec00204 	addi	sp,sp,8
  1212ac:	f800283a 	ret

001212b0 <trg_level_up>:
   Last Modified:    Mar. 8, 1994

*/

void  trg_level_up()
{
  1212b0:	defffe04 	addi	sp,sp,-8
  1212b4:	dfc00115 	stw	ra,4(sp)
  1212b8:	df000015 	stw	fp,0(sp)
  1212bc:	d839883a 	mov	fp,sp
      /* none */



    /* increase the trigger level, if not already the maximum */
    if (level < MAX_TRG_LEVEL_SET)
  1212c0:	d0a17d17 	ldw	r2,-31244(gp)
  1212c4:	10801fc8 	cmpgei	r2,r2,127
  1212c8:	1000031e 	bne	r2,zero,1212d8 <trg_level_up+0x28>
        level++;
  1212cc:	d0a17d17 	ldw	r2,-31244(gp)
  1212d0:	10800044 	addi	r2,r2,1
  1212d4:	d0a17d15 	stw	r2,-31244(gp)

    /* tell the hardware the new trigger level */
    set_trigger(level, slope);
  1212d8:	d0e17d17 	ldw	r3,-31244(gp)
  1212dc:	d0a18117 	ldw	r2,-31228(gp)
  1212e0:	1809883a 	mov	r4,r3
  1212e4:	100b883a 	mov	r5,r2
  1212e8:	0121adc0 	call	121adc <set_trigger>


    /* all done raising the trigger level - return */
    return;
  1212ec:	0001883a 	nop

}
  1212f0:	e037883a 	mov	sp,fp
  1212f4:	dfc00117 	ldw	ra,4(sp)
  1212f8:	df000017 	ldw	fp,0(sp)
  1212fc:	dec00204 	addi	sp,sp,8
  121300:	f800283a 	ret

00121304 <display_trg_level>:
   Last Modified:    Mar. 10, 1995

*/

void  display_trg_level(int x_pos, int y_pos, int style)
{
  121304:	defff704 	addi	sp,sp,-36
  121308:	dfc00815 	stw	ra,32(sp)
  12130c:	df000715 	stw	fp,28(sp)
  121310:	df000704 	addi	fp,sp,28
  121314:	e13ffd15 	stw	r4,-12(fp)
  121318:	e17ffe15 	stw	r5,-8(fp)
  12131c:	e1bfff15 	stw	r6,-4(fp)
    /* variables */
    char      level_str[] = "        "; /* string containing the trigger level */
  121320:	00880834 	movhi	r2,8224
  121324:	10880804 	addi	r2,r2,8224
  121328:	e0bffa15 	stw	r2,-24(fp)
  12132c:	00880834 	movhi	r2,8224
  121330:	10880804 	addi	r2,r2,8224
  121334:	e0bffb15 	stw	r2,-20(fp)
  121338:	e03ffc05 	stb	zero,-16(fp)
    long int  l;			/* trigger level in mV */



    /* compute the trigger level in millivolts */
    l = ((long int) MAX_LEVEL - MIN_LEVEL) * level / (MAX_TRG_LEVEL_SET - MIN_TRG_LEVEL_SET) + MIN_LEVEL;
  12133c:	d0a17d17 	ldw	r2,-31244(gp)
  121340:	1009883a 	mov	r4,r2
  121344:	0144e204 	movi	r5,5000
  121348:	0122d480 	call	122d48 <__mulsi3>
  12134c:	1009883a 	mov	r4,r2
  121350:	01401fc4 	movi	r5,127
  121354:	0122c8c0 	call	122c8c <__divsi3>
  121358:	e0bff915 	stw	r2,-28(fp)

    /* convert the level to the string (leave first character blank) */
    cvt_num_field(l, &level_str[1]);
  12135c:	e0bffa04 	addi	r2,fp,-24
  121360:	10800044 	addi	r2,r2,1
  121364:	e13ff917 	ldw	r4,-28(fp)
  121368:	100b883a 	mov	r5,r2
  12136c:	01218940 	call	121894 <cvt_num_field>

    /* add in the units */
    level_str[7] = 'V';
  121370:	00801584 	movi	r2,86
  121374:	e0bffbc5 	stb	r2,-17(fp)


    /* now finally display the trigger level */
    plot_string(x_pos, y_pos, level_str, style);
  121378:	e0bfff17 	ldw	r2,-4(fp)
  12137c:	e0fffa04 	addi	r3,fp,-24
  121380:	e13ffd17 	ldw	r4,-12(fp)
  121384:	e17ffe17 	ldw	r5,-8(fp)
  121388:	180d883a 	mov	r6,r3
  12138c:	100f883a 	mov	r7,r2
  121390:	01204e80 	call	1204e8 <plot_string>


    /* all done displaying the trigger level - return */
    return;

}
  121394:	e037883a 	mov	sp,fp
  121398:	dfc00117 	ldw	ra,4(sp)
  12139c:	df000017 	ldw	fp,0(sp)
  1213a0:	dec00204 	addi	sp,sp,8
  1213a4:	f800283a 	ret

001213a8 <set_trg_slope>:
   Last Modified:    Mar. 8, 1994

*/

void  set_trg_slope(enum slope_type s)
{
  1213a8:	defffd04 	addi	sp,sp,-12
  1213ac:	dfc00215 	stw	ra,8(sp)
  1213b0:	df000115 	stw	fp,4(sp)
  1213b4:	df000104 	addi	fp,sp,4
  1213b8:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* set the slope type */
    slope = s;
  1213bc:	e0bfff17 	ldw	r2,-4(fp)
  1213c0:	d0a18115 	stw	r2,-31228(gp)

    /* also tell the hardware what the slope is */
    set_trigger(level, slope);
  1213c4:	d0e17d17 	ldw	r3,-31244(gp)
  1213c8:	d0a18117 	ldw	r2,-31228(gp)
  1213cc:	1809883a 	mov	r4,r3
  1213d0:	100b883a 	mov	r5,r2
  1213d4:	0121adc0 	call	121adc <set_trigger>


    /* all done setting the trigger slope - return */
    return;
  1213d8:	0001883a 	nop

}
  1213dc:	e037883a 	mov	sp,fp
  1213e0:	dfc00117 	ldw	ra,4(sp)
  1213e4:	df000017 	ldw	fp,0(sp)
  1213e8:	dec00204 	addi	sp,sp,8
  1213ec:	f800283a 	ret

001213f0 <trg_slope_toggle>:
   Last Modified:    Mar. 8, 1994

*/

void  trg_slope_toggle()
{
  1213f0:	defffe04 	addi	sp,sp,-8
  1213f4:	dfc00115 	stw	ra,4(sp)
  1213f8:	df000015 	stw	fp,0(sp)
  1213fc:	d839883a 	mov	fp,sp
      /* none */



    /* toggle the trigger slope */
    if (slope == SLOPE_POSITIVE)
  121400:	d0a18117 	ldw	r2,-31228(gp)
  121404:	1000031e 	bne	r2,zero,121414 <trg_slope_toggle+0x24>
        slope = SLOPE_NEGATIVE;
  121408:	00800044 	movi	r2,1
  12140c:	d0a18115 	stw	r2,-31228(gp)
  121410:	00000106 	br	121418 <trg_slope_toggle+0x28>
    else
        slope = SLOPE_POSITIVE;
  121414:	d0218115 	stw	zero,-31228(gp)

    /* set the new trigger slope */
    set_trigger(level, slope);
  121418:	d0e17d17 	ldw	r3,-31244(gp)
  12141c:	d0a18117 	ldw	r2,-31228(gp)
  121420:	1809883a 	mov	r4,r3
  121424:	100b883a 	mov	r5,r2
  121428:	0121adc0 	call	121adc <set_trigger>


    /* all done with the trigger slope - return */
    return;
  12142c:	0001883a 	nop

}
  121430:	e037883a 	mov	sp,fp
  121434:	dfc00117 	ldw	ra,4(sp)
  121438:	df000017 	ldw	fp,0(sp)
  12143c:	dec00204 	addi	sp,sp,8
  121440:	f800283a 	ret

00121444 <display_trg_slope>:
   Last Modified:    Mar. 13, 1994

*/

void  display_trg_slope(int x_pos, int y_pos, int style)
{
  121444:	defff904 	addi	sp,sp,-28
  121448:	dfc00615 	stw	ra,24(sp)
  12144c:	df000515 	stw	fp,20(sp)
  121450:	df000504 	addi	fp,sp,20
  121454:	e13ffd15 	stw	r4,-12(fp)
  121458:	e17ffe15 	stw	r5,-8(fp)
  12145c:	e1bfff15 	stw	r6,-4(fp)
    /* variables */

    /* the trigger slope strings (must match enumerated type) */
    const char * const  slopes[] =  {  " +", " -"  };
  121460:	008004b4 	movhi	r2,18
  121464:	108f9c04 	addi	r2,r2,15984
  121468:	e0bffb15 	stw	r2,-20(fp)
  12146c:	008004b4 	movhi	r2,18
  121470:	108f9d04 	addi	r2,r2,15988
  121474:	e0bffc15 	stw	r2,-16(fp)



    /* display the trigger slope */
    plot_string(x_pos, y_pos, slopes[slope], style);
  121478:	d0a18117 	ldw	r2,-31228(gp)
  12147c:	1085883a 	add	r2,r2,r2
  121480:	1085883a 	add	r2,r2,r2
  121484:	e0fffb04 	addi	r3,fp,-20
  121488:	1885883a 	add	r2,r3,r2
  12148c:	10c00017 	ldw	r3,0(r2)
  121490:	e0bfff17 	ldw	r2,-4(fp)
  121494:	e13ffd17 	ldw	r4,-12(fp)
  121498:	e17ffe17 	ldw	r5,-8(fp)
  12149c:	180d883a 	mov	r6,r3
  1214a0:	100f883a 	mov	r7,r2
  1214a4:	01204e80 	call	1204e8 <plot_string>


    /* all done displaying the trigger slope - return */
    return;

}
  1214a8:	e037883a 	mov	sp,fp
  1214ac:	dfc00117 	ldw	ra,4(sp)
  1214b0:	df000017 	ldw	fp,0(sp)
  1214b4:	dec00204 	addi	sp,sp,8
  1214b8:	f800283a 	ret

001214bc <set_trg_delay>:
   Last Modified:    Mar. 8, 1994

*/

void  set_trg_delay(long int d)
{
  1214bc:	defffd04 	addi	sp,sp,-12
  1214c0:	dfc00215 	stw	ra,8(sp)
  1214c4:	df000115 	stw	fp,4(sp)
  1214c8:	df000104 	addi	fp,sp,4
  1214cc:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* set the trigger delay */
    delay = d;
  1214d0:	e0bfff17 	ldw	r2,-4(fp)
  1214d4:	d0a17f15 	stw	r2,-31236(gp)

    /* set the trigger delay in hardware too */
    set_delay(delay);
  1214d8:	d0a17f17 	ldw	r2,-31236(gp)
  1214dc:	1009883a 	mov	r4,r2
  1214e0:	0121b040 	call	121b04 <set_delay>


    /* all done initializing the trigger delay - return */
    return;
  1214e4:	0001883a 	nop

}
  1214e8:	e037883a 	mov	sp,fp
  1214ec:	dfc00117 	ldw	ra,4(sp)
  1214f0:	df000017 	ldw	fp,0(sp)
  1214f4:	dec00204 	addi	sp,sp,8
  1214f8:	f800283a 	ret

001214fc <trg_delay_down>:
   Last Modified:    Mar. 8, 1994

*/

void  trg_delay_down()
{
  1214fc:	defffe04 	addi	sp,sp,-8
  121500:	dfc00115 	stw	ra,4(sp)
  121504:	df000015 	stw	fp,0(sp)
  121508:	d839883a 	mov	fp,sp
      /* none */



    /* decrease the trigger delay, if not already the minimum */
    if (delay > MIN_DELAY)
  12150c:	d0a17f17 	ldw	r2,-31236(gp)
  121510:	0080030e 	bge	zero,r2,121520 <trg_delay_down+0x24>
        delay--;
  121514:	d0a17f17 	ldw	r2,-31236(gp)
  121518:	10bfffc4 	addi	r2,r2,-1
  12151c:	d0a17f15 	stw	r2,-31236(gp)

    /* set the trigger delay for the hardware */
    set_delay(delay);
  121520:	d0a17f17 	ldw	r2,-31236(gp)
  121524:	1009883a 	mov	r4,r2
  121528:	0121b040 	call	121b04 <set_delay>


    /* all done with lowering the trigger delay - return */
    return;
  12152c:	0001883a 	nop

}
  121530:	e037883a 	mov	sp,fp
  121534:	dfc00117 	ldw	ra,4(sp)
  121538:	df000017 	ldw	fp,0(sp)
  12153c:	dec00204 	addi	sp,sp,8
  121540:	f800283a 	ret

00121544 <trg_delay_up>:
   Last Modified:    Mar. 8, 1994

*/

void  trg_delay_up()
{
  121544:	defffe04 	addi	sp,sp,-8
  121548:	dfc00115 	stw	ra,4(sp)
  12154c:	df000015 	stw	fp,0(sp)
  121550:	d839883a 	mov	fp,sp
      /* none */



    /* increase the trigger delay, if not already the maximum */
    if (delay < MAX_DELAY)
  121554:	d0a17f17 	ldw	r2,-31236(gp)
  121558:	00f0d3d4 	movui	r3,49999
  12155c:	18800316 	blt	r3,r2,12156c <trg_delay_up+0x28>
        delay++;
  121560:	d0a17f17 	ldw	r2,-31236(gp)
  121564:	10800044 	addi	r2,r2,1
  121568:	d0a17f15 	stw	r2,-31236(gp)

    /* tell the hardware the new trigger delay */
    set_delay(delay);
  12156c:	d0a17f17 	ldw	r2,-31236(gp)
  121570:	1009883a 	mov	r4,r2
  121574:	0121b040 	call	121b04 <set_delay>


    /* all done raising the trigger delay - return */
    return;
  121578:	0001883a 	nop

}
  12157c:	e037883a 	mov	sp,fp
  121580:	dfc00117 	ldw	ra,4(sp)
  121584:	df000017 	ldw	fp,0(sp)
  121588:	dec00204 	addi	sp,sp,8
  12158c:	f800283a 	ret

00121590 <adjust_trg_delay>:
   Last Modified:    Mar. 8, 1994

*/

void  adjust_trg_delay(int old_sweep, int new_sweep)
{
  121590:	defffc04 	addi	sp,sp,-16
  121594:	dfc00315 	stw	ra,12(sp)
  121598:	df000215 	stw	fp,8(sp)
  12159c:	df000204 	addi	fp,sp,8
  1215a0:	e13ffe15 	stw	r4,-8(fp)
  1215a4:	e17fff15 	stw	r5,-4(fp)
      /* none */



    /* multiply by 10 times the ratio of sweep rates */
    delay *= (10 * sweep_rates[new_sweep].sample_rate) / sweep_rates[old_sweep].sample_rate;
  1215a8:	00c004b4 	movhi	r3,18
  1215ac:	18cf6b04 	addi	r3,r3,15788
  1215b0:	e0bfff17 	ldw	r2,-4(fp)
  1215b4:	100490fa 	slli	r2,r2,3
  1215b8:	1885883a 	add	r2,r3,r2
  1215bc:	10800017 	ldw	r2,0(r2)
  1215c0:	1009883a 	mov	r4,r2
  1215c4:	01400284 	movi	r5,10
  1215c8:	0122d480 	call	122d48 <__mulsi3>
  1215cc:	1007883a 	mov	r3,r2
  1215d0:	010004b4 	movhi	r4,18
  1215d4:	210f6b04 	addi	r4,r4,15788
  1215d8:	e0bffe17 	ldw	r2,-8(fp)
  1215dc:	100490fa 	slli	r2,r2,3
  1215e0:	2085883a 	add	r2,r4,r2
  1215e4:	10800017 	ldw	r2,0(r2)
  1215e8:	1809883a 	mov	r4,r3
  1215ec:	100b883a 	mov	r5,r2
  1215f0:	0122c8c0 	call	122c8c <__divsi3>
  1215f4:	1007883a 	mov	r3,r2
  1215f8:	d0a17f17 	ldw	r2,-31236(gp)
  1215fc:	1809883a 	mov	r4,r3
  121600:	100b883a 	mov	r5,r2
  121604:	0122d480 	call	122d48 <__mulsi3>
  121608:	d0a17f15 	stw	r2,-31236(gp)
    /* now divide the factor of 10 back out */
    delay /= 10;
  12160c:	d0a17f17 	ldw	r2,-31236(gp)
  121610:	1009883a 	mov	r4,r2
  121614:	01400284 	movi	r5,10
  121618:	0122c8c0 	call	122c8c <__divsi3>
  12161c:	d0a17f15 	stw	r2,-31236(gp)

    /* make sure delay is not out of range */
    if (delay > MAX_DELAY)
  121620:	d0a17f17 	ldw	r2,-31236(gp)
  121624:	00f0d414 	movui	r3,50000
  121628:	1880020e 	bge	r3,r2,121634 <adjust_trg_delay+0xa4>
        /* delay is too large - set to maximum */
        delay = MAX_DELAY;
  12162c:	00b0d414 	movui	r2,50000
  121630:	d0a17f15 	stw	r2,-31236(gp)
    if (delay < MIN_DELAY)
  121634:	d0a17f17 	ldw	r2,-31236(gp)
  121638:	1000010e 	bge	r2,zero,121640 <adjust_trg_delay+0xb0>
        /* delay is too small - set to minimum */
	delay = MIN_DELAY;
  12163c:	d0217f15 	stw	zero,-31236(gp)


    /* tell the hardware the new trigger delay */
    set_delay(delay);
  121640:	d0a17f17 	ldw	r2,-31236(gp)
  121644:	1009883a 	mov	r4,r2
  121648:	0121b040 	call	121b04 <set_delay>


    /* all done adjusting the trigger delay - return */
    return;
  12164c:	0001883a 	nop

}
  121650:	e037883a 	mov	sp,fp
  121654:	dfc00117 	ldw	ra,4(sp)
  121658:	df000017 	ldw	fp,0(sp)
  12165c:	dec00204 	addi	sp,sp,8
  121660:	f800283a 	ret

00121664 <display_trg_delay>:
   Last Modified:    May 3, 2006

*/

void  display_trg_delay(int x_pos, int y_pos, int style)
{
  121664:	defff604 	addi	sp,sp,-40
  121668:	dfc00915 	stw	ra,36(sp)
  12166c:	df000815 	stw	fp,32(sp)
  121670:	df000804 	addi	fp,sp,32
  121674:	e13ffd15 	stw	r4,-12(fp)
  121678:	e17ffe15 	stw	r5,-8(fp)
  12167c:	e1bfff15 	stw	r6,-4(fp)
    /* variables */
    char      delay_str[] = "         "; /* string containing the trigger delay */
  121680:	00880834 	movhi	r2,8224
  121684:	10880804 	addi	r2,r2,8224
  121688:	e0bffa15 	stw	r2,-24(fp)
  12168c:	00880834 	movhi	r2,8224
  121690:	10880804 	addi	r2,r2,8224
  121694:	e0bffb15 	stw	r2,-20(fp)
  121698:	00800804 	movi	r2,32
  12169c:	e0bffc0d 	sth	r2,-16(fp)
    long int  d;                         /* delay in appropriate units */


    /* compute the delay in the appropriate units */
    /* have to watch out for overflow, so be careful */
    if (sweep_rates[sweep].sample_rate > 1000000L)  {
  1216a0:	d0a17e17 	ldw	r2,-31240(gp)
  1216a4:	00c004b4 	movhi	r3,18
  1216a8:	18cf6b04 	addi	r3,r3,15788
  1216ac:	100490fa 	slli	r2,r2,3
  1216b0:	1885883a 	add	r2,r3,r2
  1216b4:	10800017 	ldw	r2,0(r2)
  1216b8:	00c003f4 	movhi	r3,15
  1216bc:	18d09004 	addi	r3,r3,16960
  1216c0:	1880170e 	bge	r3,r2,121720 <display_trg_delay+0xbc>
        /* have a fast sweep rate, could overflow */
        /* first compute in units of 100 ns */
        d = delay * (10000000L / sweep_rates[sweep].sample_rate);
  1216c4:	d0a17e17 	ldw	r2,-31240(gp)
  1216c8:	00c004b4 	movhi	r3,18
  1216cc:	18cf6b04 	addi	r3,r3,15788
  1216d0:	100490fa 	slli	r2,r2,3
  1216d4:	1885883a 	add	r2,r3,r2
  1216d8:	10800017 	ldw	r2,0(r2)
  1216dc:	01002674 	movhi	r4,153
  1216e0:	2125a004 	addi	r4,r4,-27008
  1216e4:	100b883a 	mov	r5,r2
  1216e8:	0122c8c0 	call	122c8c <__divsi3>
  1216ec:	1007883a 	mov	r3,r2
  1216f0:	d0a17f17 	ldw	r2,-31236(gp)
  1216f4:	1809883a 	mov	r4,r3
  1216f8:	100b883a 	mov	r5,r2
  1216fc:	0122d480 	call	122d48 <__mulsi3>
  121700:	e0bff915 	stw	r2,-28(fp)
	/* now convert to nanoseconds */
	d *= 100L;
  121704:	e13ff917 	ldw	r4,-28(fp)
  121708:	01401904 	movi	r5,100
  12170c:	0122d480 	call	122d48 <__mulsi3>
  121710:	e0bff915 	stw	r2,-28(fp)
	/* need to divide by 1000 to get to microseconds */
	units_adj = 1000;
  121714:	0080fa04 	movi	r2,1000
  121718:	e0bff815 	stw	r2,-32(fp)
  12171c:	00001206 	br	121768 <display_trg_delay+0x104>
    }
    else  {
        /* slow sweep rate, don't have to worry about overflow */
        d = delay * (1000000L / sweep_rates[sweep].sample_rate);
  121720:	d0a17e17 	ldw	r2,-31240(gp)
  121724:	00c004b4 	movhi	r3,18
  121728:	18cf6b04 	addi	r3,r3,15788
  12172c:	100490fa 	slli	r2,r2,3
  121730:	1885883a 	add	r2,r3,r2
  121734:	10800017 	ldw	r2,0(r2)
  121738:	010003f4 	movhi	r4,15
  12173c:	21109004 	addi	r4,r4,16960
  121740:	100b883a 	mov	r5,r2
  121744:	0122c8c0 	call	122c8c <__divsi3>
  121748:	1007883a 	mov	r3,r2
  12174c:	d0a17f17 	ldw	r2,-31236(gp)
  121750:	1809883a 	mov	r4,r3
  121754:	100b883a 	mov	r5,r2
  121758:	0122d480 	call	122d48 <__mulsi3>
  12175c:	e0bff915 	stw	r2,-28(fp)
	/* already in microseconds, so adjustment is 1 */
	units_adj = 1;
  121760:	00800044 	movi	r2,1
  121764:	e0bff815 	stw	r2,-32(fp)
    }

    /* convert it to the string (leave first character blank) */
    cvt_num_field(d, &delay_str[1]);
  121768:	e0bffa04 	addi	r2,fp,-24
  12176c:	10800044 	addi	r2,r2,1
  121770:	e13ff917 	ldw	r4,-28(fp)
  121774:	100b883a 	mov	r5,r2
  121778:	01218940 	call	121894 <cvt_num_field>

    /* add in the units */
    if (((d / units_adj) < 1000) && ((d / units_adj) > -1000) && (units_adj == 1000)) {
  12177c:	e13ff917 	ldw	r4,-28(fp)
  121780:	e17ff817 	ldw	r5,-32(fp)
  121784:	0122c8c0 	call	122c8c <__divsi3>
  121788:	1080fa08 	cmpgei	r2,r2,1000
  12178c:	10000d1e 	bne	r2,zero,1217c4 <display_trg_delay+0x160>
  121790:	e13ff917 	ldw	r4,-28(fp)
  121794:	e17ff817 	ldw	r5,-32(fp)
  121798:	0122c8c0 	call	122c8c <__divsi3>
  12179c:	10bf0650 	cmplti	r2,r2,-999
  1217a0:	1000081e 	bne	r2,zero,1217c4 <display_trg_delay+0x160>
  1217a4:	e0bff817 	ldw	r2,-32(fp)
  1217a8:	1080fa18 	cmpnei	r2,r2,1000
  1217ac:	1000051e 	bne	r2,zero,1217c4 <display_trg_delay+0x160>
        /* delay is in microseconds */
	delay_str[7] = '\004';
  1217b0:	00800104 	movi	r2,4
  1217b4:	e0bffbc5 	stb	r2,-17(fp)
	delay_str[8] = 's';
  1217b8:	00801cc4 	movi	r2,115
  1217bc:	e0bffc05 	stb	r2,-16(fp)
  1217c0:	00002806 	br	121864 <display_trg_delay+0x200>
    }
    else if (((d / units_adj) < 1000000) && ((d / units_adj) > -1000000)) {
  1217c4:	e13ff917 	ldw	r4,-28(fp)
  1217c8:	e17ff817 	ldw	r5,-32(fp)
  1217cc:	0122c8c0 	call	122c8c <__divsi3>
  1217d0:	00c003f4 	movhi	r3,15
  1217d4:	18d08fc4 	addi	r3,r3,16959
  1217d8:	18800c16 	blt	r3,r2,12180c <display_trg_delay+0x1a8>
  1217dc:	e13ff917 	ldw	r4,-28(fp)
  1217e0:	e17ff817 	ldw	r5,-32(fp)
  1217e4:	0122c8c0 	call	122c8c <__divsi3>
  1217e8:	1007883a 	mov	r3,r2
  1217ec:	00bffc74 	movhi	r2,65521
  1217f0:	10af7044 	addi	r2,r2,-16959
  1217f4:	18800516 	blt	r3,r2,12180c <display_trg_delay+0x1a8>
        /* delay is in milliseconds */
	delay_str[7] = 'm';
  1217f8:	00801b44 	movi	r2,109
  1217fc:	e0bffbc5 	stb	r2,-17(fp)
	delay_str[8] = 's';
  121800:	00801cc4 	movi	r2,115
  121804:	e0bffc05 	stb	r2,-16(fp)
  121808:	00001606 	br	121864 <display_trg_delay+0x200>
    }
    else if (((d / units_adj) < 1000000000) && ((d / units_adj) > -1000000000))  {
  12180c:	e13ff917 	ldw	r4,-28(fp)
  121810:	e17ff817 	ldw	r5,-32(fp)
  121814:	0122c8c0 	call	122c8c <__divsi3>
  121818:	00cee6f4 	movhi	r3,15259
  12181c:	18f27fc4 	addi	r3,r3,-13825
  121820:	18800c16 	blt	r3,r2,121854 <display_trg_delay+0x1f0>
  121824:	e13ff917 	ldw	r4,-28(fp)
  121828:	e17ff817 	ldw	r5,-32(fp)
  12182c:	0122c8c0 	call	122c8c <__divsi3>
  121830:	1007883a 	mov	r3,r2
  121834:	00b11974 	movhi	r2,50277
  121838:	108d8044 	addi	r2,r2,13825
  12183c:	18800516 	blt	r3,r2,121854 <display_trg_delay+0x1f0>
        /* delay is in seconds */
	delay_str[7] = 's';
  121840:	00801cc4 	movi	r2,115
  121844:	e0bffbc5 	stb	r2,-17(fp)
	delay_str[8] = ' ';
  121848:	00800804 	movi	r2,32
  12184c:	e0bffc05 	stb	r2,-16(fp)
  121850:	00000406 	br	121864 <display_trg_delay+0x200>
    }
    else  {
        /* delay is in kiloseconds */
	delay_str[7] = 'k';
  121854:	00801ac4 	movi	r2,107
  121858:	e0bffbc5 	stb	r2,-17(fp)
	delay_str[8] = 's';
  12185c:	00801cc4 	movi	r2,115
  121860:	e0bffc05 	stb	r2,-16(fp)
    }


    /* now actually display the trigger delay */
    plot_string(x_pos, y_pos, delay_str, style);
  121864:	e0bfff17 	ldw	r2,-4(fp)
  121868:	e0fffa04 	addi	r3,fp,-24
  12186c:	e13ffd17 	ldw	r4,-12(fp)
  121870:	e17ffe17 	ldw	r5,-8(fp)
  121874:	180d883a 	mov	r6,r3
  121878:	100f883a 	mov	r7,r2
  12187c:	01204e80 	call	1204e8 <plot_string>


    /* all done displaying the trigger delay - return */
    return;

}
  121880:	e037883a 	mov	sp,fp
  121884:	dfc00117 	ldw	ra,4(sp)
  121888:	df000017 	ldw	fp,0(sp)
  12188c:	dec00204 	addi	sp,sp,8
  121890:	f800283a 	ret

00121894 <cvt_num_field>:
   Last Modified:    Mar. 8, 1994

*/

void  cvt_num_field(long int n, char *s)
{
  121894:	defff804 	addi	sp,sp,-32
  121898:	dfc00715 	stw	ra,28(sp)
  12189c:	df000615 	stw	fp,24(sp)
  1218a0:	dc000515 	stw	r16,20(sp)
  1218a4:	df000504 	addi	fp,sp,20
  1218a8:	e13ffe15 	stw	r4,-8(fp)
  1218ac:	e17fff15 	stw	r5,-4(fp)
    /* variables */
    int  dp = 3;		/* digits to right of decimal point */
  1218b0:	008000c4 	movi	r2,3
  1218b4:	e0bffb15 	stw	r2,-20(fp)
    int  d;			/* digit weight (power of 10) */

    int  i = 0;			/* string index */
  1218b8:	e03ffd15 	stw	zero,-12(fp)



    /* first get the sign (and make n positive for conversion) */
    if (n < 0)  {
  1218bc:	e0bffe17 	ldw	r2,-8(fp)
  1218c0:	10000c0e 	bge	r2,zero,1218f4 <cvt_num_field+0x60>
        /* n is negative, set sign and convert to positive */
	s[i++] = '-';
  1218c4:	e0bffd17 	ldw	r2,-12(fp)
  1218c8:	e0ffff17 	ldw	r3,-4(fp)
  1218cc:	1885883a 	add	r2,r3,r2
  1218d0:	00c00b44 	movi	r3,45
  1218d4:	10c00005 	stb	r3,0(r2)
  1218d8:	e0bffd17 	ldw	r2,-12(fp)
  1218dc:	10800044 	addi	r2,r2,1
  1218e0:	e0bffd15 	stw	r2,-12(fp)
	n = -n;
  1218e4:	e0bffe17 	ldw	r2,-8(fp)
  1218e8:	0085c83a 	sub	r2,zero,r2
  1218ec:	e0bffe15 	stw	r2,-8(fp)
	s[i++] = '+';
    }


    /* make sure there are no more than 4 significant digits */
    while (n > 9999)  {
  1218f0:	00001106 	br	121938 <cvt_num_field+0xa4>
	s[i++] = '-';
	n = -n;
    }
    else  {
        /* n is positive, set sign only */
	s[i++] = '+';
  1218f4:	e0bffd17 	ldw	r2,-12(fp)
  1218f8:	e0ffff17 	ldw	r3,-4(fp)
  1218fc:	1885883a 	add	r2,r3,r2
  121900:	00c00ac4 	movi	r3,43
  121904:	10c00005 	stb	r3,0(r2)
  121908:	e0bffd17 	ldw	r2,-12(fp)
  12190c:	10800044 	addi	r2,r2,1
  121910:	e0bffd15 	stw	r2,-12(fp)
    }


    /* make sure there are no more than 4 significant digits */
    while (n > 9999)  {
  121914:	00000806 	br	121938 <cvt_num_field+0xa4>
        /* have more than 4 digits - get rid of one */
	n /= 10;
  121918:	e0bffe17 	ldw	r2,-8(fp)
  12191c:	1009883a 	mov	r4,r2
  121920:	01400284 	movi	r5,10
  121924:	0122c8c0 	call	122c8c <__divsi3>
  121928:	e0bffe15 	stw	r2,-8(fp)
	/* adjust the decimal point */
	dp--;
  12192c:	e0bffb17 	ldw	r2,-20(fp)
  121930:	10bfffc4 	addi	r2,r2,-1
  121934:	e0bffb15 	stw	r2,-20(fp)
	s[i++] = '+';
    }


    /* make sure there are no more than 4 significant digits */
    while (n > 9999)  {
  121938:	e0bffe17 	ldw	r2,-8(fp)
  12193c:	1089c408 	cmpgei	r2,r2,10000
  121940:	103ff51e 	bne	r2,zero,121918 <cvt_num_field+0x84>
	dp--;
    }

    /* if decimal point is non-positive, make positive */
    /* (assume will take care of adjustment with output units in this case) */
    while (dp <= 0)
  121944:	00000306 	br	121954 <cvt_num_field+0xc0>
       dp += 3;
  121948:	e0bffb17 	ldw	r2,-20(fp)
  12194c:	108000c4 	addi	r2,r2,3
  121950:	e0bffb15 	stw	r2,-20(fp)
	dp--;
    }

    /* if decimal point is non-positive, make positive */
    /* (assume will take care of adjustment with output units in this case) */
    while (dp <= 0)
  121954:	e0bffb17 	ldw	r2,-20(fp)
  121958:	00bffb0e 	bge	zero,r2,121948 <cvt_num_field+0xb4>
       dp += 3;


    /* adjust dp to be digits to the right of the decimal point */
    /* (assuming 4 digits) */
    dp = 4 - dp;
  12195c:	00c00104 	movi	r3,4
  121960:	e0bffb17 	ldw	r2,-20(fp)
  121964:	1885c83a 	sub	r2,r3,r2
  121968:	e0bffb15 	stw	r2,-20(fp)


    /* finally, loop getting and converting digits */
    for (d = 1000; d > 0; d /= 10)  {
  12196c:	0080fa04 	movi	r2,1000
  121970:	e0bffc15 	stw	r2,-16(fp)
  121974:	00002406 	br	121a08 <cvt_num_field+0x174>

        /* check if need decimal the decimal point now */
	if (dp-- == 0)
  121978:	e0bffb17 	ldw	r2,-20(fp)
  12197c:	1005003a 	cmpeq	r2,r2,zero
  121980:	e0fffb17 	ldw	r3,-20(fp)
  121984:	18ffffc4 	addi	r3,r3,-1
  121988:	e0fffb15 	stw	r3,-20(fp)
  12198c:	10803fcc 	andi	r2,r2,255
  121990:	10000826 	beq	r2,zero,1219b4 <cvt_num_field+0x120>
	    /* time for decimal point */
	    s[i++] = '.';
  121994:	e0bffd17 	ldw	r2,-12(fp)
  121998:	e0ffff17 	ldw	r3,-4(fp)
  12199c:	1885883a 	add	r2,r3,r2
  1219a0:	00c00b84 	movi	r3,46
  1219a4:	10c00005 	stb	r3,0(r2)
  1219a8:	e0bffd17 	ldw	r2,-12(fp)
  1219ac:	10800044 	addi	r2,r2,1
  1219b0:	e0bffd15 	stw	r2,-12(fp)

	/* get and convert this digit */
	s[i++] = (n / d) + '0';
  1219b4:	e0bffd17 	ldw	r2,-12(fp)
  1219b8:	e0ffff17 	ldw	r3,-4(fp)
  1219bc:	18a1883a 	add	r16,r3,r2
  1219c0:	e13ffe17 	ldw	r4,-8(fp)
  1219c4:	e17ffc17 	ldw	r5,-16(fp)
  1219c8:	0122c8c0 	call	122c8c <__divsi3>
  1219cc:	10800c04 	addi	r2,r2,48
  1219d0:	80800005 	stb	r2,0(r16)
  1219d4:	e0bffd17 	ldw	r2,-12(fp)
  1219d8:	10800044 	addi	r2,r2,1
  1219dc:	e0bffd15 	stw	r2,-12(fp)
	/* remove this digit from n */
	n %= d;
  1219e0:	e0bffe17 	ldw	r2,-8(fp)
  1219e4:	1009883a 	mov	r4,r2
  1219e8:	e17ffc17 	ldw	r5,-16(fp)
  1219ec:	0122cdc0 	call	122cdc <__modsi3>
  1219f0:	e0bffe15 	stw	r2,-8(fp)
    /* (assuming 4 digits) */
    dp = 4 - dp;


    /* finally, loop getting and converting digits */
    for (d = 1000; d > 0; d /= 10)  {
  1219f4:	e0bffc17 	ldw	r2,-16(fp)
  1219f8:	1009883a 	mov	r4,r2
  1219fc:	01400284 	movi	r5,10
  121a00:	0122c8c0 	call	122c8c <__divsi3>
  121a04:	e0bffc15 	stw	r2,-16(fp)
  121a08:	e0bffc17 	ldw	r2,-16(fp)
  121a0c:	00bfda16 	blt	zero,r2,121978 <cvt_num_field+0xe4>
	n %= d;
    }


    /* all done converting the number, return */
    return;
  121a10:	0001883a 	nop

}
  121a14:	e037883a 	mov	sp,fp
  121a18:	dfc00217 	ldw	ra,8(sp)
  121a1c:	df000117 	ldw	fp,4(sp)
  121a20:	dc000017 	ldw	r16,0(sp)
  121a24:	dec00304 	addi	sp,sp,12
  121a28:	f800283a 	ret

00121a2c <key_available>:


/* keypad functions */

unsigned char  key_available()
{
  121a2c:	deffff04 	addi	sp,sp,-4
  121a30:	df000015 	stw	fp,0(sp)
  121a34:	d839883a 	mov	fp,sp
    return  FALSE;
  121a38:	0005883a 	mov	r2,zero
}
  121a3c:	e037883a 	mov	sp,fp
  121a40:	df000017 	ldw	fp,0(sp)
  121a44:	dec00104 	addi	sp,sp,4
  121a48:	f800283a 	ret

00121a4c <getkey>:

int  getkey()
{
  121a4c:	deffff04 	addi	sp,sp,-4
  121a50:	df000015 	stw	fp,0(sp)
  121a54:	d839883a 	mov	fp,sp
    return  KEY_ILLEGAL;
  121a58:	00800184 	movi	r2,6
}
  121a5c:	e037883a 	mov	sp,fp
  121a60:	df000017 	ldw	fp,0(sp)
  121a64:	dec00104 	addi	sp,sp,4
  121a68:	f800283a 	ret

00121a6c <clear_display>:


/* display functions  */

void  clear_display()
{
  121a6c:	deffff04 	addi	sp,sp,-4
  121a70:	df000015 	stw	fp,0(sp)
  121a74:	d839883a 	mov	fp,sp
    return;
  121a78:	0001883a 	nop
}
  121a7c:	e037883a 	mov	sp,fp
  121a80:	df000017 	ldw	fp,0(sp)
  121a84:	dec00104 	addi	sp,sp,4
  121a88:	f800283a 	ret

00121a8c <plot_pixel>:

void  plot_pixel(unsigned int x, unsigned int y, int p)
{
  121a8c:	defffc04 	addi	sp,sp,-16
  121a90:	df000315 	stw	fp,12(sp)
  121a94:	df000304 	addi	fp,sp,12
  121a98:	e13ffd15 	stw	r4,-12(fp)
  121a9c:	e17ffe15 	stw	r5,-8(fp)
  121aa0:	e1bfff15 	stw	r6,-4(fp)
    return;
  121aa4:	0001883a 	nop
}
  121aa8:	e037883a 	mov	sp,fp
  121aac:	df000017 	ldw	fp,0(sp)
  121ab0:	dec00104 	addi	sp,sp,4
  121ab4:	f800283a 	ret

00121ab8 <set_sample_rate>:


/* sampling parameter functions */

int  set_sample_rate(long int rate)
{
  121ab8:	defffe04 	addi	sp,sp,-8
  121abc:	df000115 	stw	fp,4(sp)
  121ac0:	df000104 	addi	fp,sp,4
  121ac4:	e13fff15 	stw	r4,-4(fp)
    return  SIZE_X;
  121ac8:	00807804 	movi	r2,480
}
  121acc:	e037883a 	mov	sp,fp
  121ad0:	df000017 	ldw	fp,0(sp)
  121ad4:	dec00104 	addi	sp,sp,4
  121ad8:	f800283a 	ret

00121adc <set_trigger>:

void  set_trigger(int level, int slope)
{
  121adc:	defffd04 	addi	sp,sp,-12
  121ae0:	df000215 	stw	fp,8(sp)
  121ae4:	df000204 	addi	fp,sp,8
  121ae8:	e13ffe15 	stw	r4,-8(fp)
  121aec:	e17fff15 	stw	r5,-4(fp)
    return;
  121af0:	0001883a 	nop
}
  121af4:	e037883a 	mov	sp,fp
  121af8:	df000017 	ldw	fp,0(sp)
  121afc:	dec00104 	addi	sp,sp,4
  121b00:	f800283a 	ret

00121b04 <set_delay>:

void  set_delay(long int delay)
{
  121b04:	defffe04 	addi	sp,sp,-8
  121b08:	df000115 	stw	fp,4(sp)
  121b0c:	df000104 	addi	fp,sp,4
  121b10:	e13fff15 	stw	r4,-4(fp)
    return;
  121b14:	0001883a 	nop
}
  121b18:	e037883a 	mov	sp,fp
  121b1c:	df000017 	ldw	fp,0(sp)
  121b20:	dec00104 	addi	sp,sp,4
  121b24:	f800283a 	ret

00121b28 <start_sample>:


/* sampling functions */

void  start_sample(int auto_trigger)
{
  121b28:	defffe04 	addi	sp,sp,-8
  121b2c:	df000115 	stw	fp,4(sp)
  121b30:	df000104 	addi	fp,sp,4
  121b34:	e13fff15 	stw	r4,-4(fp)
    return;
  121b38:	0001883a 	nop
}
  121b3c:	e037883a 	mov	sp,fp
  121b40:	df000017 	ldw	fp,0(sp)
  121b44:	dec00104 	addi	sp,sp,4
  121b48:	f800283a 	ret

00121b4c <sample_done>:

unsigned char *sample_done()
{
  121b4c:	deffff04 	addi	sp,sp,-4
  121b50:	df000015 	stw	fp,0(sp)
  121b54:	d839883a 	mov	fp,sp
    return  NULL;
  121b58:	0005883a 	mov	r2,zero
}
  121b5c:	e037883a 	mov	sp,fp
  121b60:	df000017 	ldw	fp,0(sp)
  121b64:	dec00104 	addi	sp,sp,4
  121b68:	f800283a 	ret

00121b6c <get_test_sample>:
   Last Modified:    May 3, 2006

*/

void  get_test_sample(long int sample_rate, int sample_size, unsigned char *sample)
{
  121b6c:	deff8104 	addi	sp,sp,-508
  121b70:	dfc07e15 	stw	ra,504(sp)
  121b74:	df007d15 	stw	fp,500(sp)
  121b78:	df007d04 	addi	fp,sp,500
  121b7c:	e13ffd15 	stw	r4,-12(fp)
  121b80:	e17ffe15 	stw	r5,-8(fp)
  121b84:	e1bfff15 	stw	r6,-4(fp)
    /* variables */

    /* a half-cycle of the ringing square wave */
    const unsigned char  waveform[] =
  121b88:	008004b4 	movhi	r2,18
  121b8c:	108f9e04 	addi	r2,r2,15992
  121b90:	e13f8504 	addi	r4,fp,-492
  121b94:	1007883a 	mov	r3,r2
  121b98:	00807804 	movi	r2,480
  121b9c:	180b883a 	mov	r5,r3
  121ba0:	100d883a 	mov	r6,r2
  121ba4:	0122d700 	call	122d70 <memcpy>
	    63,  63,  63,  63,  63,  63,  63,  63,  63,  63,  63,  63,  63,
	    63,  63,  63,  63,  63,  63,  64,  64,  64,  64,  64,  64,  64,
	    64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64
	  };

    long int  sample_pt = 0;	/* current sample within the waveform */
  121ba8:	e03f8315 	stw	zero,-500(fp)

    int       sample_sign = 1;	/* sample waveform sign */
  121bac:	00800044 	movi	r2,1
  121bb0:	e0bf8415 	stw	r2,-496(fp)



    /* loop, getting sample points */
    while (sample_size-- > 0)  {
  121bb4:	00003106 	br	121c7c <get_test_sample+0x110>

        /* get this sample point (value based on sign) */
	if (sample_sign > 0)
  121bb8:	e0bf8417 	ldw	r2,-496(fp)
  121bbc:	00800f0e 	bge	zero,r2,121bfc <get_test_sample+0x90>
	    *sample++ = waveform[sample_pt/20] + 127;
  121bc0:	e0bf8317 	ldw	r2,-500(fp)
  121bc4:	1009883a 	mov	r4,r2
  121bc8:	01400504 	movi	r5,20
  121bcc:	0122c8c0 	call	122c8c <__divsi3>
  121bd0:	e0ff8504 	addi	r3,fp,-492
  121bd4:	1885883a 	add	r2,r3,r2
  121bd8:	10800003 	ldbu	r2,0(r2)
  121bdc:	10801fc4 	addi	r2,r2,127
  121be0:	1007883a 	mov	r3,r2
  121be4:	e0bfff17 	ldw	r2,-4(fp)
  121be8:	10c00005 	stb	r3,0(r2)
  121bec:	e0bfff17 	ldw	r2,-4(fp)
  121bf0:	10800044 	addi	r2,r2,1
  121bf4:	e0bfff15 	stw	r2,-4(fp)
  121bf8:	00000f06 	br	121c38 <get_test_sample+0xcc>
	else
	    *sample++ = 128 - waveform[sample_pt/20];
  121bfc:	e0bf8317 	ldw	r2,-500(fp)
  121c00:	1009883a 	mov	r4,r2
  121c04:	01400504 	movi	r5,20
  121c08:	0122c8c0 	call	122c8c <__divsi3>
  121c0c:	e0ff8504 	addi	r3,fp,-492
  121c10:	1885883a 	add	r2,r3,r2
  121c14:	10800003 	ldbu	r2,0(r2)
  121c18:	00ffe004 	movi	r3,-128
  121c1c:	1885c83a 	sub	r2,r3,r2
  121c20:	1007883a 	mov	r3,r2
  121c24:	e0bfff17 	ldw	r2,-4(fp)
  121c28:	10c00005 	stb	r3,0(r2)
  121c2c:	e0bfff17 	ldw	r2,-4(fp)
  121c30:	10800044 	addi	r2,r2,1
  121c34:	e0bfff15 	stw	r2,-4(fp)

	/* compute the time for the next sample point */
	sample_pt += (10000000L / sample_rate);
  121c38:	01002674 	movhi	r4,153
  121c3c:	2125a004 	addi	r4,r4,-27008
  121c40:	e17ffd17 	ldw	r5,-12(fp)
  121c44:	0122c8c0 	call	122c8c <__divsi3>
  121c48:	e0ff8317 	ldw	r3,-500(fp)
  121c4c:	1885883a 	add	r2,r3,r2
  121c50:	e0bf8315 	stw	r2,-500(fp)
	/* keep sample_pt within the waveform (need to scale it) */
	while (sample_pt >= (20 * NO_TEST_PTS))  {
  121c54:	00000606 	br	121c70 <get_test_sample+0x104>
	    /* keep sample_pt within the test waveform */
	    sample_pt -= (20 * NO_TEST_PTS);
  121c58:	e0bf8317 	ldw	r2,-500(fp)
  121c5c:	10b6a004 	addi	r2,r2,-9600
  121c60:	e0bf8315 	stw	r2,-500(fp)
	    /* each time through the waveform, invert it */
	    sample_sign = -sample_sign;
  121c64:	e0bf8417 	ldw	r2,-496(fp)
  121c68:	0085c83a 	sub	r2,zero,r2
  121c6c:	e0bf8415 	stw	r2,-496(fp)
	    *sample++ = 128 - waveform[sample_pt/20];

	/* compute the time for the next sample point */
	sample_pt += (10000000L / sample_rate);
	/* keep sample_pt within the waveform (need to scale it) */
	while (sample_pt >= (20 * NO_TEST_PTS))  {
  121c70:	e0bf8317 	ldw	r2,-500(fp)
  121c74:	10896028 	cmpgeui	r2,r2,9600
  121c78:	103ff71e 	bne	r2,zero,121c58 <get_test_sample+0xec>
    int       sample_sign = 1;	/* sample waveform sign */



    /* loop, getting sample points */
    while (sample_size-- > 0)  {
  121c7c:	e0bffe17 	ldw	r2,-8(fp)
  121c80:	0084803a 	cmplt	r2,zero,r2
  121c84:	e0fffe17 	ldw	r3,-8(fp)
  121c88:	18ffffc4 	addi	r3,r3,-1
  121c8c:	e0fffe15 	stw	r3,-8(fp)
  121c90:	10803fcc 	andi	r2,r2,255
  121c94:	103fc81e 	bne	r2,zero,121bb8 <get_test_sample+0x4c>


    /* done getting the sample - return */
    return;

}
  121c98:	e037883a 	mov	sp,fp
  121c9c:	dfc00117 	ldw	ra,4(sp)
  121ca0:	df000017 	ldw	fp,0(sp)
  121ca4:	dec00204 	addi	sp,sp,8
  121ca8:	f800283a 	ret

00121cac <init_trace>:
   Last Modified:    May 9, 2006

*/

void  init_trace()
{
  121cac:	defffe04 	addi	sp,sp,-8
  121cb0:	dfc00115 	stw	ra,4(sp)
  121cb4:	df000015 	stw	fp,0(sp)
  121cb8:	d839883a 	mov	fp,sp


    /* initialize system status variables */

    /* ready for a trace */
    trace_status = TRUE;
  121cbc:	00800044 	movi	r2,1
  121cc0:	d0a18315 	stw	r2,-31220(gp)

    /* not currently sampling data */
    sampling = FALSE;
  121cc4:	d0218915 	stw	zero,-31196(gp)

    /* turn off the displayed scale */
    cur_scale = SCALE_NONE;
  121cc8:	d0218215 	stw	zero,-31224(gp)

    /* sample size is the screen size */
    sample_size = SIZE_X;
  121ccc:	00807804 	movi	r2,480
  121cd0:	d0a18615 	stw	r2,-31208(gp)


    /* clear save areas */
    clear_saved_areas();
  121cd4:	012222c0 	call	12222c <clear_saved_areas>

    /* also clear the general saved area location variables (off-screen) */
    saved_pos_x = SIZE_X + 1;
  121cd8:	00807844 	movi	r2,481
  121cdc:	d0a18815 	stw	r2,-31200(gp)
    saved_pos_y = SIZE_Y + 1;
  121ce0:	00802044 	movi	r2,129
  121ce4:	d0a18515 	stw	r2,-31212(gp)
    saved_end_x = SIZE_X + 1;
  121ce8:	00807844 	movi	r2,481
  121cec:	d0a18715 	stw	r2,-31204(gp)
    saved_end_y = SIZE_Y + 1;
  121cf0:	00802044 	movi	r2,129
  121cf4:	d0a18415 	stw	r2,-31216(gp)


    /* done initializing, return */
    return;
  121cf8:	0001883a 	nop

}
  121cfc:	e037883a 	mov	sp,fp
  121d00:	dfc00117 	ldw	ra,4(sp)
  121d04:	df000017 	ldw	fp,0(sp)
  121d08:	dec00204 	addi	sp,sp,8
  121d0c:	f800283a 	ret

00121d10 <set_mode>:
   Last Modified:    May 27, 2008

*/

void  set_mode(enum trigger_type trigger_mode)
{
  121d10:	defffe04 	addi	sp,sp,-8
  121d14:	df000115 	stw	fp,4(sp)
  121d18:	df000104 	addi	fp,sp,4
  121d1c:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* if not one-shot triggering - ready for trace too */
    trace_status = (trigger_mode != ONESHOT_TRIGGER);
  121d20:	e0bfff17 	ldw	r2,-4(fp)
  121d24:	10800098 	cmpnei	r2,r2,2
  121d28:	10803fcc 	andi	r2,r2,255
  121d2c:	d0a18315 	stw	r2,-31220(gp)


    /* turn off the sampling flag so will start a new sample */
    sampling = FALSE;
  121d30:	d0218915 	stw	zero,-31196(gp)


    /* all done, return */
    return;
  121d34:	0001883a 	nop

}
  121d38:	e037883a 	mov	sp,fp
  121d3c:	df000017 	ldw	fp,0(sp)
  121d40:	dec00104 	addi	sp,sp,4
  121d44:	f800283a 	ret

00121d48 <is_sampling>:
   Last Modified:    May 27, 2008

*/

int  is_sampling()
{
  121d48:	deffff04 	addi	sp,sp,-4
  121d4c:	df000015 	stw	fp,0(sp)
  121d50:	d839883a 	mov	fp,sp
      /* none */



    /* currently sampling if sampling flag is set */
    return  sampling;
  121d54:	d0a18917 	ldw	r2,-31196(gp)

}
  121d58:	e037883a 	mov	sp,fp
  121d5c:	df000017 	ldw	fp,0(sp)
  121d60:	dec00104 	addi	sp,sp,4
  121d64:	f800283a 	ret

00121d68 <trace_rdy>:
   Last Modified:    Mar. 13, 1994

*/

int  trace_rdy()
{
  121d68:	deffff04 	addi	sp,sp,-4
  121d6c:	df000015 	stw	fp,0(sp)
  121d70:	d839883a 	mov	fp,sp
      /* none */



    /* ready for another trace if not sampling and trace is ready */
    return  (!sampling && trace_status);
  121d74:	d0a18917 	ldw	r2,-31196(gp)
  121d78:	1000041e 	bne	r2,zero,121d8c <trace_rdy+0x24>
  121d7c:	d0a18317 	ldw	r2,-31220(gp)
  121d80:	10000226 	beq	r2,zero,121d8c <trace_rdy+0x24>
  121d84:	00800044 	movi	r2,1
  121d88:	00000106 	br	121d90 <trace_rdy+0x28>
  121d8c:	0005883a 	mov	r2,zero

}
  121d90:	e037883a 	mov	sp,fp
  121d94:	df000017 	ldw	fp,0(sp)
  121d98:	dec00104 	addi	sp,sp,4
  121d9c:	f800283a 	ret

00121da0 <trace_done>:
   Last Modified:    May 9, 2006

*/

void  trace_done()
{
  121da0:	defffe04 	addi	sp,sp,-8
  121da4:	dfc00115 	stw	ra,4(sp)
  121da8:	df000015 	stw	fp,0(sp)
  121dac:	d839883a 	mov	fp,sp
      /* none */



    /* done with a trace - if retriggering, ready for another one */
    if (get_trigger_mode() != ONESHOT_TRIGGER)
  121db0:	0120d540 	call	120d54 <get_trigger_mode>
  121db4:	108000a0 	cmpeqi	r2,r2,2
  121db8:	1000021e 	bne	r2,zero,121dc4 <trace_done+0x24>
        /* in a retriggering mode - set trace_status to TRUE (ready) */
	trace_status = TRUE;
  121dbc:	00800044 	movi	r2,1
  121dc0:	d0a18315 	stw	r2,-31220(gp)

    /* no longer sampling data */
    sampling = FALSE;
  121dc4:	d0218915 	stw	zero,-31196(gp)


    /* done so return */
    return;
  121dc8:	0001883a 	nop

}
  121dcc:	e037883a 	mov	sp,fp
  121dd0:	dfc00117 	ldw	ra,4(sp)
  121dd4:	df000017 	ldw	fp,0(sp)
  121dd8:	dec00204 	addi	sp,sp,8
  121ddc:	f800283a 	ret

00121de0 <trace_rearm>:
   Last Modified:    Mar. 8, 1994

*/

void  trace_rearm()
{
  121de0:	deffff04 	addi	sp,sp,-4
  121de4:	df000015 	stw	fp,0(sp)
  121de8:	d839883a 	mov	fp,sp
      /* none */



    /* rearm the trace - set status to ready (TRUE) */
    trace_status = TRUE;
  121dec:	00800044 	movi	r2,1
  121df0:	d0a18315 	stw	r2,-31220(gp)


    /* all done - return */
    return;
  121df4:	0001883a 	nop

}
  121df8:	e037883a 	mov	sp,fp
  121dfc:	df000017 	ldw	fp,0(sp)
  121e00:	dec00104 	addi	sp,sp,4
  121e04:	f800283a 	ret

00121e08 <set_trace_size>:
   Last Modified:    Mar. 8, 1994

*/

void  set_trace_size(int size)
{
  121e08:	defffe04 	addi	sp,sp,-8
  121e0c:	df000115 	stw	fp,4(sp)
  121e10:	df000104 	addi	fp,sp,4
  121e14:	e13fff15 	stw	r4,-4(fp)
      /* none */



    /* set the locally global sample size */
    sample_size = size;
  121e18:	e0bfff17 	ldw	r2,-4(fp)
  121e1c:	d0a18615 	stw	r2,-31208(gp)


    /* all done, return */
    return;
  121e20:	0001883a 	nop

}
  121e24:	e037883a 	mov	sp,fp
  121e28:	df000017 	ldw	fp,0(sp)
  121e2c:	dec00104 	addi	sp,sp,4
  121e30:	f800283a 	ret

00121e34 <set_display_scale>:
   Last Modified:    May 9, 2006

*/

void  set_display_scale(enum scale_type scale)
{
  121e34:	defff804 	addi	sp,sp,-32
  121e38:	dfc00715 	stw	ra,28(sp)
  121e3c:	df000615 	stw	fp,24(sp)
  121e40:	dc400515 	stw	r17,20(sp)
  121e44:	dc000415 	stw	r16,16(sp)
  121e48:	df000404 	addi	fp,sp,16
  121e4c:	e13fff15 	stw	r4,-4(fp)



    /* whenever change scale type, need to clear out previous scale */
    /* unnecessary if going to SCALE_GRID or from SCALE_NONE or not changing the scale */
    if ((scale != SCALE_GRID) && (cur_scale != SCALE_NONE) && (scale != cur_scale))  {
  121e50:	e0bfff17 	ldw	r2,-4(fp)
  121e54:	108000a0 	cmpeqi	r2,r2,2
  121e58:	1000921e 	bne	r2,zero,1220a4 <set_display_scale+0x270>
  121e5c:	d0a18217 	ldw	r2,-31224(gp)
  121e60:	10009026 	beq	r2,zero,1220a4 <set_display_scale+0x270>
  121e64:	d0a18217 	ldw	r2,-31224(gp)
  121e68:	e0ffff17 	ldw	r3,-4(fp)
  121e6c:	18808d26 	beq	r3,r2,1220a4 <set_display_scale+0x270>

        /* need to restore the trace under the lines (tick, grid, or axis) */

	/* go through all points on horizontal lines */
	for (j = -Y_TICK_CNT; j <= Y_TICK_CNT; j++)  {
  121e70:	00bfffc4 	movi	r2,-1
  121e74:	e0bffe15 	stw	r2,-8(fp)
  121e78:	00004206 	br	121f84 <set_display_scale+0x150>

	    /* get y position of the line */
	    p = X_AXIS_POS + j * Y_TICK_SIZE;
  121e7c:	e13ffe17 	ldw	r4,-8(fp)
  121e80:	01400c04 	movi	r5,48
  121e84:	0122d480 	call	122d48 <__mulsi3>
  121e88:	10801004 	addi	r2,r2,64
  121e8c:	e0bffc15 	stw	r2,-16(fp)
	    /* make sure it is in range */
	    if (p >= PLOT_SIZE_Y)
  121e90:	e0bffc17 	ldw	r2,-16(fp)
  121e94:	10802010 	cmplti	r2,r2,128
  121e98:	1000021e 	bne	r2,zero,121ea4 <set_display_scale+0x70>
	        p = PLOT_SIZE_Y - 1;
  121e9c:	00801fc4 	movi	r2,127
  121ea0:	e0bffc15 	stw	r2,-16(fp)
	    if (p < 0)
  121ea4:	e0bffc17 	ldw	r2,-16(fp)
  121ea8:	1000010e 	bge	r2,zero,121eb0 <set_display_scale+0x7c>
	        p = 0;
  121eac:	e03ffc15 	stw	zero,-16(fp)

	    /* look at entire horizontal line */
	    for (i = 0; i < PLOT_SIZE_X; i++)  {
  121eb0:	e03ffd15 	stw	zero,-12(fp)
  121eb4:	00002d06 	br	121f6c <set_display_scale+0x138>
	        /* check if this point is on or off (need to look at bits) */
		if ((saved_axis_x[j + Y_TICK_CNT][i / 8] & (0x80 >> (i % 8))) == 0)
  121eb8:	e0bffe17 	ldw	r2,-8(fp)
  121ebc:	10c00044 	addi	r3,r2,1
  121ec0:	e0bffd17 	ldw	r2,-12(fp)
  121ec4:	1000010e 	bge	r2,zero,121ecc <set_display_scale+0x98>
  121ec8:	108001c4 	addi	r2,r2,7
  121ecc:	1005d0fa 	srai	r2,r2,3
  121ed0:	1023883a 	mov	r17,r2
  121ed4:	040004b4 	movhi	r16,18
  121ed8:	8413e604 	addi	r16,r16,20376
  121edc:	1809883a 	mov	r4,r3
  121ee0:	01400f04 	movi	r5,60
  121ee4:	0122d480 	call	122d48 <__mulsi3>
  121ee8:	1445883a 	add	r2,r2,r17
  121eec:	8085883a 	add	r2,r16,r2
  121ef0:	10800003 	ldbu	r2,0(r2)
  121ef4:	10c03fcc 	andi	r3,r2,255
  121ef8:	e13ffd17 	ldw	r4,-12(fp)
  121efc:	00a00034 	movhi	r2,32768
  121f00:	108001c4 	addi	r2,r2,7
  121f04:	2084703a 	and	r2,r4,r2
  121f08:	1000040e 	bge	r2,zero,121f1c <set_display_scale+0xe8>
  121f0c:	10bfffc4 	addi	r2,r2,-1
  121f10:	013ffe04 	movi	r4,-8
  121f14:	1104b03a 	or	r2,r2,r4
  121f18:	10800044 	addi	r2,r2,1
  121f1c:	01002004 	movi	r4,128
  121f20:	2085d83a 	sra	r2,r4,r2
  121f24:	1884703a 	and	r2,r3,r2
  121f28:	1000071e 	bne	r2,zero,121f48 <set_display_scale+0x114>
		    /* saved pixel is off */
		    plot_pixel(i, p, PIXEL_WHITE);
  121f2c:	e0fffd17 	ldw	r3,-12(fp)
  121f30:	e0bffc17 	ldw	r2,-16(fp)
  121f34:	1809883a 	mov	r4,r3
  121f38:	100b883a 	mov	r5,r2
  121f3c:	000d883a 	mov	r6,zero
  121f40:	0121a8c0 	call	121a8c <plot_pixel>
  121f44:	00000606 	br	121f60 <set_display_scale+0x12c>
		else
		    /* saved pixel is on */
		    plot_pixel(i, p, PIXEL_BLACK);
  121f48:	e0fffd17 	ldw	r3,-12(fp)
  121f4c:	e0bffc17 	ldw	r2,-16(fp)
  121f50:	1809883a 	mov	r4,r3
  121f54:	100b883a 	mov	r5,r2
  121f58:	01800044 	movi	r6,1
  121f5c:	0121a8c0 	call	121a8c <plot_pixel>
	        p = PLOT_SIZE_Y - 1;
	    if (p < 0)
	        p = 0;

	    /* look at entire horizontal line */
	    for (i = 0; i < PLOT_SIZE_X; i++)  {
  121f60:	e0bffd17 	ldw	r2,-12(fp)
  121f64:	10800044 	addi	r2,r2,1
  121f68:	e0bffd15 	stw	r2,-12(fp)
  121f6c:	e0bffd17 	ldw	r2,-12(fp)
  121f70:	10807810 	cmplti	r2,r2,480
  121f74:	103fd01e 	bne	r2,zero,121eb8 <set_display_scale+0x84>
    if ((scale != SCALE_GRID) && (cur_scale != SCALE_NONE) && (scale != cur_scale))  {

        /* need to restore the trace under the lines (tick, grid, or axis) */

	/* go through all points on horizontal lines */
	for (j = -Y_TICK_CNT; j <= Y_TICK_CNT; j++)  {
  121f78:	e0bffe17 	ldw	r2,-8(fp)
  121f7c:	10800044 	addi	r2,r2,1
  121f80:	e0bffe15 	stw	r2,-8(fp)
  121f84:	e0bffe17 	ldw	r2,-8(fp)
  121f88:	10800090 	cmplti	r2,r2,2
  121f8c:	103fbb1e 	bne	r2,zero,121e7c <set_display_scale+0x48>
		    plot_pixel(i, p, PIXEL_BLACK);
	    }
	}

	/* go through all points on vertical lines */
	for (j = -X_TICK_CNT; j <= X_TICK_CNT; j++)  {
  121f90:	00bffec4 	movi	r2,-5
  121f94:	e0bffe15 	stw	r2,-8(fp)
  121f98:	00003f06 	br	122098 <set_display_scale+0x264>

	    /* get x position of the line */
	    p = Y_AXIS_POS + j * X_TICK_SIZE;
  121f9c:	e13ffe17 	ldw	r4,-8(fp)
  121fa0:	01400c04 	movi	r5,48
  121fa4:	0122d480 	call	122d48 <__mulsi3>
  121fa8:	10803c04 	addi	r2,r2,240
  121fac:	e0bffc15 	stw	r2,-16(fp)
	    /* make sure it is in range */
	    if (p >= PLOT_SIZE_X)
  121fb0:	e0bffc17 	ldw	r2,-16(fp)
  121fb4:	10807810 	cmplti	r2,r2,480
  121fb8:	1000021e 	bne	r2,zero,121fc4 <set_display_scale+0x190>
	        p = PLOT_SIZE_X - 1;
  121fbc:	008077c4 	movi	r2,479
  121fc0:	e0bffc15 	stw	r2,-16(fp)
	    if (p < 0)
  121fc4:	e0bffc17 	ldw	r2,-16(fp)
  121fc8:	1000010e 	bge	r2,zero,121fd0 <set_display_scale+0x19c>
	        p = 0;
  121fcc:	e03ffc15 	stw	zero,-16(fp)

	    /* look at entire vertical line */
	    for (i = 0; i < PLOT_SIZE_Y; i++)  {
  121fd0:	e03ffd15 	stw	zero,-12(fp)
  121fd4:	00002a06 	br	122080 <set_display_scale+0x24c>
	        /* check if this point is on or off (need to look at bits) */
		if ((saved_axis_y[j + X_TICK_CNT][i / 8] & (0x80 >> (i % 8))) == 0)
  121fd8:	e0bffe17 	ldw	r2,-8(fp)
  121fdc:	11000144 	addi	r4,r2,5
  121fe0:	e0bffd17 	ldw	r2,-12(fp)
  121fe4:	1000010e 	bge	r2,zero,121fec <set_display_scale+0x1b8>
  121fe8:	108001c4 	addi	r2,r2,7
  121fec:	1005d0fa 	srai	r2,r2,3
  121ff0:	00c004b4 	movhi	r3,18
  121ff4:	18d3ba04 	addi	r3,r3,20200
  121ff8:	2008913a 	slli	r4,r4,4
  121ffc:	2085883a 	add	r2,r4,r2
  122000:	1885883a 	add	r2,r3,r2
  122004:	10800003 	ldbu	r2,0(r2)
  122008:	10c03fcc 	andi	r3,r2,255
  12200c:	e13ffd17 	ldw	r4,-12(fp)
  122010:	00a00034 	movhi	r2,32768
  122014:	108001c4 	addi	r2,r2,7
  122018:	2084703a 	and	r2,r4,r2
  12201c:	1000040e 	bge	r2,zero,122030 <set_display_scale+0x1fc>
  122020:	10bfffc4 	addi	r2,r2,-1
  122024:	013ffe04 	movi	r4,-8
  122028:	1104b03a 	or	r2,r2,r4
  12202c:	10800044 	addi	r2,r2,1
  122030:	01002004 	movi	r4,128
  122034:	2085d83a 	sra	r2,r4,r2
  122038:	1884703a 	and	r2,r3,r2
  12203c:	1000071e 	bne	r2,zero,12205c <set_display_scale+0x228>
		    /* saved pixel is off */
		    plot_pixel(p, i, PIXEL_WHITE);
  122040:	e0fffc17 	ldw	r3,-16(fp)
  122044:	e0bffd17 	ldw	r2,-12(fp)
  122048:	1809883a 	mov	r4,r3
  12204c:	100b883a 	mov	r5,r2
  122050:	000d883a 	mov	r6,zero
  122054:	0121a8c0 	call	121a8c <plot_pixel>
  122058:	00000606 	br	122074 <set_display_scale+0x240>
		else
		    /* saved pixel is on */
		    plot_pixel(p, i, PIXEL_BLACK);
  12205c:	e0fffc17 	ldw	r3,-16(fp)
  122060:	e0bffd17 	ldw	r2,-12(fp)
  122064:	1809883a 	mov	r4,r3
  122068:	100b883a 	mov	r5,r2
  12206c:	01800044 	movi	r6,1
  122070:	0121a8c0 	call	121a8c <plot_pixel>
	        p = PLOT_SIZE_X - 1;
	    if (p < 0)
	        p = 0;

	    /* look at entire vertical line */
	    for (i = 0; i < PLOT_SIZE_Y; i++)  {
  122074:	e0bffd17 	ldw	r2,-12(fp)
  122078:	10800044 	addi	r2,r2,1
  12207c:	e0bffd15 	stw	r2,-12(fp)
  122080:	e0bffd17 	ldw	r2,-12(fp)
  122084:	10802010 	cmplti	r2,r2,128
  122088:	103fd31e 	bne	r2,zero,121fd8 <set_display_scale+0x1a4>
		    plot_pixel(i, p, PIXEL_BLACK);
	    }
	}

	/* go through all points on vertical lines */
	for (j = -X_TICK_CNT; j <= X_TICK_CNT; j++)  {
  12208c:	e0bffe17 	ldw	r2,-8(fp)
  122090:	10800044 	addi	r2,r2,1
  122094:	e0bffe15 	stw	r2,-8(fp)
  122098:	e0bffe17 	ldw	r2,-8(fp)
  12209c:	10800190 	cmplti	r2,r2,6
  1220a0:	103fbe1e 	bne	r2,zero,121f9c <set_display_scale+0x168>
	}
    }


    /* now handle the scale type appropriately */
    switch (scale)  {
  1220a4:	e0bfff17 	ldw	r2,-4(fp)
  1220a8:	10005526 	beq	r2,zero,122200 <set_display_scale+0x3cc>
  1220ac:	108000e8 	cmpgeui	r2,r2,3
  1220b0:	1000541e 	bne	r2,zero,122204 <set_display_scale+0x3d0>

    	case SCALE_AXES:    /* axes for the scale */
    	case SCALE_GRID:    /* grid for the scale */

		            /* draw x lines (grid or tick marks) */
			    for (i = -Y_TICK_CNT; i <= Y_TICK_CNT; i++)  {
  1220b4:	00bfffc4 	movi	r2,-1
  1220b8:	e0bffd15 	stw	r2,-12(fp)
  1220bc:	00002306 	br	12214c <set_display_scale+0x318>

				/* get y position of the line */
				p = X_AXIS_POS + i * Y_TICK_SIZE;
  1220c0:	e13ffd17 	ldw	r4,-12(fp)
  1220c4:	01400c04 	movi	r5,48
  1220c8:	0122d480 	call	122d48 <__mulsi3>
  1220cc:	10801004 	addi	r2,r2,64
  1220d0:	e0bffc15 	stw	r2,-16(fp)
				/* make sure it is in range */
				if (p >= PLOT_SIZE_Y)
  1220d4:	e0bffc17 	ldw	r2,-16(fp)
  1220d8:	10802010 	cmplti	r2,r2,128
  1220dc:	1000021e 	bne	r2,zero,1220e8 <set_display_scale+0x2b4>
				    p = PLOT_SIZE_Y - 1;
  1220e0:	00801fc4 	movi	r2,127
  1220e4:	e0bffc15 	stw	r2,-16(fp)
				if (p < 0)
  1220e8:	e0bffc17 	ldw	r2,-16(fp)
  1220ec:	1000010e 	bge	r2,zero,1220f4 <set_display_scale+0x2c0>
				    p = 0;
  1220f0:	e03ffc15 	stw	zero,-16(fp)

				/* should we draw a grid, an axis, or a tick mark */
				if (scale == SCALE_GRID)
  1220f4:	e0bfff17 	ldw	r2,-4(fp)
  1220f8:	10800098 	cmpnei	r2,r2,2
  1220fc:	1000051e 	bne	r2,zero,122114 <set_display_scale+0x2e0>
				    /* drawing a grid line */
			            plot_hline(X_GRID_START, p, (X_GRID_END - X_GRID_START));
  122100:	0009883a 	mov	r4,zero
  122104:	e17ffc17 	ldw	r5,-16(fp)
  122108:	018077c4 	movi	r6,479
  12210c:	01202180 	call	120218 <plot_hline>
  122110:	00000b06 	br	122140 <set_display_scale+0x30c>
				else if (i == 0)
  122114:	e0bffd17 	ldw	r2,-12(fp)
  122118:	1000051e 	bne	r2,zero,122130 <set_display_scale+0x2fc>
				    /* drawing the x axis */
			            plot_hline(X_AXIS_START, p, (X_AXIS_END - X_AXIS_START));
  12211c:	0009883a 	mov	r4,zero
  122120:	e17ffc17 	ldw	r5,-16(fp)
  122124:	018077c4 	movi	r6,479
  122128:	01202180 	call	120218 <plot_hline>
  12212c:	00000406 	br	122140 <set_display_scale+0x30c>
				else
				    /* must be drawing a tick mark */
			            plot_hline((Y_AXIS_POS - (TICK_LEN / 2)), p, TICK_LEN);
  122130:	01003b84 	movi	r4,238
  122134:	e17ffc17 	ldw	r5,-16(fp)
  122138:	01800144 	movi	r6,5
  12213c:	01202180 	call	120218 <plot_hline>

    	case SCALE_AXES:    /* axes for the scale */
    	case SCALE_GRID:    /* grid for the scale */

		            /* draw x lines (grid or tick marks) */
			    for (i = -Y_TICK_CNT; i <= Y_TICK_CNT; i++)  {
  122140:	e0bffd17 	ldw	r2,-12(fp)
  122144:	10800044 	addi	r2,r2,1
  122148:	e0bffd15 	stw	r2,-12(fp)
  12214c:	e0bffd17 	ldw	r2,-12(fp)
  122150:	10800090 	cmplti	r2,r2,2
  122154:	103fda1e 	bne	r2,zero,1220c0 <set_display_scale+0x28c>
				    /* must be drawing a tick mark */
			            plot_hline((Y_AXIS_POS - (TICK_LEN / 2)), p, TICK_LEN);
			    }

		            /* draw y lines (grid or tick marks) */
			    for (i = -X_TICK_CNT; i <= X_TICK_CNT; i++)  {
  122158:	00bffec4 	movi	r2,-5
  12215c:	e0bffd15 	stw	r2,-12(fp)
  122160:	00002306 	br	1221f0 <set_display_scale+0x3bc>

				/* get x position of the line */
				p = Y_AXIS_POS + i * X_TICK_SIZE;
  122164:	e13ffd17 	ldw	r4,-12(fp)
  122168:	01400c04 	movi	r5,48
  12216c:	0122d480 	call	122d48 <__mulsi3>
  122170:	10803c04 	addi	r2,r2,240
  122174:	e0bffc15 	stw	r2,-16(fp)
				/* make sure it is in range */
				if (p >= PLOT_SIZE_X)
  122178:	e0bffc17 	ldw	r2,-16(fp)
  12217c:	10807810 	cmplti	r2,r2,480
  122180:	1000021e 	bne	r2,zero,12218c <set_display_scale+0x358>
				    p = PLOT_SIZE_X - 1;
  122184:	008077c4 	movi	r2,479
  122188:	e0bffc15 	stw	r2,-16(fp)
			        if (p < 0)
  12218c:	e0bffc17 	ldw	r2,-16(fp)
  122190:	1000010e 	bge	r2,zero,122198 <set_display_scale+0x364>
				    p = 0;
  122194:	e03ffc15 	stw	zero,-16(fp)

				/* should we draw a grid, an axis, or a tick mark */
				if (scale == SCALE_GRID)
  122198:	e0bfff17 	ldw	r2,-4(fp)
  12219c:	10800098 	cmpnei	r2,r2,2
  1221a0:	1000051e 	bne	r2,zero,1221b8 <set_display_scale+0x384>
				    /* drawing a grid line */
			            plot_vline(p, Y_GRID_START, (Y_GRID_END - Y_GRID_START));
  1221a4:	e13ffc17 	ldw	r4,-16(fp)
  1221a8:	000b883a 	mov	r5,zero
  1221ac:	01801fc4 	movi	r6,127
  1221b0:	01202c40 	call	1202c4 <plot_vline>
  1221b4:	00000b06 	br	1221e4 <set_display_scale+0x3b0>
				else if (i == 0)
  1221b8:	e0bffd17 	ldw	r2,-12(fp)
  1221bc:	1000051e 	bne	r2,zero,1221d4 <set_display_scale+0x3a0>
				    /* drawing the y axis */
			            plot_vline(p, Y_AXIS_START, (Y_AXIS_END - Y_AXIS_START));
  1221c0:	e13ffc17 	ldw	r4,-16(fp)
  1221c4:	000b883a 	mov	r5,zero
  1221c8:	01801fc4 	movi	r6,127
  1221cc:	01202c40 	call	1202c4 <plot_vline>
  1221d0:	00000406 	br	1221e4 <set_display_scale+0x3b0>
				else
				    /* must be drawing a tick mark */
			            plot_vline(p, (X_AXIS_POS - (TICK_LEN / 2)), TICK_LEN);
  1221d4:	e13ffc17 	ldw	r4,-16(fp)
  1221d8:	01400f84 	movi	r5,62
  1221dc:	01800144 	movi	r6,5
  1221e0:	01202c40 	call	1202c4 <plot_vline>
				    /* must be drawing a tick mark */
			            plot_hline((Y_AXIS_POS - (TICK_LEN / 2)), p, TICK_LEN);
			    }

		            /* draw y lines (grid or tick marks) */
			    for (i = -X_TICK_CNT; i <= X_TICK_CNT; i++)  {
  1221e4:	e0bffd17 	ldw	r2,-12(fp)
  1221e8:	10800044 	addi	r2,r2,1
  1221ec:	e0bffd15 	stw	r2,-12(fp)
  1221f0:	e0bffd17 	ldw	r2,-12(fp)
  1221f4:	10800190 	cmplti	r2,r2,6
  1221f8:	103fda1e 	bne	r2,zero,122164 <set_display_scale+0x330>
				    /* must be drawing a tick mark */
			            plot_vline(p, (X_AXIS_POS - (TICK_LEN / 2)), TICK_LEN);
			    }

			    /* done with the axes */
			    break;
  1221fc:	00000106 	br	122204 <set_display_scale+0x3d0>

        case SCALE_NONE:    /* there is no scale */
			    /* already restored plot so nothing to do */
			    break;
  122200:	0001883a 	nop

    }


    /* now remember the new (now current) scale type */
    cur_scale = scale;
  122204:	e0bfff17 	ldw	r2,-4(fp)
  122208:	d0a18215 	stw	r2,-31224(gp)


    /* scale is taken care of, return */
    return;
  12220c:	0001883a 	nop

}
  122210:	e037883a 	mov	sp,fp
  122214:	dfc00317 	ldw	ra,12(sp)
  122218:	df000217 	ldw	fp,8(sp)
  12221c:	dc400117 	ldw	r17,4(sp)
  122220:	dc000017 	ldw	r16,0(sp)
  122224:	dec00404 	addi	sp,sp,16
  122228:	f800283a 	ret

0012222c <clear_saved_areas>:
   Last Modified:    May 9, 2006

*/

void  clear_saved_areas()
{
  12222c:	defffb04 	addi	sp,sp,-20
  122230:	dfc00415 	stw	ra,16(sp)
  122234:	df000315 	stw	fp,12(sp)
  122238:	dc000215 	stw	r16,8(sp)
  12223c:	df000204 	addi	fp,sp,8
    int  j;



    /* clear x-axis and y-axis save areas */
    for (j = 0; j <= (2 * Y_TICK_CNT); j++)
  122240:	e03fff15 	stw	zero,-4(fp)
  122244:	00001506 	br	12229c <clear_saved_areas+0x70>
        for (i = 0; i < (SIZE_X / 8); i++)
  122248:	e03ffe15 	stw	zero,-8(fp)
  12224c:	00000d06 	br	122284 <clear_saved_areas+0x58>
            saved_axis_x[j][i] = 0;
  122250:	040004b4 	movhi	r16,18
  122254:	8413e604 	addi	r16,r16,20376
  122258:	e0bfff17 	ldw	r2,-4(fp)
  12225c:	1009883a 	mov	r4,r2
  122260:	01400f04 	movi	r5,60
  122264:	0122d480 	call	122d48 <__mulsi3>
  122268:	e0fffe17 	ldw	r3,-8(fp)
  12226c:	10c5883a 	add	r2,r2,r3
  122270:	8085883a 	add	r2,r16,r2
  122274:	10000005 	stb	zero,0(r2)



    /* clear x-axis and y-axis save areas */
    for (j = 0; j <= (2 * Y_TICK_CNT); j++)
        for (i = 0; i < (SIZE_X / 8); i++)
  122278:	e0bffe17 	ldw	r2,-8(fp)
  12227c:	10800044 	addi	r2,r2,1
  122280:	e0bffe15 	stw	r2,-8(fp)
  122284:	e0bffe17 	ldw	r2,-8(fp)
  122288:	10800f10 	cmplti	r2,r2,60
  12228c:	103ff01e 	bne	r2,zero,122250 <clear_saved_areas+0x24>
    int  j;



    /* clear x-axis and y-axis save areas */
    for (j = 0; j <= (2 * Y_TICK_CNT); j++)
  122290:	e0bfff17 	ldw	r2,-4(fp)
  122294:	10800044 	addi	r2,r2,1
  122298:	e0bfff15 	stw	r2,-4(fp)
  12229c:	e0bfff17 	ldw	r2,-4(fp)
  1222a0:	108000d0 	cmplti	r2,r2,3
  1222a4:	103fe81e 	bne	r2,zero,122248 <clear_saved_areas+0x1c>
        for (i = 0; i < (SIZE_X / 8); i++)
            saved_axis_x[j][i] = 0;
    for (j = 0; j <= (2 * X_TICK_CNT); j++)
  1222a8:	e03fff15 	stw	zero,-4(fp)
  1222ac:	00001306 	br	1222fc <clear_saved_areas+0xd0>
        for (i = 0; i < (SIZE_Y / 8); i++)
  1222b0:	e03ffe15 	stw	zero,-8(fp)
  1222b4:	00000b06 	br	1222e4 <clear_saved_areas+0xb8>
            saved_axis_y[j][i] = 0;
  1222b8:	00c004b4 	movhi	r3,18
  1222bc:	18d3ba04 	addi	r3,r3,20200
  1222c0:	e0bfff17 	ldw	r2,-4(fp)
  1222c4:	1008913a 	slli	r4,r2,4
  1222c8:	e0bffe17 	ldw	r2,-8(fp)
  1222cc:	2085883a 	add	r2,r4,r2
  1222d0:	1885883a 	add	r2,r3,r2
  1222d4:	10000005 	stb	zero,0(r2)
    /* clear x-axis and y-axis save areas */
    for (j = 0; j <= (2 * Y_TICK_CNT); j++)
        for (i = 0; i < (SIZE_X / 8); i++)
            saved_axis_x[j][i] = 0;
    for (j = 0; j <= (2 * X_TICK_CNT); j++)
        for (i = 0; i < (SIZE_Y / 8); i++)
  1222d8:	e0bffe17 	ldw	r2,-8(fp)
  1222dc:	10800044 	addi	r2,r2,1
  1222e0:	e0bffe15 	stw	r2,-8(fp)
  1222e4:	e0bffe17 	ldw	r2,-8(fp)
  1222e8:	10800410 	cmplti	r2,r2,16
  1222ec:	103ff21e 	bne	r2,zero,1222b8 <clear_saved_areas+0x8c>

    /* clear x-axis and y-axis save areas */
    for (j = 0; j <= (2 * Y_TICK_CNT); j++)
        for (i = 0; i < (SIZE_X / 8); i++)
            saved_axis_x[j][i] = 0;
    for (j = 0; j <= (2 * X_TICK_CNT); j++)
  1222f0:	e0bfff17 	ldw	r2,-4(fp)
  1222f4:	10800044 	addi	r2,r2,1
  1222f8:	e0bfff15 	stw	r2,-4(fp)
  1222fc:	e0bfff17 	ldw	r2,-4(fp)
  122300:	108002d0 	cmplti	r2,r2,11
  122304:	103fea1e 	bne	r2,zero,1222b0 <clear_saved_areas+0x84>
        for (i = 0; i < (SIZE_Y / 8); i++)
            saved_axis_y[j][i] = 0;

    /* clear the menu save ares */
    for (i = 0; i < MENU_SIZE_Y; i++)
  122308:	e03ffe15 	stw	zero,-8(fp)
  12230c:	00001506 	br	122364 <clear_saved_areas+0x138>
        for (j = 0; j < ((MENU_SIZE_X + 7) / 8); j++)
  122310:	e03fff15 	stw	zero,-4(fp)
  122314:	00000d06 	br	12234c <clear_saved_areas+0x120>
	    saved_menu[i][j] = 0;
  122318:	040004b4 	movhi	r16,18
  12231c:	84131204 	addi	r16,r16,19528
  122320:	e0bffe17 	ldw	r2,-8(fp)
  122324:	1009883a 	mov	r4,r2
  122328:	01400304 	movi	r5,12
  12232c:	0122d480 	call	122d48 <__mulsi3>
  122330:	e0ffff17 	ldw	r3,-4(fp)
  122334:	10c5883a 	add	r2,r2,r3
  122338:	8085883a 	add	r2,r16,r2
  12233c:	10000005 	stb	zero,0(r2)
        for (i = 0; i < (SIZE_Y / 8); i++)
            saved_axis_y[j][i] = 0;

    /* clear the menu save ares */
    for (i = 0; i < MENU_SIZE_Y; i++)
        for (j = 0; j < ((MENU_SIZE_X + 7) / 8); j++)
  122340:	e0bfff17 	ldw	r2,-4(fp)
  122344:	10800044 	addi	r2,r2,1
  122348:	e0bfff15 	stw	r2,-4(fp)
  12234c:	e0bfff17 	ldw	r2,-4(fp)
  122350:	10800310 	cmplti	r2,r2,12
  122354:	103ff01e 	bne	r2,zero,122318 <clear_saved_areas+0xec>
    for (j = 0; j <= (2 * X_TICK_CNT); j++)
        for (i = 0; i < (SIZE_Y / 8); i++)
            saved_axis_y[j][i] = 0;

    /* clear the menu save ares */
    for (i = 0; i < MENU_SIZE_Y; i++)
  122358:	e0bffe17 	ldw	r2,-8(fp)
  12235c:	10800044 	addi	r2,r2,1
  122360:	e0bffe15 	stw	r2,-8(fp)
  122364:	e0bffe17 	ldw	r2,-8(fp)
  122368:	10800e10 	cmplti	r2,r2,56
  12236c:	103fe81e 	bne	r2,zero,122310 <clear_saved_areas+0xe4>
        for (j = 0; j < ((MENU_SIZE_X + 7) / 8); j++)
	    saved_menu[i][j] = 0;

    /* clear general save area */
    for (i = 0; i < SAVE_SIZE_Y; i++)
  122370:	e03ffe15 	stw	zero,-8(fp)
  122374:	00001506 	br	1223cc <clear_saved_areas+0x1a0>
        for (j = 0; j < (SAVE_SIZE_X / 8); j++)
  122378:	e03fff15 	stw	zero,-4(fp)
  12237c:	00000d06 	br	1223b4 <clear_saved_areas+0x188>
	    saved_area[i][j] = 0;
  122380:	040004b4 	movhi	r16,18
  122384:	84141304 	addi	r16,r16,20556
  122388:	e0bffe17 	ldw	r2,-8(fp)
  12238c:	1009883a 	mov	r4,r2
  122390:	014003c4 	movi	r5,15
  122394:	0122d480 	call	122d48 <__mulsi3>
  122398:	e0ffff17 	ldw	r3,-4(fp)
  12239c:	10c5883a 	add	r2,r2,r3
  1223a0:	8085883a 	add	r2,r16,r2
  1223a4:	10000005 	stb	zero,0(r2)
        for (j = 0; j < ((MENU_SIZE_X + 7) / 8); j++)
	    saved_menu[i][j] = 0;

    /* clear general save area */
    for (i = 0; i < SAVE_SIZE_Y; i++)
        for (j = 0; j < (SAVE_SIZE_X / 8); j++)
  1223a8:	e0bfff17 	ldw	r2,-4(fp)
  1223ac:	10800044 	addi	r2,r2,1
  1223b0:	e0bfff15 	stw	r2,-4(fp)
  1223b4:	e0bfff17 	ldw	r2,-4(fp)
  1223b8:	108003d0 	cmplti	r2,r2,15
  1223bc:	103ff01e 	bne	r2,zero,122380 <clear_saved_areas+0x154>
    for (i = 0; i < MENU_SIZE_Y; i++)
        for (j = 0; j < ((MENU_SIZE_X + 7) / 8); j++)
	    saved_menu[i][j] = 0;

    /* clear general save area */
    for (i = 0; i < SAVE_SIZE_Y; i++)
  1223c0:	e0bffe17 	ldw	r2,-8(fp)
  1223c4:	10800044 	addi	r2,r2,1
  1223c8:	e0bffe15 	stw	r2,-8(fp)
  1223cc:	e0bffe17 	ldw	r2,-8(fp)
  1223d0:	10800410 	cmplti	r2,r2,16
  1223d4:	103fe81e 	bne	r2,zero,122378 <clear_saved_areas+0x14c>
        for (j = 0; j < (SAVE_SIZE_X / 8); j++)
	    saved_area[i][j] = 0;


    /* done clearing the saved areas - return */
    return;
  1223d8:	0001883a 	nop

}
  1223dc:	e037883a 	mov	sp,fp
  1223e0:	dfc00217 	ldw	ra,8(sp)
  1223e4:	df000117 	ldw	fp,4(sp)
  1223e8:	dc000017 	ldw	r16,0(sp)
  1223ec:	dec00304 	addi	sp,sp,12
  1223f0:	f800283a 	ret

001223f4 <restore_menu_trace>:
   Last Modified:    Mar. 13, 1994

*/

void  restore_menu_trace()
{
  1223f4:	defff904 	addi	sp,sp,-28
  1223f8:	dfc00615 	stw	ra,24(sp)
  1223fc:	df000515 	stw	fp,20(sp)
  122400:	dc000415 	stw	r16,16(sp)
  122404:	df000404 	addi	fp,sp,16
    int  y;



    /* loop, restoring the trace under the menu */
    for (y = MENU_UL_Y; y < (MENU_UL_Y + MENU_SIZE_Y); y++)  {
  122408:	e03fff15 	stw	zero,-4(fp)
  12240c:	00003406 	br	1224e0 <restore_menu_trace+0xec>

        /* starting a row - initialize bit position */
	bit_position = 0x80;	/* start at high-order bit in the byte */
  122410:	00802004 	movi	r2,128
  122414:	e0bffc15 	stw	r2,-16(fp)
	bit_offset = 0;		/* first byte of the row */
  122418:	e03ffd15 	stw	zero,-12(fp)

        for (x = MENU_UL_X; x < (MENU_UL_X + MENU_SIZE_X); x++)  {
  12241c:	00805e84 	movi	r2,378
  122420:	e0bffe15 	stw	r2,-8(fp)
  122424:	00002806 	br	1224c8 <restore_menu_trace+0xd4>

	    /* check if this point is on or off (need to look at bits) */
	    if ((saved_menu[y - MENU_UL_Y][bit_offset] & bit_position) == 0)
  122428:	040004b4 	movhi	r16,18
  12242c:	84131204 	addi	r16,r16,19528
  122430:	e0bfff17 	ldw	r2,-4(fp)
  122434:	1009883a 	mov	r4,r2
  122438:	01400304 	movi	r5,12
  12243c:	0122d480 	call	122d48 <__mulsi3>
  122440:	e0fffd17 	ldw	r3,-12(fp)
  122444:	10c5883a 	add	r2,r2,r3
  122448:	8085883a 	add	r2,r16,r2
  12244c:	10800003 	ldbu	r2,0(r2)
  122450:	10c03fcc 	andi	r3,r2,255
  122454:	e0bffc17 	ldw	r2,-16(fp)
  122458:	1884703a 	and	r2,r3,r2
  12245c:	1000071e 	bne	r2,zero,12247c <restore_menu_trace+0x88>
	        /* saved pixel is off */
		plot_pixel(x, y, PIXEL_WHITE);
  122460:	e0fffe17 	ldw	r3,-8(fp)
  122464:	e0bfff17 	ldw	r2,-4(fp)
  122468:	1809883a 	mov	r4,r3
  12246c:	100b883a 	mov	r5,r2
  122470:	000d883a 	mov	r6,zero
  122474:	0121a8c0 	call	121a8c <plot_pixel>
  122478:	00000606 	br	122494 <restore_menu_trace+0xa0>
	    else
	        /* saved pixel is on */
		plot_pixel(x, y, PIXEL_BLACK);
  12247c:	e0fffe17 	ldw	r3,-8(fp)
  122480:	e0bfff17 	ldw	r2,-4(fp)
  122484:	1809883a 	mov	r4,r3
  122488:	100b883a 	mov	r5,r2
  12248c:	01800044 	movi	r6,1
  122490:	0121a8c0 	call	121a8c <plot_pixel>

	    /* move to the next bit position */
	    bit_position >>= 1;
  122494:	e0bffc17 	ldw	r2,-16(fp)
  122498:	1005d07a 	srai	r2,r2,1
  12249c:	e0bffc15 	stw	r2,-16(fp)
	    /* check if moving to next byte */
	    if (bit_position == 0)  {
  1224a0:	e0bffc17 	ldw	r2,-16(fp)
  1224a4:	1000051e 	bne	r2,zero,1224bc <restore_menu_trace+0xc8>
	        /* now on high bit of next byte */
		bit_position = 0x80;
  1224a8:	00802004 	movi	r2,128
  1224ac:	e0bffc15 	stw	r2,-16(fp)
		bit_offset++;
  1224b0:	e0bffd17 	ldw	r2,-12(fp)
  1224b4:	10800044 	addi	r2,r2,1
  1224b8:	e0bffd15 	stw	r2,-12(fp)

        /* starting a row - initialize bit position */
	bit_position = 0x80;	/* start at high-order bit in the byte */
	bit_offset = 0;		/* first byte of the row */

        for (x = MENU_UL_X; x < (MENU_UL_X + MENU_SIZE_X); x++)  {
  1224bc:	e0bffe17 	ldw	r2,-8(fp)
  1224c0:	10800044 	addi	r2,r2,1
  1224c4:	e0bffe15 	stw	r2,-8(fp)
  1224c8:	e0bffe17 	ldw	r2,-8(fp)
  1224cc:	10807690 	cmplti	r2,r2,474
  1224d0:	103fd51e 	bne	r2,zero,122428 <restore_menu_trace+0x34>
    int  y;



    /* loop, restoring the trace under the menu */
    for (y = MENU_UL_Y; y < (MENU_UL_Y + MENU_SIZE_Y); y++)  {
  1224d4:	e0bfff17 	ldw	r2,-4(fp)
  1224d8:	10800044 	addi	r2,r2,1
  1224dc:	e0bfff15 	stw	r2,-4(fp)
  1224e0:	e0bfff17 	ldw	r2,-4(fp)
  1224e4:	10800e10 	cmplti	r2,r2,56
  1224e8:	103fc91e 	bne	r2,zero,122410 <restore_menu_trace+0x1c>
        }
    }


    /* restored menu area - return */
    return;
  1224ec:	0001883a 	nop

}
  1224f0:	e037883a 	mov	sp,fp
  1224f4:	dfc00217 	ldw	ra,8(sp)
  1224f8:	df000117 	ldw	fp,4(sp)
  1224fc:	dc000017 	ldw	r16,0(sp)
  122500:	dec00304 	addi	sp,sp,12
  122504:	f800283a 	ret

00122508 <set_save_area>:
   Last Modified:    Mar. 8, 1994

*/

void  set_save_area(int pos_x, int pos_y, int size_x, int size_y)
{
  122508:	defff704 	addi	sp,sp,-36
  12250c:	dfc00815 	stw	ra,32(sp)
  122510:	df000715 	stw	fp,28(sp)
  122514:	dc000615 	stw	r16,24(sp)
  122518:	df000604 	addi	fp,sp,24
  12251c:	e13ffc15 	stw	r4,-16(fp)
  122520:	e17ffd15 	stw	r5,-12(fp)
  122524:	e1bffe15 	stw	r6,-8(fp)
  122528:	e1ffff15 	stw	r7,-4(fp)
    int  y;



    /* just setup all the locally global variables from the passed values */
    saved_pos_x = pos_x;
  12252c:	e0bffc17 	ldw	r2,-16(fp)
  122530:	d0a18815 	stw	r2,-31200(gp)
    saved_pos_y = pos_y;
  122534:	e0bffd17 	ldw	r2,-12(fp)
  122538:	d0a18515 	stw	r2,-31212(gp)
    saved_end_x = pos_x + size_x;
  12253c:	e0fffc17 	ldw	r3,-16(fp)
  122540:	e0bffe17 	ldw	r2,-8(fp)
  122544:	1885883a 	add	r2,r3,r2
  122548:	d0a18715 	stw	r2,-31204(gp)
    saved_end_y = pos_y + size_y;
  12254c:	e0fffd17 	ldw	r3,-12(fp)
  122550:	e0bfff17 	ldw	r2,-4(fp)
  122554:	1885883a 	add	r2,r3,r2
  122558:	d0a18415 	stw	r2,-31216(gp)


    /* clear the save area */
    for (y = 0; y < SAVE_SIZE_Y; y++)  {
  12255c:	e03ffb15 	stw	zero,-20(fp)
  122560:	00001506 	br	1225b8 <set_save_area+0xb0>
        for (x = 0; x < (SAVE_SIZE_X / 8); x++)  {
  122564:	e03ffa15 	stw	zero,-24(fp)
  122568:	00000d06 	br	1225a0 <set_save_area+0x98>
	    saved_area[y][x] = 0;
  12256c:	040004b4 	movhi	r16,18
  122570:	84141304 	addi	r16,r16,20556
  122574:	e0bffb17 	ldw	r2,-20(fp)
  122578:	1009883a 	mov	r4,r2
  12257c:	014003c4 	movi	r5,15
  122580:	0122d480 	call	122d48 <__mulsi3>
  122584:	e0fffa17 	ldw	r3,-24(fp)
  122588:	10c5883a 	add	r2,r2,r3
  12258c:	8085883a 	add	r2,r16,r2
  122590:	10000005 	stb	zero,0(r2)
    saved_end_y = pos_y + size_y;


    /* clear the save area */
    for (y = 0; y < SAVE_SIZE_Y; y++)  {
        for (x = 0; x < (SAVE_SIZE_X / 8); x++)  {
  122594:	e0bffa17 	ldw	r2,-24(fp)
  122598:	10800044 	addi	r2,r2,1
  12259c:	e0bffa15 	stw	r2,-24(fp)
  1225a0:	e0bffa17 	ldw	r2,-24(fp)
  1225a4:	108003d0 	cmplti	r2,r2,15
  1225a8:	103ff01e 	bne	r2,zero,12256c <set_save_area+0x64>
    saved_end_x = pos_x + size_x;
    saved_end_y = pos_y + size_y;


    /* clear the save area */
    for (y = 0; y < SAVE_SIZE_Y; y++)  {
  1225ac:	e0bffb17 	ldw	r2,-20(fp)
  1225b0:	10800044 	addi	r2,r2,1
  1225b4:	e0bffb15 	stw	r2,-20(fp)
  1225b8:	e0bffb17 	ldw	r2,-20(fp)
  1225bc:	10800410 	cmplti	r2,r2,16
  1225c0:	103fe81e 	bne	r2,zero,122564 <set_save_area+0x5c>
        }
    }


    /* setup the saved area - return */
    return;
  1225c4:	0001883a 	nop

}
  1225c8:	e037883a 	mov	sp,fp
  1225cc:	dfc00217 	ldw	ra,8(sp)
  1225d0:	df000117 	ldw	fp,4(sp)
  1225d4:	dc000017 	ldw	r16,0(sp)
  1225d8:	dec00304 	addi	sp,sp,12
  1225dc:	f800283a 	ret

001225e0 <restore_trace>:
   Last Modified:    Mar. 13, 1994

*/

void  restore_trace()
{
  1225e0:	defff904 	addi	sp,sp,-28
  1225e4:	dfc00615 	stw	ra,24(sp)
  1225e8:	df000515 	stw	fp,20(sp)
  1225ec:	dc000415 	stw	r16,16(sp)
  1225f0:	df000404 	addi	fp,sp,16
    int  y;



    /* loop, restoring the saved trace */
    for (y = saved_pos_y; y < saved_end_y; y++)  {
  1225f4:	d0a18517 	ldw	r2,-31212(gp)
  1225f8:	e0bfff15 	stw	r2,-4(fp)
  1225fc:	00003606 	br	1226d8 <restore_trace+0xf8>

        /* starting a row - initialize bit position */
	bit_position = 0x80;	/* start at high-order bit in the byte */
  122600:	00802004 	movi	r2,128
  122604:	e0bffc15 	stw	r2,-16(fp)
	bit_offset = 0;		/* first byte of the row */
  122608:	e03ffd15 	stw	zero,-12(fp)

        for (x = saved_pos_x; x < saved_end_x; x++)  {
  12260c:	d0a18817 	ldw	r2,-31200(gp)
  122610:	e0bffe15 	stw	r2,-8(fp)
  122614:	00002a06 	br	1226c0 <restore_trace+0xe0>

	    /* check if this point is on or off (need to look at bits) */
	    if ((saved_area[y - saved_pos_y][bit_offset] & bit_position) == 0)
  122618:	d0a18517 	ldw	r2,-31212(gp)
  12261c:	e0ffff17 	ldw	r3,-4(fp)
  122620:	1885c83a 	sub	r2,r3,r2
  122624:	040004b4 	movhi	r16,18
  122628:	84141304 	addi	r16,r16,20556
  12262c:	1009883a 	mov	r4,r2
  122630:	014003c4 	movi	r5,15
  122634:	0122d480 	call	122d48 <__mulsi3>
  122638:	e0fffd17 	ldw	r3,-12(fp)
  12263c:	10c5883a 	add	r2,r2,r3
  122640:	8085883a 	add	r2,r16,r2
  122644:	10800003 	ldbu	r2,0(r2)
  122648:	10c03fcc 	andi	r3,r2,255
  12264c:	e0bffc17 	ldw	r2,-16(fp)
  122650:	1884703a 	and	r2,r3,r2
  122654:	1000071e 	bne	r2,zero,122674 <restore_trace+0x94>
	        /* saved pixel is off */
		plot_pixel(x, y, PIXEL_WHITE);
  122658:	e0fffe17 	ldw	r3,-8(fp)
  12265c:	e0bfff17 	ldw	r2,-4(fp)
  122660:	1809883a 	mov	r4,r3
  122664:	100b883a 	mov	r5,r2
  122668:	000d883a 	mov	r6,zero
  12266c:	0121a8c0 	call	121a8c <plot_pixel>
  122670:	00000606 	br	12268c <restore_trace+0xac>
	    else
	        /* saved pixel is on */
		plot_pixel(x, y, PIXEL_BLACK);
  122674:	e0fffe17 	ldw	r3,-8(fp)
  122678:	e0bfff17 	ldw	r2,-4(fp)
  12267c:	1809883a 	mov	r4,r3
  122680:	100b883a 	mov	r5,r2
  122684:	01800044 	movi	r6,1
  122688:	0121a8c0 	call	121a8c <plot_pixel>

	    /* move to the next bit position */
	    bit_position >>= 1;
  12268c:	e0bffc17 	ldw	r2,-16(fp)
  122690:	1005d07a 	srai	r2,r2,1
  122694:	e0bffc15 	stw	r2,-16(fp)
	    /* check if moving to next byte */
	    if (bit_position == 0)  {
  122698:	e0bffc17 	ldw	r2,-16(fp)
  12269c:	1000051e 	bne	r2,zero,1226b4 <restore_trace+0xd4>
	        /* now on high bit of next byte */
		bit_position = 0x80;
  1226a0:	00802004 	movi	r2,128
  1226a4:	e0bffc15 	stw	r2,-16(fp)
		bit_offset++;
  1226a8:	e0bffd17 	ldw	r2,-12(fp)
  1226ac:	10800044 	addi	r2,r2,1
  1226b0:	e0bffd15 	stw	r2,-12(fp)

        /* starting a row - initialize bit position */
	bit_position = 0x80;	/* start at high-order bit in the byte */
	bit_offset = 0;		/* first byte of the row */

        for (x = saved_pos_x; x < saved_end_x; x++)  {
  1226b4:	e0bffe17 	ldw	r2,-8(fp)
  1226b8:	10800044 	addi	r2,r2,1
  1226bc:	e0bffe15 	stw	r2,-8(fp)
  1226c0:	d0a18717 	ldw	r2,-31204(gp)
  1226c4:	e0fffe17 	ldw	r3,-8(fp)
  1226c8:	18bfd316 	blt	r3,r2,122618 <restore_trace+0x38>
    int  y;



    /* loop, restoring the saved trace */
    for (y = saved_pos_y; y < saved_end_y; y++)  {
  1226cc:	e0bfff17 	ldw	r2,-4(fp)
  1226d0:	10800044 	addi	r2,r2,1
  1226d4:	e0bfff15 	stw	r2,-4(fp)
  1226d8:	d0a18417 	ldw	r2,-31216(gp)
  1226dc:	e0ffff17 	ldw	r3,-4(fp)
  1226e0:	18bfc716 	blt	r3,r2,122600 <restore_trace+0x20>
        }
    }


    /* restored the saved area - return */
    return;
  1226e4:	0001883a 	nop

}
  1226e8:	e037883a 	mov	sp,fp
  1226ec:	dfc00217 	ldw	ra,8(sp)
  1226f0:	df000117 	ldw	fp,4(sp)
  1226f4:	dc000017 	ldw	r16,0(sp)
  1226f8:	dec00304 	addi	sp,sp,12
  1226fc:	f800283a 	ret

00122700 <do_trace>:
   Last Modified:    Mar. 13, 1994

*/

void  do_trace()
{
  122700:	defffe04 	addi	sp,sp,-8
  122704:	dfc00115 	stw	ra,4(sp)
  122708:	df000015 	stw	fp,0(sp)
  12270c:	d839883a 	mov	fp,sp



    /* start up the trace */
    /* indicate whether using automatic triggering or not */
    start_sample(get_trigger_mode() == AUTO_TRIGGER);
  122710:	0120d540 	call	120d54 <get_trigger_mode>
  122714:	10800060 	cmpeqi	r2,r2,1
  122718:	10803fcc 	andi	r2,r2,255
  12271c:	1009883a 	mov	r4,r2
  122720:	0121b280 	call	121b28 <start_sample>

    /* now not ready for another trace (currently doing one) */
    trace_status = FALSE;
  122724:	d0218315 	stw	zero,-31220(gp)

    /* and are currently sampling data */
    sampling = TRUE;
  122728:	00800044 	movi	r2,1
  12272c:	d0a18915 	stw	r2,-31196(gp)


    /* trace is going, return */
    return;
  122730:	0001883a 	nop

}
  122734:	e037883a 	mov	sp,fp
  122738:	dfc00117 	ldw	ra,4(sp)
  12273c:	df000017 	ldw	fp,0(sp)
  122740:	dec00204 	addi	sp,sp,8
  122744:	f800283a 	ret

00122748 <plot_trace>:
   Last Modified:    May 9, 2006

*/

void  plot_trace(unsigned char *sample)
{
  122748:	defff304 	addi	sp,sp,-52
  12274c:	dfc00c15 	stw	ra,48(sp)
  122750:	df000b15 	stw	fp,44(sp)
  122754:	dcc00a15 	stw	r19,40(sp)
  122758:	dc800915 	stw	r18,36(sp)
  12275c:	dc400815 	stw	r17,32(sp)
  122760:	dc000715 	stw	r16,28(sp)
  122764:	df000704 	addi	fp,sp,28
  122768:	e13fff15 	stw	r4,-4(fp)
    /* variables */
    int  x = 0;				/* current x position to plot */
  12276c:	e03ff915 	stw	zero,-28(fp)
    int  x_pos = (PLOT_SIZE_X / 2);	/* "fine" x position for multiple point plotting */
  122770:	00803c04 	movi	r2,240
  122774:	e0bffa15 	stw	r2,-24(fp)
    int  j;



    /* first, clear the display to get rid of old plots */
    clear_display();
  122778:	0121a6c0 	call	121a6c <clear_display>

    /* clear the saved areas too */
    clear_saved_areas();
  12277c:	012222c0 	call	12222c <clear_saved_areas>

    /* re-display the menu (if it was on) */
    refresh_menu();
  122780:	01208b00 	call	1208b0 <refresh_menu>


    /* plot the sample */
    for (i = 0; i < sample_size; i++)  {
  122784:	e03ffc15 	stw	zero,-16(fp)
  122788:	00010b06 	br	122bb8 <plot_trace+0x470>

        /* determine y position of point (note: screen coordinates invert) */
	y = (PLOT_SIZE_Y - 1) - ((sample[i] * (PLOT_SIZE_Y - 1)) / 255);
  12278c:	e0bffc17 	ldw	r2,-16(fp)
  122790:	e0ffff17 	ldw	r3,-4(fp)
  122794:	1885883a 	add	r2,r3,r2
  122798:	10800003 	ldbu	r2,0(r2)
  12279c:	10803fcc 	andi	r2,r2,255
  1227a0:	1009883a 	mov	r4,r2
  1227a4:	01401fc4 	movi	r5,127
  1227a8:	0122d480 	call	122d48 <__mulsi3>
  1227ac:	1009883a 	mov	r4,r2
  1227b0:	01403fc4 	movi	r5,255
  1227b4:	0122c8c0 	call	122c8c <__divsi3>
  1227b8:	00c01fc4 	movi	r3,127
  1227bc:	1885c83a 	sub	r2,r3,r2
  1227c0:	e0bffe15 	stw	r2,-8(fp)

        /* plot this point */
	plot_pixel(x, y, PIXEL_BLACK);
  1227c4:	e0fff917 	ldw	r3,-28(fp)
  1227c8:	e0bffe17 	ldw	r2,-8(fp)
  1227cc:	1809883a 	mov	r4,r3
  1227d0:	100b883a 	mov	r5,r2
  1227d4:	01800044 	movi	r6,1
  1227d8:	0121a8c0 	call	121a8c <plot_pixel>


	/* check if the point is in a save area */

	/* check if in the menu area */
	if ((x >= MENU_UL_X) && (x < (MENU_UL_X + MENU_SIZE_X)) &&
  1227dc:	e0bff917 	ldw	r2,-28(fp)
  1227e0:	10805e90 	cmplti	r2,r2,378
  1227e4:	10002f1e 	bne	r2,zero,1228a4 <plot_trace+0x15c>
  1227e8:	e0bff917 	ldw	r2,-28(fp)
  1227ec:	10807688 	cmpgei	r2,r2,474
  1227f0:	10002c1e 	bne	r2,zero,1228a4 <plot_trace+0x15c>
  1227f4:	e0bffe17 	ldw	r2,-8(fp)
  1227f8:	10002a16 	blt	r2,zero,1228a4 <plot_trace+0x15c>
	    (y >= MENU_UL_Y) && (y < (MENU_UL_Y + MENU_SIZE_Y)))
  1227fc:	e0bffe17 	ldw	r2,-8(fp)
  122800:	10800e08 	cmpgei	r2,r2,56
  122804:	1000271e 	bne	r2,zero,1228a4 <plot_trace+0x15c>
	    /* point is in the menu area - save it */
	    saved_menu[y - MENU_UL_Y][(x - MENU_UL_X)/8] |= (0x80 >> ((x - MENU_UL_X) % 8));
  122808:	e0bff917 	ldw	r2,-28(fp)
  12280c:	10bfa184 	addi	r2,r2,-378
  122810:	1000010e 	bge	r2,zero,122818 <plot_trace+0xd0>
  122814:	108001c4 	addi	r2,r2,7
  122818:	1005d0fa 	srai	r2,r2,3
  12281c:	1021883a 	mov	r16,r2
  122820:	044004b4 	movhi	r17,18
  122824:	8c531204 	addi	r17,r17,19528
  122828:	e0bffe17 	ldw	r2,-8(fp)
  12282c:	1009883a 	mov	r4,r2
  122830:	01400304 	movi	r5,12
  122834:	0122d480 	call	122d48 <__mulsi3>
  122838:	1405883a 	add	r2,r2,r16
  12283c:	8885883a 	add	r2,r17,r2
  122840:	10800003 	ldbu	r2,0(r2)
  122844:	1007883a 	mov	r3,r2
  122848:	e0bff917 	ldw	r2,-28(fp)
  12284c:	113fa184 	addi	r4,r2,-378
  122850:	00a00034 	movhi	r2,32768
  122854:	108001c4 	addi	r2,r2,7
  122858:	2084703a 	and	r2,r4,r2
  12285c:	1000040e 	bge	r2,zero,122870 <plot_trace+0x128>
  122860:	10bfffc4 	addi	r2,r2,-1
  122864:	013ffe04 	movi	r4,-8
  122868:	1104b03a 	or	r2,r2,r4
  12286c:	10800044 	addi	r2,r2,1
  122870:	01002004 	movi	r4,128
  122874:	2085d83a 	sra	r2,r4,r2
  122878:	1884b03a 	or	r2,r3,r2
  12287c:	1023883a 	mov	r17,r2
  122880:	048004b4 	movhi	r18,18
  122884:	94931204 	addi	r18,r18,19528
  122888:	e0bffe17 	ldw	r2,-8(fp)
  12288c:	1009883a 	mov	r4,r2
  122890:	01400304 	movi	r5,12
  122894:	0122d480 	call	122d48 <__mulsi3>
  122898:	1405883a 	add	r2,r2,r16
  12289c:	9085883a 	add	r2,r18,r2
  1228a0:	14400005 	stb	r17,0(r2)

	/* check if in the saved area */
	if ((x >= saved_pos_x) && (x <= saved_end_x) && (y >= saved_pos_y) && (y <= saved_end_y))
  1228a4:	d0a18817 	ldw	r2,-31200(gp)
  1228a8:	e0fff917 	ldw	r3,-28(fp)
  1228ac:	18803616 	blt	r3,r2,122988 <plot_trace+0x240>
  1228b0:	d0e18717 	ldw	r3,-31204(gp)
  1228b4:	e0bff917 	ldw	r2,-28(fp)
  1228b8:	18803316 	blt	r3,r2,122988 <plot_trace+0x240>
  1228bc:	d0a18517 	ldw	r2,-31212(gp)
  1228c0:	e0fffe17 	ldw	r3,-8(fp)
  1228c4:	18803016 	blt	r3,r2,122988 <plot_trace+0x240>
  1228c8:	d0e18417 	ldw	r3,-31216(gp)
  1228cc:	e0bffe17 	ldw	r2,-8(fp)
  1228d0:	18802d16 	blt	r3,r2,122988 <plot_trace+0x240>
	    /* point is in the save area - save it */
	    saved_area[y - saved_pos_y][(x - saved_pos_x)/8] |= (0x80 >> ((x - saved_pos_x) % 8));
  1228d4:	d0a18517 	ldw	r2,-31212(gp)
  1228d8:	e0fffe17 	ldw	r3,-8(fp)
  1228dc:	18a3c83a 	sub	r17,r3,r2
  1228e0:	d0a18817 	ldw	r2,-31200(gp)
  1228e4:	e0fff917 	ldw	r3,-28(fp)
  1228e8:	1885c83a 	sub	r2,r3,r2
  1228ec:	1000010e 	bge	r2,zero,1228f4 <plot_trace+0x1ac>
  1228f0:	108001c4 	addi	r2,r2,7
  1228f4:	1005d0fa 	srai	r2,r2,3
  1228f8:	1021883a 	mov	r16,r2
  1228fc:	d0a18517 	ldw	r2,-31212(gp)
  122900:	e0fffe17 	ldw	r3,-8(fp)
  122904:	1885c83a 	sub	r2,r3,r2
  122908:	048004b4 	movhi	r18,18
  12290c:	94941304 	addi	r18,r18,20556
  122910:	1009883a 	mov	r4,r2
  122914:	014003c4 	movi	r5,15
  122918:	0122d480 	call	122d48 <__mulsi3>
  12291c:	1405883a 	add	r2,r2,r16
  122920:	9085883a 	add	r2,r18,r2
  122924:	10800003 	ldbu	r2,0(r2)
  122928:	1007883a 	mov	r3,r2
  12292c:	d0a18817 	ldw	r2,-31200(gp)
  122930:	e13ff917 	ldw	r4,-28(fp)
  122934:	2089c83a 	sub	r4,r4,r2
  122938:	00a00034 	movhi	r2,32768
  12293c:	108001c4 	addi	r2,r2,7
  122940:	2084703a 	and	r2,r4,r2
  122944:	1000040e 	bge	r2,zero,122958 <plot_trace+0x210>
  122948:	10bfffc4 	addi	r2,r2,-1
  12294c:	013ffe04 	movi	r4,-8
  122950:	1104b03a 	or	r2,r2,r4
  122954:	10800044 	addi	r2,r2,1
  122958:	01002004 	movi	r4,128
  12295c:	2085d83a 	sra	r2,r4,r2
  122960:	1884b03a 	or	r2,r3,r2
  122964:	1025883a 	mov	r18,r2
  122968:	04c004b4 	movhi	r19,18
  12296c:	9cd41304 	addi	r19,r19,20556
  122970:	8809883a 	mov	r4,r17
  122974:	014003c4 	movi	r5,15
  122978:	0122d480 	call	122d48 <__mulsi3>
  12297c:	1405883a 	add	r2,r2,r16
  122980:	9885883a 	add	r2,r19,r2
  122984:	14800005 	stb	r18,0(r2)

	/* check if on a grid line */
	/* go through all the horizontal lines */
	for (j = -Y_TICK_CNT; j <= Y_TICK_CNT; j++)  {
  122988:	00bfffc4 	movi	r2,-1
  12298c:	e0bffd15 	stw	r2,-12(fp)
  122990:	00003a06 	br	122a7c <plot_trace+0x334>

	    /* get y position of the line */
	    p = X_AXIS_POS + j * Y_TICK_SIZE;
  122994:	e13ffd17 	ldw	r4,-12(fp)
  122998:	01400c04 	movi	r5,48
  12299c:	0122d480 	call	122d48 <__mulsi3>
  1229a0:	10801004 	addi	r2,r2,64
  1229a4:	e0bffb15 	stw	r2,-20(fp)
	    /* make sure it is in range */
	    if (p >= PLOT_SIZE_Y)
  1229a8:	e0bffb17 	ldw	r2,-20(fp)
  1229ac:	10802010 	cmplti	r2,r2,128
  1229b0:	1000021e 	bne	r2,zero,1229bc <plot_trace+0x274>
	        p = PLOT_SIZE_Y - 1;
  1229b4:	00801fc4 	movi	r2,127
  1229b8:	e0bffb15 	stw	r2,-20(fp)
	    if (p < 0)
  1229bc:	e0bffb17 	ldw	r2,-20(fp)
  1229c0:	1000010e 	bge	r2,zero,1229c8 <plot_trace+0x280>
	        p = 0;
  1229c4:	e03ffb15 	stw	zero,-20(fp)

	    /* if the point is on this line, save it */
	    if (y == p)
  1229c8:	e0fffe17 	ldw	r3,-8(fp)
  1229cc:	e0bffb17 	ldw	r2,-20(fp)
  1229d0:	1880271e 	bne	r3,r2,122a70 <plot_trace+0x328>
		saved_axis_x[j + Y_TICK_CNT][x / 8] |= (0x80 >> (x % 8));
  1229d4:	e0bffd17 	ldw	r2,-12(fp)
  1229d8:	14400044 	addi	r17,r2,1
  1229dc:	e0bff917 	ldw	r2,-28(fp)
  1229e0:	1000010e 	bge	r2,zero,1229e8 <plot_trace+0x2a0>
  1229e4:	108001c4 	addi	r2,r2,7
  1229e8:	1005d0fa 	srai	r2,r2,3
  1229ec:	1021883a 	mov	r16,r2
  1229f0:	e0bffd17 	ldw	r2,-12(fp)
  1229f4:	10800044 	addi	r2,r2,1
  1229f8:	048004b4 	movhi	r18,18
  1229fc:	9493e604 	addi	r18,r18,20376
  122a00:	1009883a 	mov	r4,r2
  122a04:	01400f04 	movi	r5,60
  122a08:	0122d480 	call	122d48 <__mulsi3>
  122a0c:	1405883a 	add	r2,r2,r16
  122a10:	9085883a 	add	r2,r18,r2
  122a14:	10800003 	ldbu	r2,0(r2)
  122a18:	1007883a 	mov	r3,r2
  122a1c:	e13ff917 	ldw	r4,-28(fp)
  122a20:	00a00034 	movhi	r2,32768
  122a24:	108001c4 	addi	r2,r2,7
  122a28:	2084703a 	and	r2,r4,r2
  122a2c:	1000040e 	bge	r2,zero,122a40 <plot_trace+0x2f8>
  122a30:	10bfffc4 	addi	r2,r2,-1
  122a34:	013ffe04 	movi	r4,-8
  122a38:	1104b03a 	or	r2,r2,r4
  122a3c:	10800044 	addi	r2,r2,1
  122a40:	01002004 	movi	r4,128
  122a44:	2085d83a 	sra	r2,r4,r2
  122a48:	1884b03a 	or	r2,r3,r2
  122a4c:	1025883a 	mov	r18,r2
  122a50:	04c004b4 	movhi	r19,18
  122a54:	9cd3e604 	addi	r19,r19,20376
  122a58:	8809883a 	mov	r4,r17
  122a5c:	01400f04 	movi	r5,60
  122a60:	0122d480 	call	122d48 <__mulsi3>
  122a64:	1405883a 	add	r2,r2,r16
  122a68:	9885883a 	add	r2,r19,r2
  122a6c:	14800005 	stb	r18,0(r2)
	    /* point is in the save area - save it */
	    saved_area[y - saved_pos_y][(x - saved_pos_x)/8] |= (0x80 >> ((x - saved_pos_x) % 8));

	/* check if on a grid line */
	/* go through all the horizontal lines */
	for (j = -Y_TICK_CNT; j <= Y_TICK_CNT; j++)  {
  122a70:	e0bffd17 	ldw	r2,-12(fp)
  122a74:	10800044 	addi	r2,r2,1
  122a78:	e0bffd15 	stw	r2,-12(fp)
  122a7c:	e0bffd17 	ldw	r2,-12(fp)
  122a80:	10800090 	cmplti	r2,r2,2
  122a84:	103fc31e 	bne	r2,zero,122994 <plot_trace+0x24c>
	    if (y == p)
		saved_axis_x[j + Y_TICK_CNT][x / 8] |= (0x80 >> (x % 8));
	}

	/* go through all the vertical lines */
	for (j = -X_TICK_CNT; j <= X_TICK_CNT; j++)  {
  122a88:	00bffec4 	movi	r2,-5
  122a8c:	e0bffd15 	stw	r2,-12(fp)
  122a90:	00003606 	br	122b6c <plot_trace+0x424>

	    /* get x position of the line */
	    p = Y_AXIS_POS + j * X_TICK_SIZE;
  122a94:	e13ffd17 	ldw	r4,-12(fp)
  122a98:	01400c04 	movi	r5,48
  122a9c:	0122d480 	call	122d48 <__mulsi3>
  122aa0:	10803c04 	addi	r2,r2,240
  122aa4:	e0bffb15 	stw	r2,-20(fp)
	    /* make sure it is in range */
	    if (p >= PLOT_SIZE_X)
  122aa8:	e0bffb17 	ldw	r2,-20(fp)
  122aac:	10807810 	cmplti	r2,r2,480
  122ab0:	1000021e 	bne	r2,zero,122abc <plot_trace+0x374>
	        p = PLOT_SIZE_X - 1;
  122ab4:	008077c4 	movi	r2,479
  122ab8:	e0bffb15 	stw	r2,-20(fp)
	    if (p < 0)
  122abc:	e0bffb17 	ldw	r2,-20(fp)
  122ac0:	1000010e 	bge	r2,zero,122ac8 <plot_trace+0x380>
	        p = 0;
  122ac4:	e03ffb15 	stw	zero,-20(fp)

	    /* if the point is on this line, save it */
	    if (x == p)
  122ac8:	e0fff917 	ldw	r3,-28(fp)
  122acc:	e0bffb17 	ldw	r2,-20(fp)
  122ad0:	1880231e 	bne	r3,r2,122b60 <plot_trace+0x418>
		saved_axis_y[j + X_TICK_CNT][y / 8] |= (0x80 >> (y % 8));
  122ad4:	e0bffd17 	ldw	r2,-12(fp)
  122ad8:	11800144 	addi	r6,r2,5
  122adc:	e0bffe17 	ldw	r2,-8(fp)
  122ae0:	1000010e 	bge	r2,zero,122ae8 <plot_trace+0x3a0>
  122ae4:	108001c4 	addi	r2,r2,7
  122ae8:	1005d0fa 	srai	r2,r2,3
  122aec:	1007883a 	mov	r3,r2
  122af0:	e0bffd17 	ldw	r2,-12(fp)
  122af4:	10800144 	addi	r2,r2,5
  122af8:	010004b4 	movhi	r4,18
  122afc:	2113ba04 	addi	r4,r4,20200
  122b00:	1004913a 	slli	r2,r2,4
  122b04:	10c5883a 	add	r2,r2,r3
  122b08:	2085883a 	add	r2,r4,r2
  122b0c:	10800003 	ldbu	r2,0(r2)
  122b10:	1009883a 	mov	r4,r2
  122b14:	e17ffe17 	ldw	r5,-8(fp)
  122b18:	00a00034 	movhi	r2,32768
  122b1c:	108001c4 	addi	r2,r2,7
  122b20:	2884703a 	and	r2,r5,r2
  122b24:	1000040e 	bge	r2,zero,122b38 <plot_trace+0x3f0>
  122b28:	10bfffc4 	addi	r2,r2,-1
  122b2c:	017ffe04 	movi	r5,-8
  122b30:	1144b03a 	or	r2,r2,r5
  122b34:	10800044 	addi	r2,r2,1
  122b38:	01402004 	movi	r5,128
  122b3c:	2885d83a 	sra	r2,r5,r2
  122b40:	2084b03a 	or	r2,r4,r2
  122b44:	1009883a 	mov	r4,r2
  122b48:	014004b4 	movhi	r5,18
  122b4c:	2953ba04 	addi	r5,r5,20200
  122b50:	3004913a 	slli	r2,r6,4
  122b54:	10c5883a 	add	r2,r2,r3
  122b58:	2885883a 	add	r2,r5,r2
  122b5c:	11000005 	stb	r4,0(r2)
	    if (y == p)
		saved_axis_x[j + Y_TICK_CNT][x / 8] |= (0x80 >> (x % 8));
	}

	/* go through all the vertical lines */
	for (j = -X_TICK_CNT; j <= X_TICK_CNT; j++)  {
  122b60:	e0bffd17 	ldw	r2,-12(fp)
  122b64:	10800044 	addi	r2,r2,1
  122b68:	e0bffd15 	stw	r2,-12(fp)
  122b6c:	e0bffd17 	ldw	r2,-12(fp)
  122b70:	10800190 	cmplti	r2,r2,6
  122b74:	103fc71e 	bne	r2,zero,122a94 <plot_trace+0x34c>
		saved_axis_y[j + X_TICK_CNT][y / 8] |= (0x80 >> (y % 8));
	}


	/* update x position */
	x_pos += PLOT_SIZE_X;
  122b78:	e0bffa17 	ldw	r2,-24(fp)
  122b7c:	10807804 	addi	r2,r2,480
  122b80:	e0bffa15 	stw	r2,-24(fp)
	/* check if at next horizontal position */
	if (x_pos >= sample_size)  {
  122b84:	d0a18617 	ldw	r2,-31208(gp)
  122b88:	e0fffa17 	ldw	r3,-24(fp)
  122b8c:	18800716 	blt	r3,r2,122bac <plot_trace+0x464>
	    /* at next position - update positions */
	    x++;
  122b90:	e0bff917 	ldw	r2,-28(fp)
  122b94:	10800044 	addi	r2,r2,1
  122b98:	e0bff915 	stw	r2,-28(fp)
	    x_pos -= sample_size;
  122b9c:	d0a18617 	ldw	r2,-31208(gp)
  122ba0:	e0fffa17 	ldw	r3,-24(fp)
  122ba4:	1885c83a 	sub	r2,r3,r2
  122ba8:	e0bffa15 	stw	r2,-24(fp)
    /* re-display the menu (if it was on) */
    refresh_menu();


    /* plot the sample */
    for (i = 0; i < sample_size; i++)  {
  122bac:	e0bffc17 	ldw	r2,-16(fp)
  122bb0:	10800044 	addi	r2,r2,1
  122bb4:	e0bffc15 	stw	r2,-16(fp)
  122bb8:	d0a18617 	ldw	r2,-31208(gp)
  122bbc:	e0fffc17 	ldw	r3,-16(fp)
  122bc0:	18bef216 	blt	r3,r2,12278c <plot_trace+0x44>
	}
    }


    /* finally, output the scale if need be */
    set_display_scale(cur_scale);
  122bc4:	d0a18217 	ldw	r2,-31224(gp)
  122bc8:	1009883a 	mov	r4,r2
  122bcc:	0121e340 	call	121e34 <set_display_scale>


    /* done with plot, return */
    return;
  122bd0:	0001883a 	nop

}
  122bd4:	e037883a 	mov	sp,fp
  122bd8:	dfc00517 	ldw	ra,20(sp)
  122bdc:	df000417 	ldw	fp,16(sp)
  122be0:	dcc00317 	ldw	r19,12(sp)
  122be4:	dc800217 	ldw	r18,8(sp)
  122be8:	dc400117 	ldw	r17,4(sp)
  122bec:	dc000017 	ldw	r16,0(sp)
  122bf0:	dec00604 	addi	sp,sp,24
  122bf4:	f800283a 	ret

00122bf8 <TestVRAM>:

.global TestVRAM
.type TestVRAM,@function

TestVRAM:
	movhi	r8, %hi(VRAM_OFFSET)
  122bf8:	02000234 	movhi	r8,8
	ori		r8, r8, %lo(VRAM_OFFSET)
  122bfc:	42000234 	orhi	r8,r8,8
	mov		r9, r0
  122c00:	0013883a 	mov	r9,zero
	sthio	r9, (r8)
  122c04:	4240002d 	sthio	r9,0(r8)
	addi	r8, r8, 2
  122c08:	42000084 	addi	r8,r8,2
	addi	r9, r9, 1
  122c0c:	4a400044 	addi	r9,r9,1
	jmpi	TestVRAM
  122c10:	0122bf81 	jmpi	122bf8 <TestVRAM>

00122c14 <TestVRAMdone>:

TestVRAMdone:
	ret
  122c14:	f800283a 	ret

00122c18 <udivmodsi4>:
  122c18:	2005883a 	mov	r2,r4
  122c1c:	2900182e 	bgeu	r5,r4,122c80 <udivmodsi4+0x68>
  122c20:	28001716 	blt	r5,zero,122c80 <udivmodsi4+0x68>
  122c24:	01000804 	movi	r4,32
  122c28:	00c00044 	movi	r3,1
  122c2c:	00000206 	br	122c38 <udivmodsi4+0x20>
  122c30:	20001126 	beq	r4,zero,122c78 <udivmodsi4+0x60>
  122c34:	28000516 	blt	r5,zero,122c4c <udivmodsi4+0x34>
  122c38:	294b883a 	add	r5,r5,r5
  122c3c:	213fffc4 	addi	r4,r4,-1
  122c40:	18c7883a 	add	r3,r3,r3
  122c44:	28bffa36 	bltu	r5,r2,122c30 <udivmodsi4+0x18>
  122c48:	18000b26 	beq	r3,zero,122c78 <udivmodsi4+0x60>
  122c4c:	0009883a 	mov	r4,zero
  122c50:	11400236 	bltu	r2,r5,122c5c <udivmodsi4+0x44>
  122c54:	1145c83a 	sub	r2,r2,r5
  122c58:	20c8b03a 	or	r4,r4,r3
  122c5c:	1806d07a 	srli	r3,r3,1
  122c60:	280ad07a 	srli	r5,r5,1
  122c64:	183ffa1e 	bne	r3,zero,122c50 <udivmodsi4+0x38>
  122c68:	3000021e 	bne	r6,zero,122c74 <udivmodsi4+0x5c>
  122c6c:	2005883a 	mov	r2,r4
  122c70:	f800283a 	ret
  122c74:	f800283a 	ret
  122c78:	0009883a 	mov	r4,zero
  122c7c:	003ffa06 	br	122c68 <udivmodsi4+0x50>
  122c80:	00c00044 	movi	r3,1
  122c84:	0009883a 	mov	r4,zero
  122c88:	003ff106 	br	122c50 <udivmodsi4+0x38>

00122c8c <__divsi3>:
  122c8c:	defffe04 	addi	sp,sp,-8
  122c90:	dfc00115 	stw	ra,4(sp)
  122c94:	dc000015 	stw	r16,0(sp)
  122c98:	20000a16 	blt	r4,zero,122cc4 <__divsi3+0x38>
  122c9c:	0021883a 	mov	r16,zero
  122ca0:	28000b16 	blt	r5,zero,122cd0 <__divsi3+0x44>
  122ca4:	000d883a 	mov	r6,zero
  122ca8:	0122c180 	call	122c18 <udivmodsi4>
  122cac:	80000126 	beq	r16,zero,122cb4 <__divsi3+0x28>
  122cb0:	0085c83a 	sub	r2,zero,r2
  122cb4:	dfc00117 	ldw	ra,4(sp)
  122cb8:	dc000017 	ldw	r16,0(sp)
  122cbc:	dec00204 	addi	sp,sp,8
  122cc0:	f800283a 	ret
  122cc4:	0109c83a 	sub	r4,zero,r4
  122cc8:	04000044 	movi	r16,1
  122ccc:	283ff50e 	bge	r5,zero,122ca4 <__divsi3+0x18>
  122cd0:	014bc83a 	sub	r5,zero,r5
  122cd4:	8400005c 	xori	r16,r16,1
  122cd8:	003ff206 	br	122ca4 <__divsi3+0x18>

00122cdc <__modsi3>:
  122cdc:	deffff04 	addi	sp,sp,-4
  122ce0:	dfc00015 	stw	ra,0(sp)
  122ce4:	20000516 	blt	r4,zero,122cfc <__modsi3+0x20>
  122ce8:	28000c16 	blt	r5,zero,122d1c <__modsi3+0x40>
  122cec:	01800044 	movi	r6,1
  122cf0:	dfc00017 	ldw	ra,0(sp)
  122cf4:	dec00104 	addi	sp,sp,4
  122cf8:	0122c181 	jmpi	122c18 <udivmodsi4>
  122cfc:	0109c83a 	sub	r4,zero,r4
  122d00:	28000b16 	blt	r5,zero,122d30 <__modsi3+0x54>
  122d04:	01800044 	movi	r6,1
  122d08:	0122c180 	call	122c18 <udivmodsi4>
  122d0c:	0085c83a 	sub	r2,zero,r2
  122d10:	dfc00017 	ldw	ra,0(sp)
  122d14:	dec00104 	addi	sp,sp,4
  122d18:	f800283a 	ret
  122d1c:	014bc83a 	sub	r5,zero,r5
  122d20:	01800044 	movi	r6,1
  122d24:	dfc00017 	ldw	ra,0(sp)
  122d28:	dec00104 	addi	sp,sp,4
  122d2c:	0122c181 	jmpi	122c18 <udivmodsi4>
  122d30:	014bc83a 	sub	r5,zero,r5
  122d34:	003ff306 	br	122d04 <__modsi3+0x28>

00122d38 <__udivsi3>:
  122d38:	000d883a 	mov	r6,zero
  122d3c:	0122c181 	jmpi	122c18 <udivmodsi4>

00122d40 <__umodsi3>:
  122d40:	01800044 	movi	r6,1
  122d44:	0122c181 	jmpi	122c18 <udivmodsi4>

00122d48 <__mulsi3>:
  122d48:	0005883a 	mov	r2,zero
  122d4c:	20000726 	beq	r4,zero,122d6c <__mulsi3+0x24>
  122d50:	20c0004c 	andi	r3,r4,1
  122d54:	2008d07a 	srli	r4,r4,1
  122d58:	18000126 	beq	r3,zero,122d60 <__mulsi3+0x18>
  122d5c:	1145883a 	add	r2,r2,r5
  122d60:	294b883a 	add	r5,r5,r5
  122d64:	203ffa1e 	bne	r4,zero,122d50 <__mulsi3+0x8>
  122d68:	f800283a 	ret
  122d6c:	f800283a 	ret

00122d70 <memcpy>:
  122d70:	defffb04 	addi	sp,sp,-20
  122d74:	dc000015 	stw	r16,0(sp)
  122d78:	dfc00415 	stw	ra,16(sp)
  122d7c:	dcc00315 	stw	r19,12(sp)
  122d80:	dc800215 	stw	r18,8(sp)
  122d84:	dc400115 	stw	r17,4(sp)
  122d88:	00c003c4 	movi	r3,15
  122d8c:	2021883a 	mov	r16,r4
  122d90:	3005883a 	mov	r2,r6
  122d94:	1980032e 	bgeu	r3,r6,122da4 <memcpy+0x34>
  122d98:	2906b03a 	or	r3,r5,r4
  122d9c:	18c000cc 	andi	r3,r3,3
  122da0:	18001026 	beq	r3,zero,122de4 <memcpy+0x74>
  122da4:	8007883a 	mov	r3,r16
  122da8:	288f883a 	add	r7,r5,r2
  122dac:	10000526 	beq	r2,zero,122dc4 <memcpy+0x54>
  122db0:	29800003 	ldbu	r6,0(r5)
  122db4:	18c00044 	addi	r3,r3,1
  122db8:	29400044 	addi	r5,r5,1
  122dbc:	19bfffc5 	stb	r6,-1(r3)
  122dc0:	29fffb1e 	bne	r5,r7,122db0 <memcpy+0x40>
  122dc4:	8005883a 	mov	r2,r16
  122dc8:	dfc00417 	ldw	ra,16(sp)
  122dcc:	dcc00317 	ldw	r19,12(sp)
  122dd0:	dc800217 	ldw	r18,8(sp)
  122dd4:	dc400117 	ldw	r17,4(sp)
  122dd8:	dc000017 	ldw	r16,0(sp)
  122ddc:	dec00504 	addi	sp,sp,20
  122de0:	f800283a 	ret
  122de4:	32bffc04 	addi	r10,r6,-16
  122de8:	5014d13a 	srli	r10,r10,4
  122dec:	20800404 	addi	r2,r4,16
  122df0:	2007883a 	mov	r3,r4
  122df4:	5008913a 	slli	r4,r10,4
  122df8:	280f883a 	mov	r7,r5
  122dfc:	1105883a 	add	r2,r2,r4
  122e00:	3a000017 	ldw	r8,0(r7)
  122e04:	18c00404 	addi	r3,r3,16
  122e08:	39c00404 	addi	r7,r7,16
  122e0c:	1a3ffc15 	stw	r8,-16(r3)
  122e10:	3a3ffd17 	ldw	r8,-12(r7)
  122e14:	1a3ffd15 	stw	r8,-12(r3)
  122e18:	3a3ffe17 	ldw	r8,-8(r7)
  122e1c:	1a3ffe15 	stw	r8,-8(r3)
  122e20:	3a3fff17 	ldw	r8,-4(r7)
  122e24:	1a3fff15 	stw	r8,-4(r3)
  122e28:	18bff51e 	bne	r3,r2,122e00 <memcpy+0x90>
  122e2c:	52800044 	addi	r10,r10,1
  122e30:	5014913a 	slli	r10,r10,4
  122e34:	308003cc 	andi	r2,r6,15
  122e38:	010000c4 	movi	r4,3
  122e3c:	8287883a 	add	r3,r16,r10
  122e40:	2a95883a 	add	r10,r5,r10
  122e44:	2080182e 	bgeu	r4,r2,122ea8 <memcpy+0x138>
  122e48:	147fff04 	addi	r17,r2,-4
  122e4c:	8808d0ba 	srli	r4,r17,2
  122e50:	1a400104 	addi	r9,r3,4
  122e54:	180d883a 	mov	r6,r3
  122e58:	2105883a 	add	r2,r4,r4
  122e5c:	1085883a 	add	r2,r2,r2
  122e60:	4893883a 	add	r9,r9,r2
  122e64:	500f883a 	mov	r7,r10
  122e68:	3a000017 	ldw	r8,0(r7)
  122e6c:	31800104 	addi	r6,r6,4
  122e70:	39c00104 	addi	r7,r7,4
  122e74:	323fff15 	stw	r8,-4(r6)
  122e78:	327ffb1e 	bne	r6,r9,122e68 <memcpy+0xf8>
  122e7c:	20800044 	addi	r2,r4,1
  122e80:	1085883a 	add	r2,r2,r2
  122e84:	1085883a 	add	r2,r2,r2
  122e88:	017fff04 	movi	r5,-4
  122e8c:	18a5883a 	add	r18,r3,r2
  122e90:	50a7883a 	add	r19,r10,r2
  122e94:	0122d480 	call	122d48 <__mulsi3>
  122e98:	1445883a 	add	r2,r2,r17
  122e9c:	980b883a 	mov	r5,r19
  122ea0:	9007883a 	mov	r3,r18
  122ea4:	003fc006 	br	122da8 <memcpy+0x38>
  122ea8:	500b883a 	mov	r5,r10
  122eac:	003fbe06 	br	122da8 <memcpy+0x38>

00122eb0 <alt_load_section>:
 */

static void ALT_INLINE alt_load_section (alt_u32* from, 
                                         alt_u32* to, 
                                         alt_u32* end)
{
  122eb0:	defffc04 	addi	sp,sp,-16
  122eb4:	df000315 	stw	fp,12(sp)
  122eb8:	df000304 	addi	fp,sp,12
  122ebc:	e13ffd15 	stw	r4,-12(fp)
  122ec0:	e17ffe15 	stw	r5,-8(fp)
  122ec4:	e1bfff15 	stw	r6,-4(fp)
  if (to != from)
  122ec8:	e0fffe17 	ldw	r3,-8(fp)
  122ecc:	e0bffd17 	ldw	r2,-12(fp)
  122ed0:	18800e26 	beq	r3,r2,122f0c <alt_load_section+0x5c>
  {
    while( to != end )
  122ed4:	00000a06 	br	122f00 <alt_load_section+0x50>
    {
      *to++ = *from++;
  122ed8:	e0bffd17 	ldw	r2,-12(fp)
  122edc:	10c00017 	ldw	r3,0(r2)
  122ee0:	e0bffe17 	ldw	r2,-8(fp)
  122ee4:	10c00015 	stw	r3,0(r2)
  122ee8:	e0bffe17 	ldw	r2,-8(fp)
  122eec:	10800104 	addi	r2,r2,4
  122ef0:	e0bffe15 	stw	r2,-8(fp)
  122ef4:	e0bffd17 	ldw	r2,-12(fp)
  122ef8:	10800104 	addi	r2,r2,4
  122efc:	e0bffd15 	stw	r2,-12(fp)
                                         alt_u32* to, 
                                         alt_u32* end)
{
  if (to != from)
  {
    while( to != end )
  122f00:	e0fffe17 	ldw	r3,-8(fp)
  122f04:	e0bfff17 	ldw	r2,-4(fp)
  122f08:	18bff31e 	bne	r3,r2,122ed8 <alt_load_section+0x28>
    {
      *to++ = *from++;
    }
  }
}
  122f0c:	e037883a 	mov	sp,fp
  122f10:	df000017 	ldw	fp,0(sp)
  122f14:	dec00104 	addi	sp,sp,4
  122f18:	f800283a 	ret

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

void alt_load (void)
{
  122f1c:	defffe04 	addi	sp,sp,-8
  122f20:	dfc00115 	stw	ra,4(sp)
  122f24:	df000015 	stw	fp,0(sp)
  122f28:	d839883a 	mov	fp,sp
  /* 
   * Copy the .rwdata section. 
   */

  alt_load_section (&__flash_rwdata_start, 
  122f2c:	010004b4 	movhi	r4,18
  122f30:	21118c04 	addi	r4,r4,17968
  122f34:	014004b4 	movhi	r5,18
  122f38:	29501a04 	addi	r5,r5,16488
  122f3c:	018004b4 	movhi	r6,18
  122f40:	31918c04 	addi	r6,r6,17968
  122f44:	0122eb00 	call	122eb0 <alt_load_section>

  /*
   * Copy the exception handler.
   */

  alt_load_section (&__flash_exceptions_start, 
  122f48:	010004b4 	movhi	r4,18
  122f4c:	21000004 	addi	r4,r4,0
  122f50:	01400574 	movhi	r5,21
  122f54:	29600804 	addi	r5,r5,-32736
  122f58:	01800574 	movhi	r6,21
  122f5c:	31a00804 	addi	r6,r6,-32736
  122f60:	0122eb00 	call	122eb0 <alt_load_section>

  /*
   * Copy the .rodata section.
   */

  alt_load_section (&__flash_rodata_start, 
  122f64:	010004b4 	movhi	r4,18
  122f68:	210d9f04 	addi	r4,r4,13948
  122f6c:	014004b4 	movhi	r5,18
  122f70:	294d9f04 	addi	r5,r5,13948
  122f74:	018004b4 	movhi	r6,18
  122f78:	31901a04 	addi	r6,r6,16488
  122f7c:	0122eb00 	call	122eb0 <alt_load_section>
  
  /*
   * Now ensure that the caches are in synch.
   */
  
  alt_dcache_flush_all();
  122f80:	01231680 	call	123168 <alt_dcache_flush_all>
  alt_icache_flush_all();
  122f84:	01232680 	call	123268 <alt_icache_flush_all>
}
  122f88:	e037883a 	mov	sp,fp
  122f8c:	dfc00117 	ldw	ra,4(sp)
  122f90:	df000017 	ldw	fp,0(sp)
  122f94:	dec00204 	addi	sp,sp,8
  122f98:	f800283a 	ret

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

void alt_main (void)
{
  122f9c:	defffd04 	addi	sp,sp,-12
  122fa0:	dfc00215 	stw	ra,8(sp)
  122fa4:	df000115 	stw	fp,4(sp)
  122fa8:	df000104 	addi	fp,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);
  122fac:	0009883a 	mov	r4,zero
  122fb0:	0122ff80 	call	122ff8 <alt_irq_init>

  /* Initialize the operating system */
  ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n");
  ALT_OS_INIT();
  122fb4:	0001883a 	nop
  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();
  122fb8:	012302c0 	call	12302c <alt_sys_init>
  /* 
   * Call the C++ constructors 
   */

  ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n");
  _do_ctors ();
  122fbc:	01231b00 	call	1231b0 <_do_ctors>
   * redefined as _exit()). This is in the interest of reducing code footprint,
   * in that the atexit() overhead is removed when it's not needed.
   */

  ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n");
  atexit (_do_dtors);
  122fc0:	010004b4 	movhi	r4,18
  122fc4:	210c8304 	addi	r4,r4,12812
  122fc8:	01233240 	call	123324 <atexit>
  ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n");

#ifdef ALT_NO_EXIT
  main (alt_argc, alt_argv, alt_envp);
#else
  result = main (alt_argc, alt_argv, alt_envp);
  122fcc:	d1218a17 	ldw	r4,-31192(gp)
  122fd0:	d0e18b17 	ldw	r3,-31188(gp)
  122fd4:	d0a18c17 	ldw	r2,-31184(gp)
  122fd8:	180b883a 	mov	r5,r3
  122fdc:	100d883a 	mov	r6,r2
  122fe0:	01205800 	call	120580 <main>
  122fe4:	e0bfff15 	stw	r2,-4(fp)
  close(STDOUT_FILENO);
  122fe8:	01000044 	movi	r4,1
  122fec:	012309c0 	call	12309c <close>
  exit (result);
  122ff0:	e13fff17 	ldw	r4,-4(fp)
  122ff4:	01233380 	call	123338 <exit>

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

void alt_irq_init ( const void* base )
{
  122ff8:	defffd04 	addi	sp,sp,-12
  122ffc:	dfc00215 	stw	ra,8(sp)
  123000:	df000115 	stw	fp,4(sp)
  123004:	df000104 	addi	fp,sp,4
  123008:	e13fff15 	stw	r4,-4(fp)
    ALTERA_NIOS2_QSYS_IRQ_INIT ( PROC, PROC);
  12300c:	01233040 	call	123304 <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
  123010:	00800044 	movi	r2,1
  123014:	1001703a 	wrctl	status,r2
    alt_irq_cpu_enable_interrupts();
}
  123018:	e037883a 	mov	sp,fp
  12301c:	dfc00117 	ldw	ra,4(sp)
  123020:	df000017 	ldw	fp,0(sp)
  123024:	dec00204 	addi	sp,sp,8
  123028:	f800283a 	ret

0012302c <alt_sys_init>:
 * Initialize the non-interrupt controller devices.
 * Called after alt_irq_init().
 */

void alt_sys_init( void )
{
  12302c:	deffff04 	addi	sp,sp,-4
  123030:	df000015 	stw	fp,0(sp)
  123034:	d839883a 	mov	fp,sp
    ALTERA_AVALON_SYSID_QSYS_INIT ( SYSID_QSYS_0, sysid_qsys_0);
  123038:	0001883a 	nop
}
  12303c:	e037883a 	mov	sp,fp
  123040:	df000017 	ldw	fp,0(sp)
  123044:	dec00104 	addi	sp,sp,4
  123048:	f800283a 	ret

0012304c <alt_get_errno>:
#undef errno

extern int errno;

static ALT_INLINE int* alt_get_errno(void)
{
  12304c:	defffe04 	addi	sp,sp,-8
  123050:	dfc00115 	stw	ra,4(sp)
  123054:	df000015 	stw	fp,0(sp)
  123058:	d839883a 	mov	fp,sp
  return ((alt_errno) ? alt_errno() : &errno);
  12305c:	008004b4 	movhi	r2,18
  123060:	10918904 	addi	r2,r2,17956
  123064:	10800017 	ldw	r2,0(r2)
  123068:	10000526 	beq	r2,zero,123080 <alt_get_errno+0x34>
  12306c:	008004b4 	movhi	r2,18
  123070:	10918904 	addi	r2,r2,17956
  123074:	10800017 	ldw	r2,0(r2)
  123078:	103ee83a 	callr	r2
  12307c:	00000206 	br	123088 <alt_get_errno+0x3c>
  123080:	008004b4 	movhi	r2,18
  123084:	10931104 	addi	r2,r2,19524
}
  123088:	e037883a 	mov	sp,fp
  12308c:	dfc00117 	ldw	ra,4(sp)
  123090:	df000017 	ldw	fp,0(sp)
  123094:	dec00204 	addi	sp,sp,8
  123098:	f800283a 	ret

0012309c <close>:
 *
 * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h
 */
 
int ALT_CLOSE (int fildes)
{
  12309c:	defffb04 	addi	sp,sp,-20
  1230a0:	dfc00415 	stw	ra,16(sp)
  1230a4:	df000315 	stw	fp,12(sp)
  1230a8:	df000304 	addi	fp,sp,12
  1230ac:	e13fff15 	stw	r4,-4(fp)
   * A common error case is that when the file descriptor was created, the call
   * to open() failed resulting in a negative file descriptor. This is trapped
   * below so that we don't try and process an invalid file descriptor.
   */

  fd = (fildes < 0) ? NULL : &alt_fd_list[fildes];
  1230b0:	e0bfff17 	ldw	r2,-4(fp)
  1230b4:	10000716 	blt	r2,zero,1230d4 <close+0x38>
  1230b8:	e13fff17 	ldw	r4,-4(fp)
  1230bc:	01400304 	movi	r5,12
  1230c0:	0122d480 	call	122d48 <__mulsi3>
  1230c4:	00c004b4 	movhi	r3,18
  1230c8:	18d02404 	addi	r3,r3,16528
  1230cc:	10c5883a 	add	r2,r2,r3
  1230d0:	00000106 	br	1230d8 <close+0x3c>
  1230d4:	0005883a 	mov	r2,zero
  1230d8:	e0bffd15 	stw	r2,-12(fp)

  if (fd)
  1230dc:	e0bffd17 	ldw	r2,-12(fp)
  1230e0:	10001826 	beq	r2,zero,123144 <close+0xa8>
    /*
     * If the associated file system/device has a close function, call it so 
     * that any necessary cleanup code can run.
     */

    rval = (fd->dev->close) ? fd->dev->close(fd) : 0;
  1230e4:	e0bffd17 	ldw	r2,-12(fp)
  1230e8:	10800017 	ldw	r2,0(r2)
  1230ec:	10800417 	ldw	r2,16(r2)
  1230f0:	10000626 	beq	r2,zero,12310c <close+0x70>
  1230f4:	e0bffd17 	ldw	r2,-12(fp)
  1230f8:	10800017 	ldw	r2,0(r2)
  1230fc:	10800417 	ldw	r2,16(r2)
  123100:	e13ffd17 	ldw	r4,-12(fp)
  123104:	103ee83a 	callr	r2
  123108:	00000106 	br	123110 <close+0x74>
  12310c:	0005883a 	mov	r2,zero
  123110:	e0bffe15 	stw	r2,-8(fp)

    /* Free the file descriptor structure and return. */

    alt_release_fd (fildes);
  123114:	e13fff17 	ldw	r4,-4(fp)
  123118:	01232840 	call	123284 <alt_release_fd>
    if (rval < 0)
  12311c:	e0bffe17 	ldw	r2,-8(fp)
  123120:	1000060e 	bge	r2,zero,12313c <close+0xa0>
    {
      ALT_ERRNO = -rval;
  123124:	012304c0 	call	12304c <alt_get_errno>
  123128:	e0fffe17 	ldw	r3,-8(fp)
  12312c:	00c7c83a 	sub	r3,zero,r3
  123130:	10c00015 	stw	r3,0(r2)
      return -1;
  123134:	00bfffc4 	movi	r2,-1
  123138:	00000606 	br	123154 <close+0xb8>
    }
    return 0;
  12313c:	0005883a 	mov	r2,zero
  123140:	00000406 	br	123154 <close+0xb8>
  }
  else
  {
    ALT_ERRNO = EBADFD;
  123144:	012304c0 	call	12304c <alt_get_errno>
  123148:	00c01444 	movi	r3,81
  12314c:	10c00015 	stw	r3,0(r2)
    return -1;
  123150:	00bfffc4 	movi	r2,-1
  }
}
  123154:	e037883a 	mov	sp,fp
  123158:	dfc00117 	ldw	ra,4(sp)
  12315c:	df000017 	ldw	fp,0(sp)
  123160:	dec00204 	addi	sp,sp,8
  123164:	f800283a 	ret

00123168 <alt_dcache_flush_all>:
/*
 * alt_dcache_flush_all() is called to flush the entire data cache.
 */

void alt_dcache_flush_all (void)
{
  123168:	deffff04 	addi	sp,sp,-4
  12316c:	df000015 	stw	fp,0(sp)
  123170:	d839883a 	mov	fp,sp
  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 */
}
  123174:	e037883a 	mov	sp,fp
  123178:	df000017 	ldw	fp,0(sp)
  12317c:	dec00104 	addi	sp,sp,4
  123180:	f800283a 	ret

00123184 <alt_dev_null_write>:
 * by the alt_dev_null device. It simple discards all data passed to it, and
 * indicates that the data has been successfully transmitted.
 */

static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len)
{
  123184:	defffc04 	addi	sp,sp,-16
  123188:	df000315 	stw	fp,12(sp)
  12318c:	df000304 	addi	fp,sp,12
  123190:	e13ffd15 	stw	r4,-12(fp)
  123194:	e17ffe15 	stw	r5,-8(fp)
  123198:	e1bfff15 	stw	r6,-4(fp)
  return len;
  12319c:	e0bfff17 	ldw	r2,-4(fp)
}
  1231a0:	e037883a 	mov	sp,fp
  1231a4:	df000017 	ldw	fp,0(sp)
  1231a8:	dec00104 	addi	sp,sp,4
  1231ac:	f800283a 	ret

001231b0 <_do_ctors>:
/*
 * Run the C++ static constructors.
 */

void _do_ctors(void)
{
  1231b0:	defffd04 	addi	sp,sp,-12
  1231b4:	dfc00215 	stw	ra,8(sp)
  1231b8:	df000115 	stw	fp,4(sp)
  1231bc:	df000104 	addi	fp,sp,4
  constructor* ctor;

  for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--)
  1231c0:	008004b4 	movhi	r2,18
  1231c4:	108d9e04 	addi	r2,r2,13944
  1231c8:	e0bfff15 	stw	r2,-4(fp)
  1231cc:	00000606 	br	1231e8 <_do_ctors+0x38>
        (*ctor) (); 
  1231d0:	e0bfff17 	ldw	r2,-4(fp)
  1231d4:	10800017 	ldw	r2,0(r2)
  1231d8:	103ee83a 	callr	r2

void _do_ctors(void)
{
  constructor* ctor;

  for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--)
  1231dc:	e0bfff17 	ldw	r2,-4(fp)
  1231e0:	10bfff04 	addi	r2,r2,-4
  1231e4:	e0bfff15 	stw	r2,-4(fp)
  1231e8:	e0ffff17 	ldw	r3,-4(fp)
  1231ec:	008004b4 	movhi	r2,18
  1231f0:	108d9f04 	addi	r2,r2,13948
  1231f4:	18bff62e 	bgeu	r3,r2,1231d0 <_do_ctors+0x20>
        (*ctor) (); 
}
  1231f8:	e037883a 	mov	sp,fp
  1231fc:	dfc00117 	ldw	ra,4(sp)
  123200:	df000017 	ldw	fp,0(sp)
  123204:	dec00204 	addi	sp,sp,8
  123208:	f800283a 	ret

0012320c <_do_dtors>:
/*
 * Run the C++ static destructors.
 */

void _do_dtors(void)
{
  12320c:	defffd04 	addi	sp,sp,-12
  123210:	dfc00215 	stw	ra,8(sp)
  123214:	df000115 	stw	fp,4(sp)
  123218:	df000104 	addi	fp,sp,4
  destructor* dtor;

  for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--)
  12321c:	008004b4 	movhi	r2,18
  123220:	108d9e04 	addi	r2,r2,13944
  123224:	e0bfff15 	stw	r2,-4(fp)
  123228:	00000606 	br	123244 <_do_dtors+0x38>
        (*dtor) (); 
  12322c:	e0bfff17 	ldw	r2,-4(fp)
  123230:	10800017 	ldw	r2,0(r2)
  123234:	103ee83a 	callr	r2

void _do_dtors(void)
{
  destructor* dtor;

  for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--)
  123238:	e0bfff17 	ldw	r2,-4(fp)
  12323c:	10bfff04 	addi	r2,r2,-4
  123240:	e0bfff15 	stw	r2,-4(fp)
  123244:	e0ffff17 	ldw	r3,-4(fp)
  123248:	008004b4 	movhi	r2,18
  12324c:	108d9f04 	addi	r2,r2,13948
  123250:	18bff62e 	bgeu	r3,r2,12322c <_do_dtors+0x20>
        (*dtor) (); 
}
  123254:	e037883a 	mov	sp,fp
  123258:	dfc00117 	ldw	ra,4(sp)
  12325c:	df000017 	ldw	fp,0(sp)
  123260:	dec00204 	addi	sp,sp,8
  123264:	f800283a 	ret

00123268 <alt_icache_flush_all>:
/*
 * alt_icache_flush_all() is called to flush the entire instruction cache.
 */

void alt_icache_flush_all (void)
{
  123268:	deffff04 	addi	sp,sp,-4
  12326c:	df000015 	stw	fp,0(sp)
  123270:	d839883a 	mov	fp,sp
#if NIOS2_ICACHE_SIZE > 0
  alt_icache_flush (0, NIOS2_ICACHE_SIZE);
#endif
}
  123274:	e037883a 	mov	sp,fp
  123278:	df000017 	ldw	fp,0(sp)
  12327c:	dec00104 	addi	sp,sp,4
  123280:	f800283a 	ret

00123284 <alt_release_fd>:
 * File descriptors correcponding to standard in, standard out and standard 
 * error cannont be released backed to the pool. They are always reserved.
 */

void alt_release_fd (int fd)
{
  123284:	defffc04 	addi	sp,sp,-16
  123288:	dfc00315 	stw	ra,12(sp)
  12328c:	df000215 	stw	fp,8(sp)
  123290:	dc000115 	stw	r16,4(sp)
  123294:	df000104 	addi	fp,sp,4
  123298:	e13fff15 	stw	r4,-4(fp)
  if (fd > 2)
  12329c:	e0bfff17 	ldw	r2,-4(fp)
  1232a0:	108000d0 	cmplti	r2,r2,3
  1232a4:	1000111e 	bne	r2,zero,1232ec <alt_release_fd+0x68>
  {
    alt_fd_list[fd].fd_flags = 0;
  1232a8:	040004b4 	movhi	r16,18
  1232ac:	84102404 	addi	r16,r16,16528
  1232b0:	e0bfff17 	ldw	r2,-4(fp)
  1232b4:	1009883a 	mov	r4,r2
  1232b8:	01400304 	movi	r5,12
  1232bc:	0122d480 	call	122d48 <__mulsi3>
  1232c0:	8085883a 	add	r2,r16,r2
  1232c4:	10800204 	addi	r2,r2,8
  1232c8:	10000015 	stw	zero,0(r2)
    alt_fd_list[fd].dev      = 0;
  1232cc:	040004b4 	movhi	r16,18
  1232d0:	84102404 	addi	r16,r16,16528
  1232d4:	e0bfff17 	ldw	r2,-4(fp)
  1232d8:	1009883a 	mov	r4,r2
  1232dc:	01400304 	movi	r5,12
  1232e0:	0122d480 	call	122d48 <__mulsi3>
  1232e4:	8085883a 	add	r2,r16,r2
  1232e8:	10000015 	stw	zero,0(r2)
  }
}
  1232ec:	e037883a 	mov	sp,fp
  1232f0:	dfc00217 	ldw	ra,8(sp)
  1232f4:	df000117 	ldw	fp,4(sp)
  1232f8:	dc000017 	ldw	r16,0(sp)
  1232fc:	dec00304 	addi	sp,sp,12
  123300:	f800283a 	ret

00123304 <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) 
{
  123304:	deffff04 	addi	sp,sp,-4
  123308:	df000015 	stw	fp,0(sp)
  12330c:	d839883a 	mov	fp,sp
    NIOS2_WRITE_IENABLE(0);
  123310:	000170fa 	wrctl	ienable,zero
}
  123314:	e037883a 	mov	sp,fp
  123318:	df000017 	ldw	fp,0(sp)
  12331c:	dec00104 	addi	sp,sp,4
  123320:	f800283a 	ret

00123324 <atexit>:
  123324:	200b883a 	mov	r5,r4
  123328:	000d883a 	mov	r6,zero
  12332c:	0009883a 	mov	r4,zero
  123330:	000f883a 	mov	r7,zero
  123334:	01233701 	jmpi	123370 <__register_exitproc>

00123338 <exit>:
  123338:	defffe04 	addi	sp,sp,-8
  12333c:	000b883a 	mov	r5,zero
  123340:	dc000015 	stw	r16,0(sp)
  123344:	dfc00115 	stw	ra,4(sp)
  123348:	2021883a 	mov	r16,r4
  12334c:	01234a00 	call	1234a0 <__call_exitprocs>
  123350:	008004b4 	movhi	r2,18
  123354:	10918a04 	addi	r2,r2,17960
  123358:	11000017 	ldw	r4,0(r2)
  12335c:	20800f17 	ldw	r2,60(r4)
  123360:	10000126 	beq	r2,zero,123368 <exit+0x30>
  123364:	103ee83a 	callr	r2
  123368:	8009883a 	mov	r4,r16
  12336c:	01236400 	call	123640 <_exit>

00123370 <__register_exitproc>:
  123370:	defffa04 	addi	sp,sp,-24
  123374:	008004b4 	movhi	r2,18
  123378:	10918a04 	addi	r2,r2,17960
  12337c:	dc000315 	stw	r16,12(sp)
  123380:	14000017 	ldw	r16,0(r2)
  123384:	dc400415 	stw	r17,16(sp)
  123388:	dfc00515 	stw	ra,20(sp)
  12338c:	80805217 	ldw	r2,328(r16)
  123390:	2023883a 	mov	r17,r4
  123394:	10003e26 	beq	r2,zero,123490 <__register_exitproc+0x120>
  123398:	10c00117 	ldw	r3,4(r2)
  12339c:	020007c4 	movi	r8,31
  1233a0:	40c0180e 	bge	r8,r3,123404 <__register_exitproc+0x94>
  1233a4:	00800034 	movhi	r2,0
  1233a8:	10800004 	addi	r2,r2,0
  1233ac:	1000061e 	bne	r2,zero,1233c8 <__register_exitproc+0x58>
  1233b0:	00bfffc4 	movi	r2,-1
  1233b4:	dfc00517 	ldw	ra,20(sp)
  1233b8:	dc400417 	ldw	r17,16(sp)
  1233bc:	dc000317 	ldw	r16,12(sp)
  1233c0:	dec00604 	addi	sp,sp,24
  1233c4:	f800283a 	ret
  1233c8:	01006404 	movi	r4,400
  1233cc:	d9400015 	stw	r5,0(sp)
  1233d0:	d9800115 	stw	r6,4(sp)
  1233d4:	d9c00215 	stw	r7,8(sp)
  1233d8:	00000000 	call	0 <__alt_mem_VRAM_ctrl-0x80000>
  1233dc:	d9400017 	ldw	r5,0(sp)
  1233e0:	d9800117 	ldw	r6,4(sp)
  1233e4:	d9c00217 	ldw	r7,8(sp)
  1233e8:	103ff126 	beq	r2,zero,1233b0 <__register_exitproc+0x40>
  1233ec:	80c05217 	ldw	r3,328(r16)
  1233f0:	10000115 	stw	zero,4(r2)
  1233f4:	10c00015 	stw	r3,0(r2)
  1233f8:	80805215 	stw	r2,328(r16)
  1233fc:	10006215 	stw	zero,392(r2)
  123400:	10006315 	stw	zero,396(r2)
  123404:	10c00117 	ldw	r3,4(r2)
  123408:	88000d1e 	bne	r17,zero,123440 <__register_exitproc+0xd0>
  12340c:	19000084 	addi	r4,r3,2
  123410:	2109883a 	add	r4,r4,r4
  123414:	18c00044 	addi	r3,r3,1
  123418:	2109883a 	add	r4,r4,r4
  12341c:	1109883a 	add	r4,r2,r4
  123420:	10c00115 	stw	r3,4(r2)
  123424:	0005883a 	mov	r2,zero
  123428:	21400015 	stw	r5,0(r4)
  12342c:	dfc00517 	ldw	ra,20(sp)
  123430:	dc400417 	ldw	r17,16(sp)
  123434:	dc000317 	ldw	r16,12(sp)
  123438:	dec00604 	addi	sp,sp,24
  12343c:	f800283a 	ret
  123440:	02400044 	movi	r9,1
  123444:	12806217 	ldw	r10,392(r2)
  123448:	48d2983a 	sll	r9,r9,r3
  12344c:	19000804 	addi	r4,r3,32
  123450:	18d1883a 	add	r8,r3,r3
  123454:	2109883a 	add	r4,r4,r4
  123458:	4211883a 	add	r8,r8,r8
  12345c:	2109883a 	add	r4,r4,r4
  123460:	1109883a 	add	r4,r2,r4
  123464:	1211883a 	add	r8,r2,r8
  123468:	5254b03a 	or	r10,r10,r9
  12346c:	21c02215 	stw	r7,136(r4)
  123470:	41802215 	stw	r6,136(r8)
  123474:	12806215 	stw	r10,392(r2)
  123478:	01000084 	movi	r4,2
  12347c:	893fe31e 	bne	r17,r4,12340c <__register_exitproc+0x9c>
  123480:	11006317 	ldw	r4,396(r2)
  123484:	2252b03a 	or	r9,r4,r9
  123488:	12406315 	stw	r9,396(r2)
  12348c:	003fdf06 	br	12340c <__register_exitproc+0x9c>
  123490:	008004b4 	movhi	r2,18
  123494:	10944f04 	addi	r2,r2,20796
  123498:	80805215 	stw	r2,328(r16)
  12349c:	003fbe06 	br	123398 <__register_exitproc+0x28>

001234a0 <__call_exitprocs>:
  1234a0:	008004b4 	movhi	r2,18
  1234a4:	10918a04 	addi	r2,r2,17960
  1234a8:	10800017 	ldw	r2,0(r2)
  1234ac:	defff304 	addi	sp,sp,-52
  1234b0:	df000b15 	stw	fp,44(sp)
  1234b4:	d8800015 	stw	r2,0(sp)
  1234b8:	10805204 	addi	r2,r2,328
  1234bc:	dd400815 	stw	r21,32(sp)
  1234c0:	dfc00c15 	stw	ra,48(sp)
  1234c4:	ddc00a15 	stw	r23,40(sp)
  1234c8:	dd800915 	stw	r22,36(sp)
  1234cc:	dd000715 	stw	r20,28(sp)
  1234d0:	dcc00615 	stw	r19,24(sp)
  1234d4:	dc800515 	stw	r18,20(sp)
  1234d8:	dc400415 	stw	r17,16(sp)
  1234dc:	dc000315 	stw	r16,12(sp)
  1234e0:	d9000115 	stw	r4,4(sp)
  1234e4:	2839883a 	mov	fp,r5
  1234e8:	d8800215 	stw	r2,8(sp)
  1234ec:	057fffc4 	movi	r21,-1
  1234f0:	d8800017 	ldw	r2,0(sp)
  1234f4:	ddc00217 	ldw	r23,8(sp)
  1234f8:	14805217 	ldw	r18,328(r2)
  1234fc:	90001726 	beq	r18,zero,12355c <__call_exitprocs+0xbc>
  123500:	94400117 	ldw	r17,4(r18)
  123504:	8c3fffc4 	addi	r16,r17,-1
  123508:	80001116 	blt	r16,zero,123550 <__call_exitprocs+0xb0>
  12350c:	8c400044 	addi	r17,r17,1
  123510:	8427883a 	add	r19,r16,r16
  123514:	8c63883a 	add	r17,r17,r17
  123518:	95802204 	addi	r22,r18,136
  12351c:	9ce7883a 	add	r19,r19,r19
  123520:	8c63883a 	add	r17,r17,r17
  123524:	b4e7883a 	add	r19,r22,r19
  123528:	9463883a 	add	r17,r18,r17
  12352c:	e0001726 	beq	fp,zero,12358c <__call_exitprocs+0xec>
  123530:	8c87c83a 	sub	r3,r17,r18
  123534:	b0c7883a 	add	r3,r22,r3
  123538:	18c01e17 	ldw	r3,120(r3)
  12353c:	1f001326 	beq	r3,fp,12358c <__call_exitprocs+0xec>
  123540:	843fffc4 	addi	r16,r16,-1
  123544:	9cffff04 	addi	r19,r19,-4
  123548:	8c7fff04 	addi	r17,r17,-4
  12354c:	857ff71e 	bne	r16,r21,12352c <__call_exitprocs+0x8c>
  123550:	00800034 	movhi	r2,0
  123554:	10800004 	addi	r2,r2,0
  123558:	10002a1e 	bne	r2,zero,123604 <__call_exitprocs+0x164>
  12355c:	dfc00c17 	ldw	ra,48(sp)
  123560:	df000b17 	ldw	fp,44(sp)
  123564:	ddc00a17 	ldw	r23,40(sp)
  123568:	dd800917 	ldw	r22,36(sp)
  12356c:	dd400817 	ldw	r21,32(sp)
  123570:	dd000717 	ldw	r20,28(sp)
  123574:	dcc00617 	ldw	r19,24(sp)
  123578:	dc800517 	ldw	r18,20(sp)
  12357c:	dc400417 	ldw	r17,16(sp)
  123580:	dc000317 	ldw	r16,12(sp)
  123584:	dec00d04 	addi	sp,sp,52
  123588:	f800283a 	ret
  12358c:	91000117 	ldw	r4,4(r18)
  123590:	88c00017 	ldw	r3,0(r17)
  123594:	213fffc4 	addi	r4,r4,-1
  123598:	24001526 	beq	r4,r16,1235f0 <__call_exitprocs+0x150>
  12359c:	88000015 	stw	zero,0(r17)
  1235a0:	183fe726 	beq	r3,zero,123540 <__call_exitprocs+0xa0>
  1235a4:	00800044 	movi	r2,1
  1235a8:	1408983a 	sll	r4,r2,r16
  1235ac:	91406217 	ldw	r5,392(r18)
  1235b0:	95000117 	ldw	r20,4(r18)
  1235b4:	214a703a 	and	r5,r4,r5
  1235b8:	28000b26 	beq	r5,zero,1235e8 <__call_exitprocs+0x148>
  1235bc:	91406317 	ldw	r5,396(r18)
  1235c0:	2148703a 	and	r4,r4,r5
  1235c4:	20000c1e 	bne	r4,zero,1235f8 <__call_exitprocs+0x158>
  1235c8:	99400017 	ldw	r5,0(r19)
  1235cc:	d9000117 	ldw	r4,4(sp)
  1235d0:	183ee83a 	callr	r3
  1235d4:	90c00117 	ldw	r3,4(r18)
  1235d8:	1d3fc51e 	bne	r3,r20,1234f0 <__call_exitprocs+0x50>
  1235dc:	b8c00017 	ldw	r3,0(r23)
  1235e0:	1cbfd726 	beq	r3,r18,123540 <__call_exitprocs+0xa0>
  1235e4:	003fc206 	br	1234f0 <__call_exitprocs+0x50>
  1235e8:	183ee83a 	callr	r3
  1235ec:	003ff906 	br	1235d4 <__call_exitprocs+0x134>
  1235f0:	94000115 	stw	r16,4(r18)
  1235f4:	003fea06 	br	1235a0 <__call_exitprocs+0x100>
  1235f8:	99000017 	ldw	r4,0(r19)
  1235fc:	183ee83a 	callr	r3
  123600:	003ff406 	br	1235d4 <__call_exitprocs+0x134>
  123604:	90c00117 	ldw	r3,4(r18)
  123608:	1800071e 	bne	r3,zero,123628 <__call_exitprocs+0x188>
  12360c:	90c00017 	ldw	r3,0(r18)
  123610:	18000926 	beq	r3,zero,123638 <__call_exitprocs+0x198>
  123614:	9009883a 	mov	r4,r18
  123618:	b8c00015 	stw	r3,0(r23)
  12361c:	00000000 	call	0 <__alt_mem_VRAM_ctrl-0x80000>
  123620:	bc800017 	ldw	r18,0(r23)
  123624:	003fb506 	br	1234fc <__call_exitprocs+0x5c>
  123628:	90c00017 	ldw	r3,0(r18)
  12362c:	902f883a 	mov	r23,r18
  123630:	1825883a 	mov	r18,r3
  123634:	003fb106 	br	1234fc <__call_exitprocs+0x5c>
  123638:	0007883a 	mov	r3,zero
  12363c:	003ffb06 	br	12362c <__call_exitprocs+0x18c>

00123640 <_exit>:
 *
 * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h
 */

void ALT_EXIT (int exit_code)
{
  123640:	defffc04 	addi	sp,sp,-16
  123644:	df000315 	stw	fp,12(sp)
  123648:	df000304 	addi	fp,sp,12
  12364c:	e13fff15 	stw	r4,-4(fp)
  ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n");
  ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code);
  /* Stop all other threads */

  ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n");
  ALT_OS_STOP();
  123650:	0001883a 	nop
  123654:	e0bfff17 	ldw	r2,-4(fp)
  123658:	e0bffd15 	stw	r2,-12(fp)
/*
 * Routine called on exit.
 */
static ALT_INLINE ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code)
{
  int r2 = exit_code;
  12365c:	e0bffd17 	ldw	r2,-12(fp)
  123660:	e0bffe15 	stw	r2,-8(fp)
  __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */

  __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA );

#else /* !DEBUG_STUB */
  if (r2) {
  123664:	e0bffe17 	ldw	r2,-8(fp)
  123668:	10000226 	beq	r2,zero,123674 <_exit+0x34>
    ALT_SIM_FAIL();
  12366c:	002af070 	cmpltui	zero,zero,43969
  123670:	00000106 	br	123678 <_exit+0x38>
  } else {
    ALT_SIM_PASS();
  123674:	002af0b0 	cmpltui	zero,zero,43970
  ALT_SIM_HALT(exit_code);

  /* spin forever, since there's no where to go back to */

  ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n");
  while (1);
  123678:	003fff06 	br	123678 <_exit+0x38>
