flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > [bug] Using PROC64.INC with initialised strings

Author
Thread Post new topic Reply to topic
system error



Joined: 01 Sep 2013
Posts: 670
system error 22 Oct 2014, 07:45
I have 3 questions;

#1
I tried this simple code;
Code:
format ELF64 executable 3
include 'PROC64.INC'

call    display_string
call    exit

proc display_string
        locals
        hello db 'Hello 64-bit World'
        endl
        
        mov     edi,1
        mov     edx,18
        mov     eax,1
        lea     rsi,[hello]
        syscall
        ret
endp    


Yields;
Code:
Hell-bitld

------------------
(program exited with code: 0)
Press return to continue    

what's wrong? Is this the correct way to use PROC64.INC

#2
How to get rid of those syscall '(program exited with....)' part? I use geany as IDE.

#3
This site is very slow these days. In fact totally inaccesible for a couple of days last week. Why?
Post 22 Oct 2014, 07:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20357
Location: In your JS exploiting you and your system
revolution 22 Oct 2014, 08:13
system error wrote:
#3
This site is very slow these days. In fact totally inaccesible for a couple of days last week. Why?
Offtopic, but it may have been John Found's fault:

http://board.flatassembler.net/topic.php?t=17353
Post 22 Oct 2014, 08:13
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 22 Oct 2014, 08:32
revolution wrote:
system error wrote:
#3
This site is very slow these days. In fact totally inaccesible for a couple of days last week. Why?
Offtopic, but it may have been John Found's fault:
you mean John the Fresh?
John come here. U need to be spanked! HAHAHA
Post 22 Oct 2014, 08:32
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20357
Location: In your JS exploiting you and your system
revolution 22 Oct 2014, 08:39
This appears to be a bug in the macro. At line 452 we have:
Code:
      load qword@initlocal dword from name+position@initlocal    
I expect this should be loading a qword instead of dword.

Moving this to compiler internals (since it is not related to Linux) and stickying.
Post 22 Oct 2014, 08:39
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: 20357
Location: In your JS exploiting you and your system
revolution 23 Oct 2014, 13:46
There is a new version of the Windows download that fixes this and has a few other small changes also.
Post 23 Oct 2014, 13:46
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 23 Oct 2014, 19:55
Ok got it. It's in the 1.71.23 Windows package. Fixed.

One question: Why not include it in the standard Linux package? We could use some HLL constructs in Linux as well.

Thanks.
Post 23 Oct 2014, 19:55
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 23 Oct 2014, 21:40
system error wrote:
One question: Why not include it in the standard Linux package? We could use some HLL constructs in Linux as well.
The calling convention for 64-bit Linux differs a lot from the one in 64-bit Windows. So you can use the "proc" variant from Windows package only if you're going to use it for your own functions internally.
I should have created a separate "proc" package for 64-bit Linux, but I never really got to it.
Post 23 Oct 2014, 21:40
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 23 Oct 2014, 23:30
Tomasz Grysztar wrote:
system error wrote:
One question: Why not include it in the standard Linux package? We could use some HLL constructs in Linux as well.
The calling convention for 64-bit Linux differs a lot from the one in 64-bit Windows. So you can use the "proc" variant from Windows package only if you're going to use it for your own functions internally.
I should have created a separate "proc" package for 64-bit Linux, but I never really got to it.
Ok.

Wouldn't it be nice if FASM has its own calling convention? Something like

Code:
fasmcall ...     


To hell with C's and stdcall. Invent your own. FASM deserves its own niche and style Very Happy

(or is it even possible? LOLL)
Post 23 Oct 2014, 23:30
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20357
Location: In your JS exploiting you and your system
revolution 23 Oct 2014, 23:32
The great thing about standards is that there are so many of them.

http://xkcd.com/927/
Post 23 Oct 2014, 23:32
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 23 Oct 2014, 23:37
revolution wrote:
The great thing about standards is that there are so many of them.

http://xkcd.com/927/
We can wrap them all up under FASMCALL. hahaha
Post 23 Oct 2014, 23:37
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.