Assembler Psoc

  • View
    26

  • Download
    0

Embed Size (px)

DESCRIPTION

lenguaje ensamblador para psoc

Text of Assembler Psoc

  • Assembly Language GuideDocument # 38-12004 Rev. *F

    Cypress Semiconductor198 Champion Court

    San Jose, CA 95134-1709Phone (USA): 800.858.1810Phone (Intnl): 408.943.2600

    http://www.cypress.com

  • 2 Assembly Language Guide, Document # 38-12004 Rev. *F

    Copyrights

    CopyrightsCopyright 2001 - 2006 Cypress Semiconductor Corporation. All rights reserved.PSoC is a registered trademark and PSoC Designer, Programmable System-on-Chip, and PSoC Express are trade-marks of Cypress Semiconductor Corporation (Cypress), along with Cypress and Cypress Semiconductor. All othertrademarks or registered trademarks referenced herein are the property of their respective owners. The information in this document is subject to change without notice and should not be construed as a commitment byCypress. While reasonable precautions have been taken, Cypress assumes no responsibility for any errors that may appearin this document. No part of this document may be copied or reproduced in any form or by any means without the prior writtenconsent of Cypress. Made in the U.S.A.

    Disclaimer

    CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PAR-TICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein.Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypressdoes not authorize its products for use as critical components in life-support systems where a malfunction or failure may rea-sonably be expected to result in significant injury to the user. The inclusion of Cypress product in a life-support systems appli-cation implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges.

    Flash Code ProtectionCypress products meet the specifications contained in their particular Cypress PSoC Data Sheets. Cypress believes that itsfamily of PSoC products is one of the most secure families of its kind on the market today, regardless of how they are used.There may be methods, unknown to Cypress, that can breach the code protection features. Any of these methods, to ourknowledge, would be dishonest and possibly illegal. Neither Cypress nor any other semiconductor manufacturer can guaran-tee the security of their code. Code protection does not mean that we are guaranteeing the product as "unbreakable."

    Cypress is willing to work with the customer who is concerned about the integrity of their code. Code protection isconstantly evolving. We at Cypress are committed to continuously improving the code protection features of ourproducts.

  • Assembly Language Guide, Document # 38-12004 Rev. *F 3

    Contents

    1. Introduction 71.1 Chapter Overviews ......................................................................................................71.2 Support ........................................................................................................................8

    1.2.1 Technical Support Systems..............................................................................81.2.2 Product Upgrades ............................................................................................8

    1.3 Documentation Conventions........................................................................................81.3.1 Acronyms .........................................................................................................9

    2. M8C Microprocessor 112.1 Internal Registers.......................................................................................................112.2 Address Spaces.........................................................................................................122.3 Instruction Set Summary ...........................................................................................142.4 Instruction Formats ...................................................................................................16

    2.4.1 One-Byte Instruction ......................................................................................162.4.2 Two-Byte Instructions.....................................................................................162.4.3 Three-Byte Instructions ..................................................................................17

    2.5 Addressing Modes .....................................................................................................182.5.1 Source Immediate ..........................................................................................182.5.2 Source Direct .................................................................................................192.5.3 Source Indexed ..............................................................................................192.5.4 Destination Direct...........................................................................................202.5.5 Destination Indexed .......................................................................................202.5.6 Destination Direct Source Immediate.............................................................212.5.7 Destination Indexed Source Immediate .........................................................212.5.8 Destination Direct Source Direct ....................................................................222.5.9 Source Indirect Post Increment......................................................................222.5.10 Destination Indirect Post Increment ...............................................................23

    3. PSoC Designer Assembler 253.1 Source File Format ....................................................................................................25

    3.1.1 Labels.............................................................................................................263.1.2 Mnemonics.....................................................................................................273.1.3 Operands .......................................................................................................283.1.4 Comments......................................................................................................293.1.5 Directives .......................................................................................................30

    3.2 Listing File Format .....................................................................................................303.3 Map File Format.........................................................................................................303.4 ROM File Format .......................................................................................................303.5 Intel HEX File Format..............................................................................................313.6 Convention for Restoring Internal Registers..............................................................333.7 Compiling a File into a Library Module ......................................................................33

  • 4 Assembly Language Guide, Document # 38-12004 Rev. *F

    Contents

    4. M8C Instruction Set 374.1 Add with Carry .............................................................................................. ADC.....384.2 Add without Carry ......................................................................................... ADD.....394.3 Bitwise AND.................................................................................................. AND.....404.4 Arithmetic Shift Left ....................................................................................... ASL.....414.5 Arithmetic Shift Right .................................................................................... ASR.....424.6 Call Function................................................................................................CALL.....434.7 Non-Destructive Compare ............................................................................CMP.....444.8 Complement Accumulator .............................................................................CPL.....454.9 Decrement .................................................................................................... DEC.....464.10 Halt ..............................................................................................................HALT.....474.11 Increment........................................................................................................INC.....484.12 Relative Table Read .................................................................................. INDEX.....494.13 Jump Accumulator...................................................................................... JACC.....504.14 Jump if Carry ................................................................................................... JC.....514.15 Jump..............................................................................................................JMP.....524.16 Jump if No Carry............................................................................................JNC.....534.17 Jump if Not Zero ............................................................................................ JNZ.....544.18 Jump if Zero......................................................................................................JZ.....554.19 Long Call ...................................................................................................LCALL.....564.20 Long Jump...................................................................................................LJMP.....574.21 Move.............................................................................................................MOV.....584.22