Datasheet 搜索 > 8位微控制器 > Microchip(微芯) > PIC18F47K40-I/P 数据手册 > PIC18F47K40-I/P 用户编程技术手册 2/52 页


¥ 22.933
PIC18F47K40-I/P 用户编程技术手册 - Microchip(微芯)
制造商:
Microchip(微芯)
分类:
8位微控制器
封装:
PDIP-40
描述:
MICROCHIP PIC18F47K40-I/P 微控制器, 8位, XLP, PIC18FxxKxx, 64 MHz, 128 KB, 4 KB, 40 引脚, DIP 新
Pictures:
3D模型
符号图
焊盘图
引脚图
产品图
页面导航:
功能描述在P5P8P11P13P14P15P33P35P41P42P46P49
导航目录
PIC18F47K40-I/P数据手册
Page:
of 52 Go
若手册格式错乱,请下载阅览PDF原文件

38 Chapter 2 ■ PIC18 Assembly Language Programming
2.2 Introduction
Assembly language programming is a method of writing programs using instructions that
are the symbolic equivalent of machine code. The syntax of each instruction is structured to
allow direct translation to machine code.
This chapter begins the formal study of Microchip PIC18 assembly language programming.
The format rules, specification of variables and data types, and the syntax rules for program state-
ments are introduced in this chapter. The rules for the Microchip MPASM
®
assembler will be
followed. The rules discussed in this chapter also apply to all other Microchip families of MCUs.
2.3 Assembly Language Program Structure
A program written in assembly language consists of a sequence of statements that tell the
computer to perform the desired operations. From a global point of view, a PIC18 assembly pro-
gram consists of three types of statements:
■
Assembler directives. Assembler directives are assembler commands that are used
to control the assembler: its input, output, and data allocation. An assembly
program must be terminated with an END directive. Any statement after the END
directive will be ignored by the assembler.
■
Assembly language instructions. These instructions are PIC18 instructions. Some
are defined with labels. The PIC18 MCU allows us to use up to 77 different
instructions.
■
Comments. There are two types of comments in an assembly program. The first type
is used to explain the function of a single instruction or directive. The second type
explains the function of a group of instructions or directives or the whole routine.
The source code of an assembly program can be created using any ASCII text file editor.
Each line of the source file may consist of up to four fields:
■
Label
■
Mnemonic
■
Operand(s)
■
Comment
The order and position of these four fields are important. Labels must start in column 1.
Mnemonics may start in column 2 or beyond. Operands follow the mnemonic. Comments may
follow the operands, mnemonics, or labels and can start in any column. The maximum column
width is 256 characters.
One should use space(s) or a colon to separate the label and the mnemonic and use space(s) to
separate the mnemonic and the operand(s). Multiple operands must be separated by commas.
2.3.1 The Label Fields
A label must start in column 1. It may be followed by a colon (:), space, tab, or the end of
line. Labels must begin with an alphabetic character or an underscore (_) and may contain
alphanumeric characters, the underscore, and the question mark.
Labels may be up to 32 characters long. By default, they are case sensitive, but case sensi-
tivity can be overridden by a command line option. If a colon is used when defining a label, it
is treated as a label operator and not part of the label itself.
器件 Datasheet 文档搜索
AiEMA 数据库涵盖高达 72,405,303 个元件的数据手册,每天更新 5,000 多个 PDF 文件