Thursday, July 18, 2013

Assembly Tip

It look like we should not use memory address directly in Assembly. Let's take a look at following example:

movl $0xA9000, %ebx
rdtsc
movl %eax, (%ebx)
movl %edx, 4(%ebx)

It stores the TSC value to memory location 0xA9000.
If I use the memory location directly in the assembly, the code willl not work. 

rdtsc
movl %eax, 0xA9000
movl %edx, 0xA9004




No comments: