Consider this assembly of NASA x64 syntax:
inc qword [rax]
inc qword [rcx]
inc qword [rdx]
inc qword [rbx]
inc qword [rsp]
inc qword [rbp]
inc qword [rsi]
inc qword [rdi]
After building using nasm (and linking to gnu ld) objdump -dit reports the following:
4000b0: 48 ff 00 incq (%rax)
4000b3: 48 ff 01 incq (%rcx)
4000b6: 48 ff 02 incq (%rdx)
4000b9: 48 ff 03 incq (%rbx)
4000bc: 48 ff 04 24 incq (%rsp)
4000c0: 48 ff 45 00 incq 0x0(%rbp)
4000c4: 48 ff 06 incq (%rsi)
4000c7: 48 ff 07 incq (%rdi)
The code generated for inc qword [rbp]makes sense since a mod field is specified. However, I canโt understand where it comes from 24during assembly inc qword [rsp]. I looked at coder64 #xFF and nothing there tells me that 24 should be generated. I am clearly missing something at a higher level.
source
share