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

Macro idea #40

Open
velipso opened this issue Mar 25, 2023 · 1 comment
Open

Macro idea #40

velipso opened this issue Mar 25, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@velipso
Copy link
Owner

velipso commented Mar 25, 2023

What if macros were just:

.script
  export foo = {
    { 'temp:reg', 'shift:int', 'save:regrange' }, // parameters
    ` // body
    ldr   $temp, =123
    lsls  $temp, #$shift
    push  $save
    `
  }
.end

// invoked via:
movs  r1, #23
%foo  r0, 10, {r0-r3}
@velipso velipso added the enhancement New feature or request label Mar 25, 2023
@velipso
Copy link
Owner Author

velipso commented Jun 1, 2023

na, I want full scripting, I like something like this better:

.macro %foo temp, shift, save
  // sink script with temp, shift, save set to strings
  put """
    ldr  $temp, =123
    lsls $temp, #$shift
    push $save
  """
.end

%foo r0, 10, {r0-r3}

equivalent to:

.script
  var temp = 'r0'
  var shift = 10
  var save = '{r0-r3}'
  put """
    ldr  $temp, =123
    lsls $temp, #$shift
    push $save
  """
.end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant