Switch to full style
PIC Assembly Articles
Post a reply

Control Directives usage PIC assembly

Sat May 11, 2013 1:12 am

Control Directives usage PIC assembly
Code:
if <expr> ; directives for conditional assembly
else
endif
Example.
if version == 100
movlw D’10’
movwf io1,A
else
movlw D’26’
movwf io2,A
endif
end ; indicates the end of the program



#include “<include_file>” (or #include <include_file>)
#include “lcd_util.asm” ; include the lcd_util.asm file from current directory
#include <p18F8680.inc> ; include the file p18F8680.inc from the installation
; directory of mplab.
radix <default_radix>
  • sets the default radix for data expression
  • the default radix values are: hex, dec, or oct
radix dec ; set default radix to decimal

[<label>] code [<ROM address>]
  • Declares the beginning of a section of program code.
  • If no label is specified, the section is named “.code”.
  • The starting address of the section is either included in the directive or
    assigned at link time if not specified in the directive.
Code:
reset code 0x00
goto start
#define <name> [<string>] ; defines a text substitution string
#define loop_cnt 30
#define sum3(x,y,z) (x + y + z)
#define seed 103
#undefine <label> ; deletes a substitution string



Code:
#include “<include_file>” (or #include <include_file>)
#include “lcd_util.asm” ; include the lcd_util.asm file from current directory
#include <p18F8680.inc> ; include the file p18F8680.inc from the installation
; directory of mplab.

radix <default_radix>
  • sets the default radix for data expression
  • the default radix values are: hex, dec, or oct
radix dec ; set default radix to decimal



Post a reply
  Related Posts  to : Control Directives usage PIC assembly
 Object File Directives Usage PIC Assembly     -  
 TEMPERATURE AND HEAT CONTROL Assembly     -  
 Motor DC Speed Control by switching ON and OFF Assembly     -  
 Infra Read Sensor to Control DC motor Assembly     -  
 macro usage PIC assembly     -  
 assembler directives types     -  
 PIC Assembly For Loop Example     -  
 multiply two numbers in PIC assembly     -  
 playfair cipher assembly code     -  
 MULTIPLEXING Seven SEGMENT DECODER Assembly     -