xref: /freebsd/contrib/file/magic/Magdir/forth (revision 4e99f45480598189d49d45a825533a6c9e12f02c)
1
2#------------------------------------------------------------------------------
3# $File: forth,v 1.1 2019/06/06 19:14:20 christos Exp $
4# forth:  file(1) magic for various Forth environments
5# From: Lubomir Rintel <lkundrak@v3.sk>
6#
7
8# Has a FORTH stack diagram and something that looks very much like a FORTH
9# multi-line word definition. Probably a FORTH source.
100       regex   \[[:space:]]\\(([[:space:]].*)?\ --\ (.*[[:space:]])?\\)
11>0      regex   \^:\[[:space:]]
12>>0     regex   \^;$				FORTH program
13!:mime  text/x-forth
14
15# Inline word definition complete with a stack diagram
160       regex   \^:[[:space:]].*[[:space:]]\\(([[:space:]].*)?\ --\ (.*[[:space:]])?\\)[[:space:]].*[[:space:]];$	FORTH program
17!:mime  text/x-forth
18
19# Various dictionary images used by OpenFirware FORTH environent
20
210	lelong	0xe1a00000
22>8	lelong	0xe1a00000	ARM OpenFirmware FORTH Dictionary,
23>>24	lelong	x		Text length: %d bytes,
24>>28	lelong	x		Data length: %d bytes,
25>>32	lelong	x		Text Relocation Table length: %d bytes,
26>>36	lelong	x		Data Relocation Table length: %d bytes,
27>>40	lelong	x		Entry Point: 0x%08X,
28>>44	lelong	x		BSS length: %d bytes
29
300	string	MP
31>28	lelong	1		x86 OpenFirmware FORTH Dictionary,
32>>4	leshort	x		%d blocks
33>>2	leshort	x		+ %d bytes,
34>>6	leshort	x		%d relocations,
35>>8	leshort	x		Header length: %d paragraphs,
36>>10	leshort	x		Data Size: %d
37>>12	leshort	x		- %d 4K pages,
38>>14	lelong	x		Initial Stack Pointer: 0x%08X,
39>>20	lelong	x		Entry Point: 0x%08X,
40>>24	lelong	x		First Relocation Item: %d,
41>>26	lelong	x		Overlay Number: %d,
42>>18	leshort	x		Checksum: 0x%08X
43
440	belong	0x48000020	PowerPC OpenFirmware FORTH Dictionary,
45>4	belong	x		Text length: %d bytes,
46>8	belong	x		Data length: %d bytes,
47>12	belong	x		BSS length: %d bytes,
48>16	belong	x		Symbol Table length: %d bytes,
49>20	belong	x		Entry Point: 0x%08X,
50>24	belong	x		Text Relocation Table length: %d bytes,
51>28	belong	x		Data Relocation Table length: %d bytes
52
530	lelong	0x10000007	MIPS OpenFirmware FORTH Dictionary,
54>4	lelong	x		Text length: %d bytes,
55>8	lelong	x		Data length: %d bytes,
56>12	lelong	x		BSS length: %d bytes,
57>16	lelong	x		Symbol Table length: %d bytes,
58>20	lelong	x		Entry Point: 0x%08X,
59>24	lelong	x		Text Relocation Table length: %d bytes,
60>28	lelong	x		Data Relocation Table length: %d bytes
61
62# Dictionary images used by minimal C FORTH environments, any platform,
63# using native byte order.
64
65# Weak.
66#0	short	0x5820		cForth 16-bit Dictionary,
67#>2	short	x		Serial: 0x%08X,
68#>4	short	x		Dictionary Start: 0x%08X,
69#>6	short	x		Dictionary Size: %d bytes,
70#>8	short	x		User Area Start: 0x%08X,
71#>10	short	x		User Area Size: %d bytes,
72#>12	short	x		Entry Point: 0x%08X
73
740	long	0x581120	cForth 32-bit Dictionary,
75>4	long	x		Serial: 0x%08X,
76>8	long	x		Dictionary Start: 0x%08X,
77>12	long	x		Dictionary Size: %d bytes,
78>16	long	x		User Area Start: 0x%08X,
79>20	long	x		User Area Size: %d bytes,
80>24	long	x		Entry Point: 0x%08X
81