Skip to content

Various questions about SLEIGH constructors and debugging them #6350

Answered by GhidorahRex
Zinfidel asked this question in Q&A
Discussion options

You must be logged in to vote

I'm trying to implement some pseudo-instructions for MIPS mostly just for my own edification, and have run into a number of issues I'd love to have some clarity on. Answers to any given question will be greatly appreciated!

1. Is it possible for one token in a concatenated, variable-length instruction, to "back reference" an operand defined in a previous token for the purpose of using it as a constraint?

Say I want to implement this pseudo-instruction:

#la      rt,      imm32        ;load address   (alias for lui rt / addiu rt)

lui,     rt,      imm16
addiu,   rt, rt,  simm16       # rs == rt here

The pseudo-instruction should match so long as rt is the same register in all three place…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Zinfidel
Comment options

@GhidorahRex
Comment options

@Zinfidel
Comment options

Answer selected by Zinfidel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants