PDA

View Full Version : Questions about FORTH on NMIN-12A256B


mmbutler
04-20-06, 06:57 PM
Hi. I got pretty well acquainted with the FORTH 2x4 68HC11 line back in the early 1990s. I thought (expected) that I'd have an easy time transitioning to the FORTH NMIN-12A256B. I've reached the point where I am stuck and have to start asking questions.


1) I understand New Micros' decision to hand off as much as possible in the way of tech literature to Motorola/Freescale. I've tried to make sense out of the documentation I've been able to get, but I'm still having problems.

I have some questions about flash memory, EEPROM, timers and the like. Some are clearly FORTH-specific, and I'll ask them here. But is this the right place to ask about lowlevel stuff that might impinge on hardware (as many true FORTH apps must), or is there a specific NMIN-12A256B support area?


2) I'm not sure I know how to work the FORTH assembler for this particular CPU. In parallel with this, I also don't understand the register assignment model, and consequently can't begin to write FORTH assembler code that really works.

Needless to say, I'm at a loss for writing code that could successfully handle interrupts. There are a few snippets and hints scattered about in various places in what seems to be rather sketchy NMI documentation.

One hint suggests that handling interrupts directly in FORTH is hard. OK, that figures; I can understand that reentrancy is hard to guarantee for a virtual machine without a lot of enable/disable interrupt wrappers that could hose up efficiency for everyday code.

But that puts me back needing to grok assembler and details of the FORTH implementation.

Can you point me to more complete documentation, or to a decent thread on the subject, here or elsewhere?

Thanks...

Mike

mmbutler
04-21-06, 11:43 PM
OK. digging around on my own I found this PDF document (http://www.ee.ualberta.ca/~rchapman/MFwebsite/resources/12FORTH.pdf) in rchapman's ualberta directory...

Plaintext of URL:
http://www.ee.ualberta.ca/~rchapman/MFwebsite/resources/12FORTH.pdf

...which contains enough HC12 assembler snippets that I can get into trouble on my own for a while.

I'd still like to get authoritative documentation on what registers get used for what, though.

Thanks.

mmbutler
04-28-06, 03:25 AM
It would appear the New Micros does not make available anything like the old asm6811 FORTH assembler code. OK, I have to "C," strings of byte codes. Or write my own assembler. Onward...

Perhaps my earlier posts were too wooly-headed. I'll ask a specific series of questions. In MaxFORTH 5.1G, on this specific product:

1) What machine language instruction sequence should I use to push something on the FORTH variable stack?

2) What machine language instruction sequence should I use to pop something off the FORTH variable stack into a safe register?

3) Is the FORTH return stack the hardware stack of the microprocessor?

I ask these questions because the only documentation I can find that might be relevant appears to be for MaxFORTH 5.0L on different hardware.

Thanks.

nmitech
04-28-06, 05:10 PM
I assumed the Max-FORTH core is the same on HC12(V5.0L) and HCS12(V5.1G) . The differences are the memory map, interrupt table, and its reset vector those required different built version which can support each hardware model. I think you can use the same push & pop machine instruction sequence that explained in the FAQ section start on page 4 of the link you mentioned couple post earlier.