Skip to content

ca65: can't .sizeof(proc) before proc is defined #478

@inexorabletash

Description

@inexorabletash

Example:

  ldy #.sizeof(foo)    ; fails
  ldy #sizeof_foo      ; workaround

.proc foo
  .byte 0
  .byte 1
.endproc
   sizeof_foo := * - foo

There's the "you shouldn't do that!" argument, but I'm disassembling existing code and can't alter the order. The workaround is to define a label just after the proc and do math instead.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions