diff options
Diffstat (limited to 'lib/simulator/engine')
-rw-r--r-- | lib/simulator/engine/engine_auxiliary_alo_functions.tcl | 22 | ||||
-rw-r--r-- | lib/simulator/engine/engine_backward_stepping.tcl | 5 | ||||
-rw-r--r-- | lib/simulator/engine/engine_control.tcl | 5 | ||||
-rw-r--r-- | lib/simulator/engine/engine_core.tcl | 17 | ||||
-rw-r--r-- | lib/simulator/engine/engine_external_interface_management.tcl | 17 | ||||
-rw-r--r-- | lib/simulator/engine/engine_hibernation.tcl | 5 | ||||
-rw-r--r-- | lib/simulator/engine/engine_initialization_cleanup.tcl | 5 | ||||
-rw-r--r-- | lib/simulator/engine/engine_instructions.tcl | 6 | ||||
-rw-r--r-- | lib/simulator/engine/engine_mcu_configuration.tcl | 5 | ||||
-rw-r--r-- | lib/simulator/engine/engine_memory_management.tcl | 5 | ||||
-rw-r--r-- | lib/simulator/engine/engine_opcodes.tcl | 5 | ||||
-rw-r--r-- | lib/simulator/engine/engine_text_based_interface.tcl | 7 | ||||
-rw-r--r-- | lib/simulator/engine/engine_virtual_hw_controller.tcl | 5 |
13 files changed, 72 insertions, 37 deletions
diff --git a/lib/simulator/engine/engine_auxiliary_alo_functions.tcl b/lib/simulator/engine/engine_auxiliary_alo_functions.tcl index 8929268..44392c3 100644 --- a/lib/simulator/engine/engine_auxiliary_alo_functions.tcl +++ b/lib/simulator/engine/engine_auxiliary_alo_functions.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -53,9 +56,10 @@ private method undefined_octet {} { } ## Add value to accumulator and affect PSW flags - # @parm Int val - value to add + # @parm Int val - value to add + # @parm Int carry - addtional value to add (ment for the Carry flag) # @return void -private method alo_add {val} { +private method alo_add {val {carry 0}} { # Adjust stepback stack if {${::Simulator::reverse_run_steps}} { @@ -69,7 +73,7 @@ private method alo_add {val} { set val_l [expr {$val & 15}] ;# Low-order nibble of val # Compute low-order nibble of result - set result [expr {$val_l + $A_l}] + set result [expr {$val_l + $A_l + $carry}] # Flag AC if {$result > 15} { @@ -109,10 +113,7 @@ private method alo_add {val} { # @parm Int val - value to add # @return void private method alo_addc {val} { - if {[getBit $symbol(C)]} { - incr val - } - alo_add $val + alo_add $val [getBit $symbol(C)] } ## Subtract tegister from ACC with borrow and affect PSW flags @@ -126,8 +127,9 @@ private method alo_subb {val} { } # Flag PSW.C + set carry 0 if {[getBit $symbol(C)]} { - incr val + set carry 1 } # Local variables @@ -137,7 +139,7 @@ private method alo_subb {val} { set val_l [expr {$val & 15}] ;# Low-order nibble of val # Compute low-order nibble of result - set result_l [expr {$A_l - $val_l}] + set result_l [expr {$A_l - $val_l - $carry}] # Flag AC if {$result_l < 0} { diff --git a/lib/simulator/engine/engine_backward_stepping.tcl b/lib/simulator/engine/engine_backward_stepping.tcl index 7914c9b..af5e7d9 100644 --- a/lib/simulator/engine/engine_backward_stepping.tcl +++ b/lib/simulator/engine/engine_backward_stepping.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_control.tcl b/lib/simulator/engine/engine_control.tcl index 6b76b5a..33fbe84 100644 --- a/lib/simulator/engine/engine_control.tcl +++ b/lib/simulator/engine/engine_control.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_core.tcl b/lib/simulator/engine/engine_core.tcl index 0c78129..6b169f1 100644 --- a/lib/simulator/engine/engine_core.tcl +++ b/lib/simulator/engine/engine_core.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -58,20 +61,20 @@ class Simulator_ENGINE { inherit Hibernate ;# Import hibernation facility ## COMMON - common symbol ;# Array of SFR symbolic names (eg. $symbol(P0) == "80") - common PIN ;# Array describing pins with some special function - common PORT_LATCHES ;# List: Port latch registers - common GUI_UPDATE_INT 66;# Int: Time interval [ms] in which the GUI is regulary updated in the run mode + public common symbol ;# Array of SFR symbolic names (eg. $symbol(P0) == "80") + public common PIN ;# Array describing pins with some special function + public common PORT_LATCHES ;# List: Port latch registers + public common GUI_UPDATE_INT 66;# Int: Time interval [ms] in which the GUI is regulary updated in the run mode # Default values for SFR (values to set after reset) - common reset_reg_values { + public common reset_reg_values { {A 0} {B 0} {DP0L 0} {DP0H 0} {IE 0} {IP 0} {PSW 0} {TCON 0} {TMOD 0} {TH0 0} {TH1 0} {TL0 0} {TL1 0} {PCON 0} {SP 7} } # Default values for special (uC dependend) SFR (values to set after reset) - common reset_reg_values_1 { + public common reset_reg_values_1 { {T2CON 0} {T2MOD 0} {RCAP2L 0} {RCAP2H 0} {TL2 0} {TH2 0} {AUXR1 0} {ACSR 0} {AUXR 0} {P0 255} {P1 255} {P2 255} diff --git a/lib/simulator/engine/engine_external_interface_management.tcl b/lib/simulator/engine/engine_external_interface_management.tcl index 5a1f220..028e824 100644 --- a/lib/simulator/engine/engine_external_interface_management.tcl +++ b/lib/simulator/engine/engine_external_interface_management.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -1100,8 +1103,8 @@ public method getTime {} { } # Local variables - set us [expr {($ms % 1000)}] ;# Number of micro seconds - set ms [expr {$ms / 1000}] ;# Number of mili seconds + set us [expr {($ms % 1000)}] ;# Number of microseconds + set ms [expr {$ms / 1000}] ;# Number of miliseconds set s [expr {int($s)}] ;# Number of seconds set h [expr {$s / 3600}] ;# Number of hours set s [expr {$s % 3600}] @@ -1111,7 +1114,7 @@ public method getTime {} { # Adjust length of nano-seconds string set len [string length $ns] if {$len < 3} { - set ns_s "[string repeat { } [expr {3 - $len}]]$ns" + set ns_s "[string repeat {0} [expr {3 - $len}]]$ns" } else { set ns_s $ns } @@ -1165,11 +1168,7 @@ public method getTime {} { } # Append micro-seconds if {$us > 0 || $result != {}} { - append result " ${us_s}µs" - } - # Append nano-seconds - if {$ns > 0 || $result != {}} { - append result " ${ns_s}ns" + append result " ${us_s}.${ns_s}µs" } # Done ... diff --git a/lib/simulator/engine/engine_hibernation.tcl b/lib/simulator/engine/engine_hibernation.tcl index d5a5faa..b34d828 100644 --- a/lib/simulator/engine/engine_hibernation.tcl +++ b/lib/simulator/engine/engine_hibernation.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_initialization_cleanup.tcl b/lib/simulator/engine/engine_initialization_cleanup.tcl index 8865dd2..d0a238c 100644 --- a/lib/simulator/engine/engine_initialization_cleanup.tcl +++ b/lib/simulator/engine/engine_initialization_cleanup.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_instructions.tcl b/lib/simulator/engine/engine_instructions.tcl index 19c45af..a606f93 100644 --- a/lib/simulator/engine/engine_instructions.tcl +++ b/lib/simulator/engine/engine_instructions.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -1014,6 +1017,7 @@ private method ins_movx {opr0 opr1} { # Adjust engine configuration set eeprom_WR_time 1 set eeprom_WR 1 + $this simulator_GUI_invoke_write_to_eeprom } return diff --git a/lib/simulator/engine/engine_mcu_configuration.tcl b/lib/simulator/engine/engine_mcu_configuration.tcl index 2226a7d..3fc12dd 100644 --- a/lib/simulator/engine/engine_mcu_configuration.tcl +++ b/lib/simulator/engine/engine_mcu_configuration.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_memory_management.tcl b/lib/simulator/engine/engine_memory_management.tcl index e3a5828..5d74906 100644 --- a/lib/simulator/engine/engine_memory_management.tcl +++ b/lib/simulator/engine/engine_memory_management.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_opcodes.tcl b/lib/simulator/engine/engine_opcodes.tcl index e06dc12..17bca3d 100644 --- a/lib/simulator/engine/engine_opcodes.tcl +++ b/lib/simulator/engine/engine_opcodes.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_text_based_interface.tcl b/lib/simulator/engine/engine_text_based_interface.tcl index 0b6448c..ef61a61 100644 --- a/lib/simulator/engine/engine_text_based_interface.tcl +++ b/lib/simulator/engine/engine_text_based_interface.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2011-2011 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -109,7 +112,7 @@ namespace eval SimulatorEngineCLI { class SimEngineWrapper { inherit Simulator_ENGINE Pale - common changed_registers [list] + public common changed_registers [list] # TODO: get rid of these variables: public variable procData {} diff --git a/lib/simulator/engine/engine_virtual_hw_controller.tcl b/lib/simulator/engine/engine_virtual_hw_controller.tcl index a13c9b9..3413eb3 100644 --- a/lib/simulator/engine/engine_virtual_hw_controller.tcl +++ b/lib/simulator/engine/engine_virtual_hw_controller.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # |