Directives

dc

b, w, l

Stores a comma-separated list of values in memory. .b, .w and .l select 1, 2 or 4 bytes per numeric value. The default is .w, regardless of the value. Bare quoted text is stored as consecutive character bytes, padded with zeros to a multiple of the selected size. Use dc.b for text without padding. Word and long data start at an even address.

Example
dc.b 'Hello world!', 4, %10, $F, @10, 'a', some_label

ds

b, w, l

Reserves the given number of elements in memory without initializing them. .b, .w and .l select 1, 2 or 4 bytes per element. The default is .w. Word and long regions start at an even address.

Example
ds.l 100

dcb

b, w, l

Stores the given number of copies of the second operand in memory. .b, .w and .l select 1, 2 or 4 bytes per copy. The default is .w. For example, dcb.b 50, 1 writes fifty bytes, each containing 1.

Example
dcb.b 50, 1

org

Sets the address where the following instructions or data are assembled. For example, org $2000 places the next item at $2000. Within a section, it changes that section’s location counter.

Example
org $1000

equ

Defines a constant expression. The symbol cannot be redefined later.

Example
name equ 10

set

Defines a symbol’s value, which later set lines may replace. References use its most recent definition in assembly order, including across included files. Define it before using it in its own next value: count set 0 followed by count set count+1 makes count equal to 1.

Example
count set 0
count set count+1

end

Stops assembly and optionally selects the program entry point. Code after it is ignored.

Example
end START

reg

Names a register list for use by movem.

Example
saved reg d0-d3/a0-a2

fail

Raises an assembly error with the rest of the line as its message.

Example
fail Expected an argument

simhalt

Pauses execution until Run or Step resumes it at the next instruction. It assembles as $FFFF $FFFF, the two words EASy68K recognizes as a pause. Put it before data or after a finished example to keep execution from continuing into the following bytes. To end execution instead, use simulator task 9.

Example
simhalt

section

Selects one of sixteen location counters, numbered 0 through 15. Assembly starts in section 0 at $1000. The other sections start at zero, so use org to give them suitable addresses. Returning to a section resumes where its previous item ended. All sections share the same memory.

For example, section 1 followed by org $4000 and dc.l 10 places a long at $4000. Switch to section 0 to continue its code, then use section 1 again to place the next item at $4004.

Example
section 1

offset

Assigns offsets to labels without emitting bytes, starting at the given value. Data directives advance this offset so you can describe a structure’s fields. org ends the region and resumes placing bytes. org * restores the address that was current before the region.

    offset 0
kind:   ds.w 1       ; offset 0
value:  ds.l 1       ; offset 2
length: ds.b 0       ; total size: 6 bytes
    org *

With a0 pointing to a structure, move.l value(a0), d0 reads its long field.

Example
offset 0

include

Assembles another text file at this point. The path is relative to the including file, then the top folder.

Example
include 'lib/io.x68'

incbin

Copies the exact bytes of another file into memory at this point.

Example
incbin 'images/sprite.bin'

memory

Applies an access rule to an inclusive memory range. For example, memory rom $8000,$8FFF covers every address from $8000 through $8FFF.

  • rom: code and data may be read. Program writes are ignored.
  • read: code and data may be read. A program write causes a bus error.
  • protected: only supervisor code may read, write or execute here. Any access from user mode causes a bus error.
  • invalid: every program access causes a bus error.

A bus error raises exception vector 2, at $8 with the default vector table. Without a handler, the program ends and the Log identifies the refused access. See writing an exception handler.

There can be one range of each kind. A second memory directive for the same kind replaces its previous range. These rules apply to the running program. The debugger can still inspect and change the bytes, and the memory view displays the ranges as regions.

Example
memory rom $8000,$8FFF

opt

Selects the processor and optional assembler features for the whole assembled program. Without a processor option, the target is the 68000. Write opt p=68010 or opt p=68020 before any code or data to enable that processor’s instructions and addressing modes. The choice also applies to included files. Included files do not have independent processor settings.

The editor supports the 68010 instruction set and the 68020 instruction set except callm and rtm. The 68020 additions include scaled indexes and memory indirect addressing, long branches, long multiplication and division, cas, chk2, conditional traps, and bit fields.

opt bit enables bit-field instructions for a 68000 or 68010 program, as in EASy68K. Its addressing modes remain those of the chosen processor. A 68020 program already has bit fields. Write this option before any code or data too.

EASy68K’s listing options cre, mex, sex, war and cex, including their no forms, are accepted and have no effect.

Example
opt p=68020

list

Accepted for compatibility and ignored.

Example
list

nolist

Accepted for compatibility and ignored.

Example
nolist

page

Accepted for compatibility and ignored.

Example
page