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
Thread Post new topic Reply to topic
fasmnewbie



Joined: 01 Mar 2011
Posts: 555
fasmnewbie 14 Jan 2018, 11:04
Mikl___ wrote:
Quote:
you should stick to FASM-ONLY tutorials

fasmnewbie,
you are too categorical in your judgments - only black or only white. And besides black and white there are a million shades of gray Image


As if Iczelion's tutorials are not MASM-only tutorials Very Happy
Post 14 Jan 2018, 11:04
View user's profile Send private message Visit poster's website Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 555
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 Shocked

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
Smile
Post 14 Jan 2018, 11:18
View user's profile Send private message Visit poster's website Reply with quote
Mikl___



Joined: 30 Dec 2014
Posts: 143
Location: Russian Federation, Irkutsk
Mikl___ 14 Jan 2018, 11:23
Quote:
As if Iczelion's tutorials are not MASM-only tutorials

  1. Iczelion's tutorials by Sulaiman Chang in FASM
  2. For: newbies : Iczelion's Assembly Tutorial in FASM

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
Post 14 Jan 2018, 11:23
View user's profile Send private message Visit poster's website Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 555
fasmnewbie 14 Jan 2018, 11:29
Mikl___ wrote:
Quote:
As if Iczelion's tutorials are not MASM-only tutorials

Iczelion's tutorials by Sulaiman Chang in FASM


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?
Post 14 Jan 2018, 11:29
View user's profile Send private message Visit poster's website Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 555
fasmnewbie 14 Jan 2018, 12:05
Quote:
In MASM, I can use both invoke ExitProcess and CALL ExitProcess too.
Liar Shocked

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.
Post 14 Jan 2018, 12:05
View user's profile Send private message Visit poster's website Reply with quote
Mikl___



Joined: 30 Dec 2014
Posts: 143
Location: Russian Federation, Irkutsk
Mikl___ 14 Jan 2018, 12:41
Quote:
Liar Shocked

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    
Post 14 Jan 2018, 12:41
View user's profile Send private message Visit poster's website Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 555
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 Very Happy
Post 14 Jan 2018, 12:59
View user's profile Send private message Visit poster's website Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2566
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).
Post 14 Jan 2018, 13:28
View user's profile Send private message Reply with quote
Estece



Joined: 08 Feb 2017
Posts: 10
Estece 04 Feb 2018, 18:18
Hi fasmnewbie.
Should You preserve rbx,rdi and rsi in Your 2b fastcall amd64 tutorial before using them?
Post 04 Feb 2018, 18:18
View user's profile Send private message Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 555
fasmnewbie 05 Feb 2018, 03:23
@estece. Don't have to. Have no further use for them afterwards.
Post 05 Feb 2018, 03:23
View user's profile Send private message Visit poster's website Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 555
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.
Post 05 Feb 2018, 03:34
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 05 Feb 2018, 05:46
fasmnewbie wrote:
Who says you can't write ASM code when you're drunk, high or horny?
What about all three: drunk, high and horny? And why would you be using your computer is such a situation? I can think of better things to do. Embarassed
Post 05 Feb 2018, 05:46
View user's profile Send private message Visit poster's website Reply with quote
Estece



Joined: 08 Feb 2017
Posts: 10
Estece 05 Feb 2018, 17:02
Post 05 Feb 2018, 17:02
View user's profile Send private message Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 555
fasmnewbie 06 Feb 2018, 01:05
Estece wrote:
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?
You're posting links about Prologue and Epilogue. This applies only to functions and PROC.

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
Post 06 Feb 2018, 01:05
View user's profile Send private message Visit poster's website Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 555
fasmnewbie 06 Feb 2018, 01:08
revolution wrote:
fasmnewbie wrote:
Who says you can't write ASM code when you're drunk, high or horny?
What about all three: drunk, high and horny? And why would you be using your computer is such a situation? I can think of better things to do. Embarassed
Any body who gets creative in such combo is a pervert.
Shocked
Post 06 Feb 2018, 01:08
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.