[OpenBIOS] r317 - forth/kernel

svn at openbios.org svn at openbios.org
Wed Apr 25 08:58:37 CEST 2007


Author: wmb
Date: 2007-04-25 08:58:37 +0200 (Wed, 25 Apr 2007)
New Revision: 317

Modified:
   forth/kernel/kernel.fth
Log:
Kernel - Added bdump and wdump commands.


Modified: forth/kernel/kernel.fth
===================================================================
--- forth/kernel/kernel.fth	2007-04-21 14:23:45 UTC (rev 316)
+++ forth/kernel/kernel.fth	2007-04-25 06:58:37 UTC (rev 317)
@@ -544,28 +544,40 @@
 ps-size-t constant ps-size
 rs-size-t constant rs-size
 
-: cdump  (s adr len -- )
+: dump-chars  ( adr -- )
+   h# 10  bounds  do
+     i c@  dup  bl h# 80 within  if  emit  else  drop ." ."  then
+   loop
+;
+: bdump  (s adr len -- )
    base @ >r  hex
    bounds  ?do
       i 8 u.r  ." : "  i  h# 10  bounds  do
          i /l bounds  do  i c@ .2  loop  space
       /l +loop
-      i  h# 10  bounds  do
-         i c@  dup  bl h# 80 within  if  emit  else  drop ." ."  then
-      loop
+      i  dump-chars
       cr
    h# 10 +loop
    r> base !
 ;
+: wdump  (s adr len -- )
+   base @ >r  hex
+   bounds  ?do
+      i 8 u.r  ." : "  i  h# 10  bounds  do
+         i w@ 4 u.r space space
+      /w +loop
+      i  dump-chars
+      cr
+   h# 10 +loop
+   r> base !
+;
 : ldump  (s adr len -- )
    base @ >r  hex
    bounds  ?do
       i 8 u.r  ." : "  i  h# 10  bounds  do
          i l@ 8 u.r space space
       /l +loop
-      i  h# 10  bounds  do
-         i c@  dup  bl h# 80 within  if  emit  else  drop ." ."  then
-      loop
+      i  dump-chars
       cr
    h# 10 +loop
    r> base !




More information about the OpenBIOS mailing list