Mid-Range PIC ? Microcontroller Architectural Overview
2.4
ASSEMBLER BASICS
Numbers in the Assembler
Unless otherwise specified, the assembler assumes any numeric constants in the
program are hexadecimal (base 16). Binary (base 2), Octal (base 8), Decimal (base
10), and ASCII coding are also supported.
Hexadecimal
Decima l
Octal
Binary
ASCII
12 or 0x12 or H'12 '
.12 or D'12'
O'12'
B'00010010'
A'c' or 'c'
Org (Origin)
Org tells the Assembler an address at which to start generating code. Normally
we start coding at the Reset vector address ‘ 0000 ’, but it could be anywhere.
Baseline devices have a Reset vector at the last location in program memory, so
it’s good practice to have a GOTO instruction pointing to the beginning of the
program.
End
End tells the assembler to stop assembling. There must be one at the end of the
program. It does not necessarily have to be at the end of the file, but nothing after
the end statement will be assembled.
Defining Data Memory Locations
There are three ways to name a location (see Example 2-1). All are equivalent in
that the location name label will be substituted with the value assigned to it during
assembly.
EXAMPLE 2-1:
DEFINING DATA MEMORY
#define Length
0x20
;c-like syntax
Length
equ
0x20
;equate 0x20 with the symbol
cblock
Length
Width
Area:2
Girth
0x20
;start a block of variables
;this will be at address 0x20
;this will be at address 0x21
;this is 2 bytes long, starting at
;address 0x22
;this will be at address 0x24
endc
Note that if used as a literal, the label names will take on the value assigned. If used as
an address operand in an instruction, the label names point to the contents of the file
register with the address of the label’s value.
Unless there is a reason to name a specific location address, the cblock/endc
method is preferred. The advantage is that as variables come and go through the
development process, the cblock keeps the block to a minimum. Using one of the
other methods, you may have to go back and find an unused location.
? 2007 Microchip Technology Inc.
DS41296B-page 11
相关PDF资料
DM240011 KIT STARTER MPLAB FOR PIC24F MCU
DM240021 KIT STARTER MPLAB FOR PIC24H
DM240311 BOARD DEV PIC24F16KA102 XLP
DM300018 BOARD DEMO DSPICDEM 2
DM300019 BOARD DEMO DSPICDEM 80L STARTER
DM300024 KIT DEMO DSPICDEM 1.1
DM330012 KIT USB STARTER FOR DSPIC33E
DM330013 MICROSTICK DSPIC33F/PIC24H BOARD
相关代理商/技术参数
DM240002 制造商:Microchip Technology Inc 功能描述:Explorer 16 kit(44-PIN) w/ PIC24FJ64GA00
DM240011 功能描述:开发板和工具包 - PIC / DSPIC MPLAB Starter Kit for PIC24F MCU RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240012 功能描述:开发板和工具包 - PIC / DSPIC PIC24E USB Starter Kit RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240013-1 功能描述:开发板和工具包 - PIC / DSPIC Microstick for 3V PIC24F K-series RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240013-2 功能描述:开发板和工具包 - PIC / DSPIC RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240014 制造商:Microchip Technology Inc 功能描述:MICROSTICK FOR USB PIC24F - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:ACCY MICROSTICK USB PIC24F 制造商:Microchip Technology Inc 功能描述:MICROSTICK USB PIC24F
DM240015 制造商:Microchip Technology Inc 功能描述:MPLAB STARTER KIT FOR PIC24F INTELLIGENT INTEGRATED ANALOG - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:KIT MPLAB STARTER FOR PIC24F ANL 制造商:Microchip Technology Inc 功能描述:PIC24F GC INTELLIGENT ANALOG DEV KIT 制造商:Microchip Technology Inc 功能描述:PIC24F, GC INTELLIGENT ANALOG, DEV KIT 制造商:Microchip Technology Inc 功能描述:Starter Kit for PIC24F Intelligent Integrated Analog Series 制造商:Microchip Technology Inc 功能描述:Development Boards & Kits - PIC / DSPIC 制造商:Microchip Technology Inc 功能描述:PIC24F, GC INTELLIGENT ANALOG, DEV KIT, Silicon Manufacturer:Microchip, Core Arc 制造商:Microchip Technology Inc 功能描述:PIC24F, GC INTELLIGENT ANALOG, DEV KIT, Silicon Manufacturer:Microchip, Core Architecture:PIC, Core Sub-Architecture:PIC24, Silicon Core Number:PIC24FJ128GC010, Silicon Family Name:PIC24FJxxxGCxxx, Kit Contents:Starter Board 制造商:Microchip Technology Inc 功能描述:MPLAB Starter Kit for PIC24F Intelligent Integrated Analog, Starter Kits
DM240021 功能描述:开发板和工具包 - PIC / DSPIC MPLAB STARTER KIT FOR PIC24H RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压: