Use PROC FRAME and prolog for MASM (GH #1116)

This commit is contained in:
Jeffrey Walton 2023-06-25 16:49:11 -04:00
parent 001227705a
commit e6f1f81319
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 15 additions and 8 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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