flat assembler
Message board for the users of flat assembler.
Index
> Windows > Iczelion's Tutorial #2b Win64 fasm format Goto page Previous 1, 2 |
Author |
|
fasmnewbie 14 Jan 2018, 11:18
Quote: why is not sub rsp,50h ? with MASM compiler this does not happen As if MASM supports 64-bit invoke Now you're starting to see how bad things can be when using INVOKE or high-level statements. That's even worse in MASM 32. Once you declared it with PROTO, MASM won't allow you the flexibility to use a native CALL with it. In FASM, you can use both invoke ExitProcess and CALL ExitProcess. That's the kind of "extreme flexibility" I was talking about. But you didn't listen |
|||
14 Jan 2018, 11:18 |
|
Mikl___ 14 Jan 2018, 11:23
Quote: As if Iczelion's tutorials are not MASM-only tutorials In MASM, I can use both invoke ExitProcess and CALL ExitProcess too. Probably the problem is that English is not my native language. If I understand you correctly, you are trying to prove to me that FASM is a super dialect with extra abilities, I'm trying to explain to you that this is not so and that MASM has possibilities that the FASM does not support or I do not know about them. I believe that this dispute is about nothing Last edited by Mikl___ on 15 Jan 2018, 12:04; edited 2 times in total |
|||
14 Jan 2018, 11:23 |
|
fasmnewbie 14 Jan 2018, 11:29
Mikl___ wrote:
That doesn't take away the facts that the original tutorial was targetted for MASM users only. That's why we need people like you here to work on the 64-bit version of Iczelion's tutorials. In FASM-compliant style and approach. You want to help or not? |
|||
14 Jan 2018, 11:29 |
|
fasmnewbie 14 Jan 2018, 12:05
Quote: In MASM, I can use both invoke ExitProcess and CALL ExitProcess too. Code: .386 .model flat,c public main option casemap:none LowLevelProc PROTO :DWORD .code main: push ebp mov ebp,esp push eax call LowLevelProc leave ret align 4 LowLevelProc: push ebp mov ebp,esp ; a leaf leave ret 4 Error: Re-definition of LowLevelProc. That doesnt happen in FASM. You can declare a low-level proc OR high level PROC and still be accessible via both native call instruction AND high-level STDCALL / CCALL / INVOKE statements. |
|||
14 Jan 2018, 12:05 |
|
Mikl___ 14 Jan 2018, 12:41
Quote: Liar the dispute can go too far. Pick up words when talking to strangers Code: .386 .model flat,stdcall option casemap:none include d:\masm32\include\kernel32.inc includelib d:\masm32\lib\kernel32.lib extern _imp__ExitProcess@4:DWORD .code main: push 0 call _imp__ExitProcess@4 invoke ExitProcess,0 end main |
|||
14 Jan 2018, 12:41 |
|
fasmnewbie 14 Jan 2018, 12:59
@Mikl
You're using 3rd party macros. As if ML itself is not capable of correcting its own erratic behavior. That's pathetic isn't it? If you're not willing to help us, why don't you just say so. I was actually willing to help you in 64-bit translation works of Iczelion because I wanted to learn WinAPI too. But you seemed to be to fragile. There's nothing else I can do. Enjoy your day |
|||
14 Jan 2018, 12:59 |
|
Furs 14 Jan 2018, 13:28
@fasmnewbie +1
Seriously, asm is supposed to be simple. If you want higher level abstractions use C or C++. Reading MASM is like trying to decipher a bad HLL (at least it's not as incomprehensible as Haskell though). |
|||
14 Jan 2018, 13:28 |
|
Estece 04 Feb 2018, 18:18
Hi fasmnewbie.
Should You preserve rbx,rdi and rsi in Your 2b fastcall amd64 tutorial before using them? |
|||
04 Feb 2018, 18:18 |
|
fasmnewbie 05 Feb 2018, 03:23
@estece. Don't have to. Have no further use for them afterwards.
|
|||
05 Feb 2018, 03:23 |
|
fasmnewbie 05 Feb 2018, 03:34
Who says you can't write ASM code when you're drunk, high or horny? You can with FASM. Below is a 32-bit interpretation of #2b, when you have too many chemicals entering your brain, that is the point you can't tell the difference between your left and your right or which comes first, A or B.
Code: format PE GUI 5.0 include 'win32a.inc' MsgCaption db "Iczelion's Tutorial #2b",0 fmt db "hCursor = 0x%p",0Ah,"hIcon = 0x%p",0Ah,"hInstance =0x%p",0 val: ;Demo: implementing low STRUCT with dot operators .x1 dd ? .x2 rd 1 .x3 dd 0 .buffer rb (val-fmt) data import library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' include 'api\kernel32.inc' include 'api\user32.inc' end data entry $ ;Using native CALL push NULL call [GetModuleHandle] mov [val.x1],eax ;Using INVOKE invoke LoadIcon,NULL,IDI_APPLICATION mov [val.x2],eax ;Using STDCALL stdcall [LoadCursor],NULL,IDC_ARROW mov [val.x3],eax ;Using CCALL ccall [wsprintf],val.buffer,fmt,[val.x3],[val.x2],[val.x1] ;Using native CALL push MB_OK push MsgCaption push val.buffer push 0 call [MessageBox] ret That's FASM free-flowing flexibility that even C don't have. Let alone MASM ;D . P/S code above is not recommended though. |
|||
05 Feb 2018, 03:34 |
|
revolution 05 Feb 2018, 05:46
fasmnewbie wrote: Who says you can't write ASM code when you're drunk, high or horny? |
|||
05 Feb 2018, 05:46 |
|
Estece 05 Feb 2018, 17:02
https://docs.microsoft.com/en-us/cpp/build/prolog-and-epilog
https://docs.microsoft.com/en-us/cpp/build/caller-callee-saved-registers What about this fasmnewbie as Your program is running in Windows amd64 OS? |
|||
05 Feb 2018, 17:02 |
|
fasmnewbie 06 Feb 2018, 01:05
Estece wrote: https://docs.microsoft.com/en-us/cpp/build/prolog-and-epilog My first program does not create any PROC / functions. Its flat. Last edited by fasmnewbie on 06 Feb 2018, 01:09; edited 1 time in total |
|||
06 Feb 2018, 01:05 |
|
fasmnewbie 06 Feb 2018, 01:08
revolution wrote:
|
|||
06 Feb 2018, 01:08 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.