flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > How to make a Call direct address |
Author |
|
revolution 08 Jan 2021, 11:08
Code: my_address dd 5C03B0h call [my_address] |
|||
08 Jan 2021, 11:08 |
|
revolution 08 Jan 2021, 11:12
myoffice91 wrote: Question? myoffice91 wrote: I know that the clock cycle is longer call dword [ConstExeCallTest1] If this single instruction is going to cause a bottleneck then I would be very surprised. |
|||
08 Jan 2021, 11:12 |
|
myoffice91 08 Jan 2021, 11:13
revolution wrote:
I use this method, but I'm tired of creating a lot of constant variables. I only need one line of code like this CreateCalladress 5C03B0h It may be better to modify FASM.exe to support call 5C03B0h I don't know where the exact source code is for "call" for the support address, not the names. |
|||
08 Jan 2021, 11:13 |
|
revolution 08 Jan 2021, 11:19
If you modify fasm it won't help. It is the CPU that doesn't have the instruction.
Code: macro CreateCalladress address { local ..addr, ..call jmp ..call ..addr dd address ..call: call [..addr] } CreateCalladress 5C03B0h |
|||
08 Jan 2021, 11:19 |
|
Roman 08 Jan 2021, 11:43
Quote:
Wau ! My solution Code: macro CreateCalladress address { local ..return push ..return jmp dword [address] ..return: } macro CreateCalladress address,Name { local ..return push ..return jmp dword [address] ..return: Name equ ..return-4 } Last edited by Roman on 08 Jan 2021, 12:11; edited 2 times in total |
|||
08 Jan 2021, 11:43 |
|
myoffice91 08 Jan 2021, 12:07
revolution wrote:
What does x86 not support the call instruction? see screenshot mov eax, dword ptr ds:[0x719DB05A] ; output 8EBE5352 Using calculator -> Programmer -> 4 bytes -> HEX 5C03B0h-719DB059h-5=8EBE5352h FASM - my macro incorrectly handling call address revolution wrote:
I will say that the worst instruction is add dword [edi], 12. One person complains that the game is slow or the sounds stutter, but he is a modern i7 processor and a different computer. is also the same. And I have no problem, the processor QUAD cache is 12MB. Clearly the cache memory is clogged due to the add dword [] instruction. =). revolution wrote:
An interesting macro, a coolly difficult disassembler. Not only are two extra instructions, but it is difficult how much length the distance to spoof the address. _____ updated the first post, because of the confused macro. Roman wrote:
Feedback: wow handy code! The code has become cleaner . I'm waiting for the solution revolutionary macro in one instruction call from address What is it needed for? in the game the events of the nanosecond does the function, but I didn't want to slow down the game and increase the CPU. [spoiler] I am developing Wizardry 8 Fan Patch 1.28 written under FASM [/spoiler] |
|||
08 Jan 2021, 12:07 |
|
revolution 08 Jan 2021, 12:11
If your PE file (I assume you are using a PE format) has relocations then you can't encode a fixed address in a call. It is all relative.
Also note that Roman's code isn't truly what you want. It doesn't call the address, it calls the dword value at the address. |
|||
08 Jan 2021, 12:11 |
|
myoffice91 08 Jan 2021, 12:18
revolution wrote: If your PE file (I assume you are using a PE format) has relocations then you can't encode a fixed address in a call. It is all relative. my code: Code: format PE GUI 4.0 DLL at 0 Saw the forum, developer Tomasz Grysztar https://board.flatassembler.net/topic.php?t=37 But it doesn't work. _____ I'm waiting, the great developer Tomasz Grysztar is able to solve problems: D |
|||
08 Jan 2021, 12:18 |
|
DimonSoft 09 Jan 2021, 21:10
myoffice91 wrote:
I hope you’re not really going to put it exactly there. |
|||
09 Jan 2021, 21:10 |
|
bitRAKE 10 Jan 2021, 08:59
Without relocation information, a zero base address will always fail - due to relocation being required.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
10 Jan 2021, 08:59 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.