#!/usr/bin/tclsh

###############################################################################
## CONFIGURING this script:
##
##  As of tkisem version 4.5.8 on Linux systems, this file IS BROKEN!
##
## 1. If you're on a Unix system, replace the first line with the full
##    pathname of your wish interpreter (be certain to leave the "-f" after
##    the pathname).  This wish interpreter must be at least 4.1.
##    If you're on a DOS system don't change the first line.
##    
## 2. Set the library directory to the full pathname of where you installed
##    the library and help file.
##
## 3. Set the library extension: for Unix systems, this is so; for DOS 
##    systems this is dll
##
###############################################################################

set libdir [eval file join [lreplace [file split [file dirname $argv0]] end end lib]]
set lib_ext so
# $Format: "set release $ProjectVersion$"$
set release 4.5.12

###############################################################################
# Other configurable options -- 
###############################################################################

# how to display registers
# the default is  regular  which uses the names %r0 through %r31
# the alternative is  window  which uses the names %g0-%g7, %o0-%o7, etc
set reg_view regular

#--------------------------isem devices----------------------------------------
#
# the address is the memory address for the device
# the mode specifies which address spaces the device appears in -- it always
#   mapped into supervisor space, if mode is set to user, it is also mapped
#   into user space

set gx_address 0x100000
set gx_mode user

set console_address 0x110000
set console_mode user

set halt_address 0x120000
set halt_mode user

set timer_int_level 1
set timer_address 0x130000
set timer_mode user

###############################################################################
# end of configuration
###############################################################################

source "$libdir/isem_com.tcl"

###############################################################################
# this is where it starts!
###############################################################################

#------------------------------------------------------------------------------
# the gx device
#------------------------------------------------------------------------------
proc gx {op addr bytemask value} {
    global stop_run
    err_msg "Program attempted to use the gx device"
    set stop_run 1
}

isem_device gx $gx_address $gx_mode

proc outs {msg} {
    puts $msg
}

proc outc {ch} {
    puts -nonewline $ch
}

set poll_op isem_poll

reset

isem_interp
