File: checkit.fth

package info (click to toggle)
pforth 21-10
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 820 kB
  • ctags: 873
  • sloc: ansic: 5,050; makefile: 102
file content (32 lines) | stat: -rw-r--r-- 409 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
\ compare dictionaries

anew comp
hex

: checksum  { start end -- sum }
	0
	end start
	DO
		i @ +
	4 +LOOP
;

: findword { target start end -- }
	end start
	DO
		i @  target =
		IF
			." found at " i u. cr
			i 16 dump
		THEN
	4 +LOOP
;

echo on
hex
$ 01500fc4 codebase here findword
codebase here cr .s checksum u. cr
namebase context @ cr .s checksum u. cr
decimal

echo off