flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > proc stdcall64 |
Author |
|
Fatih 13 Nov 2010, 20:24
Hi.
I Need translated version of proc32.inc to programming 64 bit programming All register/mem pushed 64 bit [rsp+xx] points parameters calling conversation is stdcall Thanks all
|
|||||||||||
13 Nov 2010, 20:24 |
|
baldr 13 Nov 2010, 20:48
Fatih,
MACRO\PROC64.INC isn't good enough? |
|||
13 Nov 2010, 20:48 |
|
baldr 13 Nov 2010, 21:18
Fatih,
You don't have to follow standard calling conventions, and Tomasz don't have to follow your desires. I think it's fair. |
|||
13 Nov 2010, 21:18 |
|
bitRAKE 14 Nov 2010, 03:34
The current package macros should be sufficient examples to construct similar 64-bit macros. Please, post what you have and we can help work through your implementation.
|
|||
14 Nov 2010, 03:34 |
|
Fatih 14 Nov 2010, 14:35
Code: ;Assembly Code: ;------------------------------------------------------ include "proc32.inc" org 0 use64 main: ;parameters pushed on stack on reverse order ;-------------------------------------------------- stdcall stdcall64, r8, r9, qword 1 ret align 4 proc stdcall64 stdcall uses rax r8 r15, \ @x:QWORD, @y:QWORD, @color:QWORD mov r12,[@x] mov r15,[@y] ret ;retq ;if retq used stack cleaning (leave, ret 0x18) not inluded. endp Disassembly Code: ;------------------------------------------------------ 00000000 6801000000 push dword 0x1 ;WRONG!!!!!!!!!! 00000005 4151 push r9 00000007 4150 push r8 00000009 E802000000 call dword 0x10 0000000E C3 ret 0000000F 90 nop 00000010 55 push rbp 00000011 4889E5 mov rbp,rsp 00000014 50 push rax 00000015 4150 push r8 00000017 4157 push r15 00000019 4C8B6508 mov r12,[rbp+0x8] 0000001D 4C8B7D10 mov r15,[rbp+0x10] 00000021 415F pop r15 00000023 4158 pop r8 00000025 58 pop rax 00000026 C9 leave 00000027 C21800 ret 0x18 and modified proc32.inc file below NOTE: changed macro instruction only esp -> rsp pushd -> pushq
|
|||||||||||
14 Nov 2010, 14:35 |
|
bitRAKE 14 Nov 2010, 16:33
No such instruction as PUSH imm64.
stdcall stdcall64, r8, r9, 1 PUSHQ, PUSHD, etc... are superfluous - if the general form were used then the macros could be used across USE16, USE32, USE64 with little or no change. FASM selects the appropriate instruction based on code selection. |
|||
14 Nov 2010, 16:33 |
|
Fatih 14 Nov 2010, 19:57
Thanks baldr & bitRAKE for help
I have to work a little more "AMD64 Architecture Programmer’s Manual Volume 3: General-Purpose and System Instructions" Good work |
|||
14 Nov 2010, 19:57 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.