Many people are new to 64-bit mode.
clears all 64-bits
puts 123 in low 32 and clears upper 32.
pushes 64-bits
Displacement mode is RIP relative.
That is a relative addressed memory location that must be within 2 Gig of the RIP.
Segment registers FS and GS are set with a model specific registers. I use them to point to the current task record and the current cpu core record. they are tricky to use because of the RIP relative addressing mode.
You cannot do this:
Code:
MOV RAX, FS:[TASK_DATA]
Instead...
Code:
XOR EAX,EAX
MOV RAX,FS:TASK_DATA[RAX]
I put the self address of the task record at offset zero in my task struct, so my compiler can use it easier.
Code:
XOR EAX,EAX
MOV RAX,FS:[RAX] ;self address of task record
MOV RAX,TASK_DATA[RAX]