c++ - Sign extension on x64 assembly dword -
i'm doing programming x64 assembly using masm in vs2013. know when provide integer assembly procedure (defined extern "c" in c++) integer goes rcx register. in case, integer 32 bits, size of dword. thing i'm not sure if compiler performs sign extension when placing dword rcx or 0 extension (zero'ing upper 32 bits , losing sign of dword). if can confirm compiler in instance (since cannot manually use movsxd , preserve sign myself) appreciated.
32bit integers passed in 32bit part of register (ecx
etc), meaning upper half zeroed. doesn't matter, sign not lost, it's not uselessly copied 32 high bits. if work 32bit part of register (which normal when operating on 32bit data), should be. when upcasting 64bit need sign extension.
Comments
Post a Comment