Case sensitive

Define directives

  • .def temp = r15
    • Maps temp to r15
    • Preprocesses
  • Constants
    • .EQU A = B
  • Variable
    • .SET
  • Comments ;[Text]

.org -> origin
.cseg -> code segment
.dseg -> data segment
.db


1
2
3
4
5
6
.dseg
.org 0x100        ; from address 0x100
vartab: .BYTE 4   ; reserve 4 bytes in SRAM from address 0x100

.cseg             ; Start code segment (Default start location 0x0000)
const: .DW 10, 0x10, 0b10, -1  ; Write 10, 16, 2, -1 in program memory, each value takes 2 bytes

.BYTE -> Define space in data memory

.DB -> store byte in program memory
.DW -> store word in program memory

.include “m2560def.inc”


Alignment - extra null pads

Constant values -> program memory

1
2
3
Can put expression -> ldi r26, low(label + 0x0ff0)
                                        operator
                                  operand

$A0 == 0xA0

cp - compare cpc - compare with carry