View Full Version : HC912 memory map
On the nmin-0912 documentation, please note that RAM end at $0BFF (from $0C00 thru $0CFF = not available)
Is the second interrupt vectors an exact copy of main vectors? If yes, it will start at $F7C0 right?
Possible to have HC12 assembler subroutines for example (In a Forth world) ?
Internal RAM ends at 0BFF but external RAM can be available at the holes in the memory map.
The second interrupt is a duplicate of the first and starts
at F7C0.
If you define the word as CODE-SUB and terminate it with an
RTS, then you can define that Forth word in assembler. You
cannot mix assembler into a high level Forth definition though.
Rob
I know that we cannot mix assembler and forth in the same definition but we can call forth in assembler and assembler in forth.
We were having some examples with the hc11 but nothing on the hc12. Can we have examples on how to use the assembler with the max-forth V5.0 (like calling a forth word by a RTI). i've done this but i'm not sure if it's the best way i take.
With the flash, the program must be load over the old one. The int vector address will change each time but cannot be modified in the second interrupt vectors table (in flash), so is it possible to move it in eeprom ?
Thanks
Mario Paradis
CIM inc.
Pointing the Flash interrupt into EEPROM is a good solution to keep from having to initialize flash when the interrupt location changes. In flash you will need to place the address of a 3 byte location in EEPROM. The first byte will contain a jump instruction and the last two bytes will contain the address of your interrupt routine. You can change the EEPROM with EE!.
There is no official assembler for the HC12 in MaxForth but there are some alternatives. You can code up assembler definitions by compiling them in a freeware assembler like the one from Motorola and then comma the opcodes into a Forth definition. While not as interactive as Forth, it lets you code in assembler. As an example, here's an interrupt routine to service the real time interrupt:
( ==== Real time interrupt interface tools ==== )
( ==== Registers ==== )
14 CONSTANT RTICTL ( real time interrupt control register
15 CONSTANT RTIFLG ( real time interrupt flag register
1E CONSTANT INTCR ( IRQ control register
( ==== Real time interrupt ==== )
VARIABLE ticks ( incremented by RTI interrupt )
CODE-SUB SIR-RTI ( real time interrupt: increment a ticker
4D C, RTIFLG C, 7F C, ( BCLR RTIFLG,$7F ; clear RTIF
FE C, ticks , ( LDX ticks ; get timer contents
08 C, ( INX ; increment it
7E C, ticks , ( STX ticks ; store it back
0B C, ( RTI ; return from interrupt
END-CODE
( The interrupt vector is stored in EEPROM so it can be compiled
( and changed many times. The location in Flash can only be changed
( by clearing all of the flash. So it is always the same.
FFD F7F0 FL! ( interrupt vector is in EEPROM
06 FFD EEC! ' SIR-RTI @ FFE EE! ( jmp to interrupt
Rob
vBulletin v3.0.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.