diff --git a/rdrand.asm b/rdrand.asm index d9654dd0..1cdb1c9b 100644 --- a/rdrand.asm +++ b/rdrand.asm @@ -141,12 +141,14 @@ OPTION EPILOGUE:NONE ;; RCX (in): arg1, byte* buffer ;; RDX (in): arg2, size_t bsize -MASM_RDRAND_GenerateBlock PROC ;; arg1:QWORD, arg2:QWORD +MASM_RDRAND_GenerateBlock PROC FRAME ;; arg1:QWORD, arg2:QWORD MWSIZE EQU 08h ;; machine word size buffer EQU rcx bsize EQU rdx +.endprolog + ;; Top of While loop RDRAND_GenerateBlock_Top: diff --git a/rdseed.asm b/rdseed.asm index f4ff7b51..ef13bef0 100644 --- a/rdseed.asm +++ b/rdseed.asm @@ -141,12 +141,14 @@ OPTION EPILOGUE:NONE ;; RCX (in): arg1, byte* buffer ;; RDX (in): arg2, size_t bsize -MASM_RDSEED_GenerateBlock PROC ;; arg1:QWORD, arg2:QWORD +MASM_RDSEED_GenerateBlock PROC FRAME ;; arg1:QWORD, arg2:QWORD MWSIZE EQU 08h ;; machine word size buffer EQU rcx bsize EQU rdx +.endprolog + ;; Top of While loop RDSEED_GenerateBlock_Top: diff --git a/x64dll.asm b/x64dll.asm index e2915b23..557afa02 100644 --- a/x64dll.asm +++ b/x64dll.asm @@ -1980,7 +1980,8 @@ SHA256_HashMultipleBlocks_SSE2 ENDP ;; ctrl = rcx ALIGN 8 -XGETBV64 PROC +XGETBV64 PROC FRAME +.endprolog ;; query DB 0fh, 01h, 0d0h ;; xcr = (EDX << 32) | EAX @@ -1996,9 +1997,11 @@ XGETBV64 ENDP ;; output = r8 ALIGN 8 -CPUID64 PROC +CPUID64 PROC FRAME ;; preserve per ABI - mov r9, rbx + mov [rsp+8], rbx +.savereg rbx, 8 +.endprolog ;; eax = func mov rax, rcx ;; ecx = subfunc @@ -2010,10 +2013,10 @@ CPUID64 PROC mov [r8+4], ebx mov [r8+8], ecx mov [r8+12], edx - ;; restore - mov rbx, r9 - ;; return + ;; return value mov rax, 1 + ;; restore + mov rbx, [rsp+8] ret CPUID64 ENDP