4

I've seen there are specific formats to convert MIPS assembly instruction to machine code. There should be similar procedure to convert PIC assembly to machine code manually. Can anyone kindly provide me the documentation related to this?

Rifat Rousseau
  • 289
  • 1
  • 4
  • 16

3 Answers3

4

The Microchip datasheets all have instruction set references, including how instructions are encoded. Note that most series are completely different (i.e. 16 and 18 series are not remotely similar) so make sure you get the right datasheet.

Here's an example for the 16F627A, taken from page 118 of the PIC16F627A datasheet: PIC16 instruction set reference

Mathew Hall
  • 994
  • 9
  • 18
2

Something like this manual should do.

But can't resist: why do you want to do it manually?

dbrank0
  • 9,026
  • 2
  • 37
  • 55
  • This si not MIPS instruction set manual! This manual is for 24bit PIC MCPU family. – GJ. Aug 29 '12 at 08:22
  • Thanks. Although the manual isn't exactly what I'm looking for, but at least I got a clue how to search. I'm trying to develop a simple assembler for myself to use in Linux. Is there any tutorial like documentation for 8-bit PICs that you found useful, if you worked on this field? @drank0 – Rifat Rousseau Aug 29 '12 at 09:28
  • Well, you basically need documentation for the CPU you want to program. There is not existing assembler for this (like http://gputils.sourceforge.net/) or is it your goal to create/learn how to create assembler(s)? – dbrank0 Aug 29 '12 at 10:53
  • My goal is to create a simple assembler for a small number of PIC instructions so that I can get my job done in linux without using wine to run MPASM. But I found documentation of PIC less comprehensive as compared to MIPS(which even has some books dedicated to it). But anyway, I'm beginning to understand how PIC instruction works, but it would've been much better if I find a quality tutorial, apart from detailed documentation. – Rifat Rousseau Aug 29 '12 at 11:44
  • 1
    pic instructions are much simpler than mips, you just need the table like the one posted by Mathew Hall. you do need the correct table for the flavor of pic you are using. there are linux assemblers for pic, you dont need to make your own if you dont want to. Note that almost every processor vendor supplies instruction set documentation including instruction encoding. starting with the processor vendor is generally the first place (mips, microchip, arm, atmel, etc). – old_timer Sep 02 '12 at 02:33
0

You are probably looking for MIPS32® M4K® core instruction set. If so than you can find everything about on MIPS homepage.

GJ.
  • 10,810
  • 2
  • 45
  • 62