2

In repairing an instrument cluster, I need to replace a controller which is built on an Motorola MC68HC11 using Forth. While I was able to dump the whole memory, it is unknown which Forth is used and the available words seem very limited.

How does one proceed in order to locate and change a known value in memory in an embedded Forth environment?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Riley
  • 359
  • 2
  • 11
  • 2
    Does the system provide a text interpreter, can you run it (probably in a simulator)? Or all what you can is to read and modify the memory? – ruvim Nov 02 '21 at 12:04

2 Answers2

5

Depending on the flavour of Forth you can list all "words" using vlist or words. Words include any variables or constants defined, and variables can be manipulated with the following operators:

  • ! ( n addr — ) Stores a single-length number into the address.
  • @ ( addr — n ) Fetches that value at addr.
  • ? ( addr — ) Prints the contents of the address, followed by one space.
  • +! ( n addr — ) Adds a single-length number to the contents of the address.

For double length variables there are:

  • 2! ( d addr — ) or ( n1 n2 addr — ) Stores a double-length number (or a pair of single-length numbers) at address addr.
  • 2@ ( addr — d ) or ( addr – n1 n2 ) Fetches a double-length number (or a pair of single-length numbers) from addr.
Clifford
  • 88,407
  • 13
  • 85
  • 165
1

Whilst the program running on the 68HC11 was originally written in Forth I believe it would have ultimately been compiled to machne code to run on the microcontroller. When the 68HC11 was first released there were several (some free) programming tools, ie assembly language programmers for this microcontroller. If you have the memory dump, perhaps try loading into an editor / assembler and working through the assembly code?. You may even be able to identify references to the individual port configuration, data, etc that you wish to change. Hope this is of some help. Regards AB

zerodbm
  • 11
  • 2