Datasheet

PSoC Designer IDE Guide, Document # 001-42655 Rev *B 97
Assembler
5.2.4 Destination of Instruction Results
The result of a given instruction is stored in the destination, which is placed next to the opcode in the
assembly code. This allows for a given result to be stored in a location other than the accumulator.
Direct and indexed addressed data RAM locations, as well as the X register, are additional destina-
tions for some instructions. The AND instruction, in Table 5-2, is a good illustration of this feature
(i2 = second instruction byte, i3 = third instruction byte). The ordering of the operands within the
instruction determines where the result of the instruction is stored.
5.3 Assembly File Syntax
Assembly language instructions reside in source files with .asm extensions in the source tree of the
Workspace Explorer. Each line of the source file may contain five keyword types of information.
Table 5-3 supplies critical details about each keyword type.
Instructions in an assembly file have one operation on a single line. For readability, separate each
keyword type by tabbing once or twice (approximately 5-10 white spaces). See the PSoC Designer
Assembly Language User Guide for type definitions and an example of assembly file syntax.
5.4 List File Format
When you build a project, a listing file with an .lst extension is created. The listing shows how the
assembly program is mapped into a section of code beginning at address 0. The linking (building)
process will resolve the final addresses. This file also provides a listing of errors and warnings, and a
reference table of labels.
.lst files are viewed after a project build in the Debugger subsystem under the Output tab of the
source tree.
Also generated during a build (in addition to the .lst file) are .rom, .mp, .dbg, and .hex files. The .hex
is used for debugging and programming. The .mp contains global symbol addresses and other
attributes of output.
Table 5-2. Destination of AND Instruction
Syntax Operation
AND A, expr acc acc & i2
AND A, [expr] acc acc & [i2]
AND A, [X + expr] acc acc & [x + i2]
AND [expr], A [i2] acc & [i2]
AND [X + expr], A [x + i2] acc & [x + i2]
AND [expr], expr [i2] i3 & [i2]
AND [X + expr], expr [x + i2] i3 & [x + i2]
Table 5-3. Keyword Types
Keyword Type Critical Details
Label A symbolic name followed by a colon (:)
Mnemonic An assembly language keyword
Operands Follows the Mnemonic
Expression Is usually addressing modes with labels and must be enclosed by parentheses
Comment
Can follow Operands or Expressions and start in any column if the first non-space charac-
ter is either a C++ style comment (//) or semicolon (;)