Software 32bit core

Enhanced mid-range devices. PIC12F1xxx and PIC16F1xxx

Software 32bit core

Postby DarioG » Fri Nov 24, 2017 11:57 am

Been thinking about this for a while and now I came out with something.

It's of course mostly academic but... :)

The point was: implementing a software 32bit CPU on a PIC16. I wanted to maintain retro-compatibility and add some instruction that could deal with 32bit operations, but...

looks like *all* of the 14bit opcodes have been exploited - in the Enhanced cores!

So... I started out implementing a C version of the standard/enhanced core, and this is attached. It's written in XC8 and is mostly functional: only needs some adjustment. And, of course, the point is that, being written in C, you can't "play" with real registers - while my aim was *using* the real FSR etc. But this is left for the future...
XC8 free mode takes circa 2000 words on a PIC16F18324 and such. If anybody wants to compile in Pro mode, just to check... :)

Then, I decided to move to 2-words opcodes, and in order to maintain retro-compatibility I decided to:
1st word: higher 6bits are 0 for an "old" instruction and 1 for "new" ones;
low byte contains the previous high 6bits for an old opcode, or newly defined ones
2nd word: if this is an "old" instruction, its 8bits are the low 8bits from a standard opcode
otherwise this is a new instruction.

New instruction at the moment include all operations available on a 32bits W register, plus all File operations as well; bit operations only on single byte (legacy mode) so far.
Full GOTOs coming soon!

Enjoy.
All we are praying / is an earthquake in Chandler
User avatar
DarioG
Verified identity
 
Posts: 34
Joined: Thu May 29, 2014 8:42 am
PIC experience: Professional 5+ years with MCHP products

Re: Software 32bit core

Postby DarioG » Fri Nov 24, 2017 11:59 am

source codes 23.11.17
Attachments
PIC16232.h
(276 Bytes) Downloaded 443 times
main_PIC16_ok.c
(20.4 KiB) Downloaded 407 times
main_PIC16_32_ok.c
(31.44 KiB) Downloaded 460 times
All we are praying / is an earthquake in Chandler
User avatar
DarioG
Verified identity
 
Posts: 34
Joined: Thu May 29, 2014 8:42 am
PIC experience: Professional 5+ years with MCHP products


Return to 14-Bit Core (enhanced)

Who is online

Users browsing this forum: No registered users and 2 guests

cron