0

I am working on a project in x86 Assembly code, and I am stuck on the 'set' instruction. I do not know how to properly syntax it and construct an If statement. I have tried looking on Google, but nothing has been useful so far

Could someone tell me how to properly syntax the 'set' instruction?

I have tried putting just set on its own line with nothing next to it and it didn't work. Does it need something next to it for it to execute its function (a variable, another instruction, etc.)? Are there any more lines of code I need to add alongside it?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Brandon
  • 1
  • 1
  • 1
    Are you talking about `setcc`, as in `setz al` to set AL = ZF from EFLAGS? See Intel's manual: https://www.felixcloutier.com/x86/setcc. It's not a branch, you can only use it for an `if` statement if it was something like `if(foo==bar) x = 1; else x = 0;` – Peter Cordes Apr 15 '22 at 03:47
  • I am talking about 'setcc', yes, and you answered my question, thanks – Brandon Apr 15 '22 at 03:48

0 Answers0