3 ms·
This is a good blog post about instruction encoding. I like to use this data structure to describe how memory addressing works in long mode: register char
by jart 6y ago
This is a good blog post about instruction encoding. I like to use this data structure to describe how memory addressing works in long mode:
register char (*(*(*(*ram)[512])[512])[512])[4096] asm(cr3)
Basically each modrm pointer thingy goes through four layers of page table indirection for each memory access, in order to turn virtual memory addresses into real memory addresses. But it's mostly an implementation detail where access to the above data structure is restricted to the operating system only, unfortunately, and the closest thing we have to using it is the mmap api.