Class ArmWriter

Generates machine code for arm.

Hierarchy

Constructors

Properties

Memory location of the first byte of output.

Memory location of the next byte of output.

offset: number

Current offset in bytes.

Program counter at the next byte of output.

Methods

  • Eagerly cleans up memory.

    Returns void

  • Resolves label references and writes pending data to memory. You should always call this once you've finished generating code. It is usually also desirable to do this between pieces of unrelated code, e.g. when generating multiple functions in one go.

    Returns void

  • Puts an ADD U16 instruction.

    Parameters

    Returns void

  • Puts an ADD instruction.

    Parameters

    Returns void

  • Puts a B COND instruction referencing labelId, defined by a past or future putLabel().

    Parameters

    Returns void

  • Puts a B instruction referencing labelId, defined by a past or future putLabel().

    Parameters

    • labelId: string

    Returns void

  • Puts a BL instruction referencing labelId, defined by a past or future putLabel().

    Parameters

    • labelId: string

    Returns void

  • Puts a BLX instruction.

    Parameters

    Returns void

  • Puts code needed for branching/jumping to the given address.

    Parameters

    Returns void

  • Puts an OS/architecture-specific breakpoint instruction.

    Returns void

  • Puts a BRK instruction.

    Parameters

    • imm: number

    Returns void

  • Puts a BX instruction.

    Parameters

    Returns void

  • Puts raw data.

    Parameters

    Returns void

  • Puts a CMP instruction.

    Parameters

    Returns void

  • Puts a raw instruction.

    Parameters

    • insn: number

    Returns void

  • Puts a label at the current position, where id is an identifier that may be referenced in past and future put*Label() calls.

    Parameters

    • id: string

    Returns void

  • Puts an LDMIA MASK instruction.

    Parameters

    Returns void

  • Puts an LDR instruction.

    Parameters

    Returns void

  • Puts a MOV CPSR instruction.

    Parameters

    Returns void

  • Puts a MOV CPSR instruction.

    Parameters

    Returns void

  • Puts a NOP instruction.

    Returns void

  • Puts a RET instruction.

    Returns void

  • Puts a SUB U16 instruction.

    Parameters

    Returns void

  • Puts a SUB instruction.

    Parameters

    Returns void

  • Skips nBytes.

    Parameters

    • nBytes: number

    Returns void

Generated using TypeDoc