Open dplassgit opened 4 months ago
longtemp[0] = 1 is compiled to
; allocated RSI for calculations mov RSI, 5 ; const index; full index=1+dims*4+index*base size add RSI, RBX ; actual location mov DWORD [RSI], 1 ; store it!
but it could be
mov DWORD [RBX+5], 1 ; store it!
Even better, 386 supports completely orthogonal indexing, e.g., mov DWORD [RSI+RBX*4+5], 1
mov DWORD [RSI+RBX*4+5], 1
SEe https://www.plantation-productions.com/Webster/www.artofasm.com/DOS/ch04/CH04-3.html#HEADING3-49
longtemp[0] = 1 is compiled to
but it could be