Alert   Product Alerts
Keep current on the latest products, new suppliers, and technical articles of interest to you. (See Topics)

Converting from 8051 to Microchip Assembler: A Quick Reference

From Microchip Technology, Inc.
 

 
When migrating assembly language programs from one family of microcontrollers to another, the first question is almost always: "What's the equivalent opcode?" Some operations, like addition and subtraction, are self-evident and practically universal. Other instructions may have some subtle differences in syntax or spelling that make direct conversions a bit trickier. Occasionally, some instructions simply don't have a direct equivalent in the target set, or an equivalent exists but is explained in different terms. Another question that arises is that of addressing modes. Typically, Direct and Indirect Addressing modes are standard in all architectures. However, they tend to be different in limitations and feature set. To help simplify the conversion process, this application note provides a table of the instruction set of the 8051 8-bit microcontroller family and their equivalents in the PICmicro® instruction sets (Table 1). It is organized alphabetically by the 8051 instruction mnemonic in the first column, followed by the common description of the operation and the closest equivalent opcode or opcode sequence in the Microchip PIC16 and PIC18 instruction sets. In addition, the size of the instructions (in words or bytes, as appropriate) and the number of machine or instruction cycles required for execution are listed for each entry.

Products & Services
Microcontrollers (MCU) are complete computer systems on a chip. They combine an arithmetic logic unit (ALU), memory, timer/counters, serial port, input/output (I/O) ports and a clock oscillator. Search by Specification | Learn more about Microcontrollers (MCU)
Specialty microprocessors and microcontrollers are specialty or proprietary products and accessories related to microprocessors and microcontrollers. Learn more about Specialty Microprocessors and Microcontrollers

Product Announcements
Silicon Laboratories, Inc. - USB ToolStick
The Silicon Labs ToolStick is an easy to use development system that allows designers to develop and debug application firmware directly on the target microcontroller using the Silicon Labs Integrated... (read more)
Atmel Corporation - Secure MCU: Electronic Transaction Terminal/Reader
The Secure Microcontroller for Electronic Transaction Terminal/Reader is a low-power, high-performance, SC100 32-bit microcontroller based on the ARMĀ® enhanced RISC architecture. This new SC100 core... (read more)
TES Electrical Electronic Corp. - NEW ~~ TES-1372 / 1372R CO Analyzer
CO : 0 ~ 999 ppm range MAX Hold with Time stamp Alarm level setting Replaceable sensor Manual Data Memory and Read (999 sets. direct reading from LCD display) Auto Data Memory and Read... (read more)
KWS Inc. - Excavator Hook with Forged Safety Latch
KWS, Inc. Excavator Hook with forged safety latch, TWN 0850. The component must approve a strength introduction at the chosen place! Welding works are to be carried out in accordance with the... (read more)
Microchip Technology, Inc. - MASTERs Conference 2009
The MASTERs Conference is 3 days of technical training for embedded systems design engineers. The numerous topics are taught by Microchip product developers and technical experts. (read more)
 

Topics of Interest
When migrating assembly language programs from one family of microcontrollers to another, the first question is almost always: ?What?s the equivalent opcode?? Some operations, like addition and... (Read More)
Overview The objective of this chapter is to introduce the basics of the assembly language. Assembly language statements can either instruct the processor to perform a task, or direct the assembler... (Read More)
This chapter provides some insight into the instruction set in the Cortex-M3 and examples for a number of instructions. You'll also find a quick reference of the support instructions in Appendix A of... (Read More)
This chapter continues the assembly language overview from the last chapter. After the introduction, we discuss the data exchange and translate instructions. Then we describe the assembler directives... (Read More)
A.11 8051 Instruction Set Arithmetic Instructions Mnemonic Operation Description Flags ADD A,R n Add register to Accumulator A ? A + R n... (Read More)