forth 2.9 KB

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