Let's Get a Loop
Notes
- This is Jorgensen 7.5
-
add dest, src
- dest = src + dest
- must be same size
- dest can't be imm
- both can not be memory
- If the operation does not involve a register, you might have to qualify memory size
-
add byte [incrementValue], 3
- The immediate can not be a quadword
- We do ++i so often that
inc dest exists
- There are other add instructions, but I would like to get on with it.
-
sub dest, src
-
dec dest
- The result of the operation can be tested
- But for the momemt we will be inefficent and use cmp
- Jorgensen 7.7.3
- cmp op, op
- Sets bits in the flags register
- Then we can take an action based on this
-
je label, jne label
-
jl label, jle label
-
jg label, jge label
- These are for signed numbers
- also
j label