aboutsummaryrefslogtreecommitdiff
path: root/tcl/mem_helper.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tcl/mem_helper.tcl')
-rw-r--r--tcl/mem_helper.tcl31
1 files changed, 0 insertions, 31 deletions
diff --git a/tcl/mem_helper.tcl b/tcl/mem_helper.tcl
deleted file mode 100644
index 86ad00f..0000000
--- a/tcl/mem_helper.tcl
+++ /dev/null
@@ -1,31 +0,0 @@
-# Helper for common memory read/modify/write procedures
-
-# mrw: "memory read word", returns value of $reg
-proc mrw {reg} {
- set value ""
- mem2array value 32 $reg 1
- return $value(0)
-}
-
-add_usage_text mrw "address"
-add_help_text mrw "Returns value of word in memory."
-
-proc mrb {reg} {
- set value ""
- mem2array value 8 $reg 1
- return $value(0)
-}
-
-add_usage_text mrb "address"
-add_help_text mrb "Returns value of byte in memory."
-
-# mmw: "memory modify word", updates value of $reg
-# $reg <== ((value & ~$clearbits) | $setbits)
-proc mmw {reg setbits clearbits} {
- set old [mrw $reg]
- set new [expr ($old & ~$clearbits) | $setbits]
- mww $reg $new
-}
-
-add_usage_text mmw "address setbits clearbits"
-add_help_text mmw "Modify word in memory. new_val = (old_val & ~clearbits) | setbits;"