PicPuter

  Home
  Products
  Contact

Using

  Download
  Manual
  Examples
  UserGroup

Development

  Revision
  Future
  Bugs

Other

  DLHexRec
  Modd Audio
  Veracity
  DSP
  Blinky

Miscellaneous

  Links
  Search
  Obsolete
  Site Design
  Disclaimer

 
.
PicPuter 2.0 : Chapter 10 : Assembler

There is a complete Pic assembler and disassembler inside PicPuter. You can choose to program in basic, assembler, or a combination of both. This is a feature that is only available in PicPuter, and it works alongside its basic interpreter.

To disassemble use the command like 'DISASM 0 10' to display the assembly. The output of the disassembler is the exact format that assembler requires. To write an assembly statement use a hexadecimal line number e.g. '$1000 MOVLW 44'.

There are several limitation when programming pic assembly language. These are not limitations of picputer, but of the microcontroller.

The CALL and GOTO statements can only use a 12 bit jump value. Basically you can only directly jump from $0000 - $0FFF or to from $1000 - $1FFF. When executing the upper bits are taken from the value in PCLATH . When disassembling picputer uses the upper bits from its flash address.

Most assembler opcodes only use a 7 bit sram address. This creates 4 banks of sram registers $00-$7F , $80-$FF , $100-$17F , $180-$1FF. The upper bits are taken from the STATUS register. PicPuter will always list the string value in $00-$7F for disassembly. When assembling any bank can be used, but is truncated to $00-$7F. This makes the strings TRISA ($??) and PORTA ($??) the same.

  • Assembler Opcodes

    Assembler Opcodes

    10.01 ADDLW 8 bit constant
    10.02 ADDWF variable direction
    10.03 ANDLW 8 bit constant
    10.04  ANDWF 8 bit constant
    10.05 BCF 
    10.06 BSF 
    10.07 BTFSC 
    10.08  BTFSS 
    10.09 CALL 
    10.10 COMF 
    10.11 CLRF 
    10.12  CLRW 
    10.13 CLRWDT 
    10.14 DECF 
    10.15 DECFSZ 
    10.16  GOTO 
    10.17 INCF 
    10.18 INCFSZ 
    10.19 IORWF 
    10.20  IORLW 
    10.21 MOVF 
    10.22 MOVLW 
    10.23 MOVWF 
    10.24  NOP 
    10.25 RETURN 
    10.26 RETFIE 
    10.27 RETLW 
    10.28  RRF 
    10.29 RLF 
    10.30 SLEEP 
    10.31 SUBLW 
    10.32  SUBWF 
    10.33 SWAPWF 
    10.34 XORLW 
    10.35 XORWF 
  • This webpage is © Copyright 2001,2002,2003 by Todd Modjeski - All Rights Reserved - built Mon Jan 26 22:48:30 2004