hlorenzi / customasm

💻 An assembler for custom, user-defined instruction sets! https://hlorenzi.github.io/customasm/web/
Apache License 2.0
719 stars 56 forks source link

Relative Jumps? #143

Closed KnedlikMCPE closed 2 years ago

KnedlikMCPE commented 2 years ago

Hello, I'm using this for a virtual ISA under the name ETCa, which mainly uses relative jumps. So I'm quickly asking - is there a way to get the current line's beginning address or any other way to make relative jumps work? Thanks in advance, -Knedlik

hlorenzi commented 2 years ago

Yes! The $ variable always contains the address of the current instruction. You can see on the 6502 CPU definition how it's used with relative jumps.

KnedlikMCPE commented 2 years ago

Thanks, that does the job!