Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels and $ inside asm blocks #115

Open
Emmett81 opened this issue Oct 8, 2021 · 3 comments
Open

Labels and $ inside asm blocks #115

Emmett81 opened this issue Oct 8, 2021 · 3 comments

Comments

@Emmett81
Copy link
Contributor

Emmett81 commented Oct 8, 2021

This is not an issue I expect to be resolved at the moment, but certainly a reminder that it is a valid use-case. It seems customasm is not designed to support single instruction architectures by lack of a true macro mnemonic. The two main issues:

  1. You can't define a relative label inside a asm{}
  2. $ will always reference the first asm{} IP even when referencing other asm{}
@hlorenzi
Copy link
Owner

As we've discussed on Discord, there's the problem of asm blocks being available in any kind of expression context, even if the address isn't aligned. For example:

#ruledef {
    jmp {addr: u8} => 0xaa @ addr
}

#d4 0xf
#d4 asm { jmp $ }

So labels wouldn't work either. But if the address is indeed aligned, then I think the idea is workable. We'll just have to continue erroring out on misaligned addresses.

@Emmett81
Copy link
Contributor Author

Emmett81 commented Oct 11, 2021

When it comes to $ I understand the problem. But your example should be equivalent to the one below in a way. Both fail with that error. So yes, it should keep failing like that by design.

#ruledef {
    jmp {addr: u8} => 0xaa @ addr
}

#d4 0xf
jmp $

@Emmett81 Emmett81 reopened this Oct 11, 2021
@Emmett81
Copy link
Contributor Author

Emmett81 commented Oct 11, 2021

I'm sorry, I'm an idiot. Tried to find out how to syntax highlight assembly and clicked the wrong button closing the issue. :) Yeah, I might not be the sharpest tool in the shed. lol

hlorenzi pushed a commit to Emmett81/oldcustomasm that referenced this issue Oct 18, 2021
hlorenzi pushed a commit to Emmett81/oldcustomasm that referenced this issue Oct 18, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 18, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 18, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 18, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 19, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 19, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 20, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 21, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 21, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 21, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 21, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 21, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 21, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Oct 22, 2021
hlorenzi pushed a commit to Emmett81/oldcustomasm that referenced this issue Oct 23, 2021
Emmett81 added a commit to Emmett81/oldcustomasm that referenced this issue Nov 2, 2021
hlorenzi pushed a commit to Emmett81/oldcustomasm that referenced this issue Nov 7, 2021
@hlorenzi hlorenzi changed the title asm{} does not behave like a macro Labels and $ inside asm blocks May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants