From 2f83a0bea9da444e3d70569eba3d6847ca02be03 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 21 Sep 2018 21:59:17 +0200 Subject: ... --- forth/forth/avr/xdump.fs | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 forth/forth/avr/xdump.fs (limited to 'forth/forth/avr/xdump.fs') diff --git a/forth/forth/avr/xdump.fs b/forth/forth/avr/xdump.fs new file mode 100644 index 0000000..e8a4d93 --- /dev/null +++ b/forth/forth/avr/xdump.fs @@ -0,0 +1,45 @@ +\ ********************************************************************* +\ * +\ Filename: xdump.txt * +\ FlashForth: 5.0 * +\ MCU ATmega * +\ Application: * +\ * +\ Author: Mikael Nordman * +\ * +\ ********************************************************************* +\ FlashForth is licensed acording to the GNU General Public License* +\ ********************************************************************* + +-xdump +marker -xdump + +\ Display the contents of raw FLASH memory, +\ given the starting address and length. +\ The address is a raw address without mapping +\ Displays in hex notation and printable ASCII. +\ xdump expects base to be hex. +\ + +: ud.r <# 1- for # next #s #> type ; +: u.2 $ff and 0 2 ud.r space ; +: xx@ 2dup x@ dup ; + +\ Extended Memory Dump. +\ +: xdump ( d.addr +n -- ) + rot $fffe and \ start on even address + rot rot $10 u/ \ number of rows to print + for + cr 2dup 6 ud.r + [char] : emit space \ display row addr + $8 for + xx@ u.2 #8 rshift u.2 2 m+ + next + -$10 m+ \ wind back the addr + $8 for \ print ASCII + xx@ >pr emit >< >pr emit 2 m+ + next + next + 2drop cr ; + -- cgit v1.2.3