The MASM Forum

Specialised Projects => Assembler/Compiler Technology => Topic started by: BogdanOntanu on May 22, 2012, 06:09:59 AM

Title: Solar Assembler location
Post by: BogdanOntanu on May 22, 2012, 06:09:59 AM
Hi all,

Since this forum used to be for developing your own assembler or compilers...

I will post the links to my own assembler: Sol_ASM:

Main page is here: http://www.oby.ro/sol_asm/index.html (http://www.oby.ro/sol_asm/index.html).
Manual is here: http://www.oby.ro/sol_asm/docs/sol_asm_manual.htm (http://www.oby.ro/sol_asm/docs/sol_asm_manual.htm)

Lately I have changed the license to a more permissive BSD like license.
This means you can use Solar Assembler for your hobby or commercial projects freely ;)

Even if I have not released a new version lately please be assured that Solar assembler is fully functional and under active development and support.

Description:
==============
SOLAR Assembler is a modern multipass macro assembler that can compile 16/32/64 bits code and runs on Windows, Linux, MacOSX and Solar_OS

A few Features:
 
Title: Re: Solar Assembler location
Post by: GusNunnery on February 03, 2014, 09:26:28 PM
Quote from: BogdanOntanu on May 22, 2012, 06:09:59 AM
Hi all,

Since this forum used to be for developing your own assembler or compilers...

I will post the links to my own assembler: Sol_ASM:

Main page is here: http://www.oby.ro/sol_asm/index.html
Manual is here: http://www.oby.ro/sol_asm/docs/sol_asm_manual.htm

Lately I have changed the license to a more permissive BSD like license.
This means you can use Solar Assembler for your hobby or commercial projects freely ;)

Even if I have not released a new version lately please be assured that solar panel (http://www.shinesolar.net) is fully functional and under active development and support.

Description:
==============
SOLAR Assembler is a modern multipass macro assembler that can compile 16/32/64 bits code and runs on Windows, Linux, MacOSX and Solar_OS

A few Features:

  • Fast on huge and complex projects: 350.000 lines per second
  • Can directly generate PE32/64, Binary 16/32/64, DLL32/64
  • Can output OMF32, COFF32/64, ELF32/64 and MachO32 OBJ
  •     Can encode 16/32/64 ASM code 
  •      Strong recursive and nested MACRO system
  •      Includes a rich set of High Level primitives:
  •          .IF .ELSEIF .ELSE .ENDIF with AND/OR/NOT multiple conditions
  •          PROC, ARGS, LOCALS, USES
  •          INVOKE with ADDR support
  •         STRUCT, ENUM, UNION
  •          .REPEAT .UNITIL
  •         MACRO, MARGS, VARARG, EXITM
  •          #if, #ifdef, #if_used, #else
  •         does not need PROTO, checks PROC arguments 
  •      Includes mini in memory resource compiler
  •      Emits Listing in standard text format
  •      Emits Debug Output in COFF format and an easy to read text format
  •      Multiplatform, runs on:
  •         WIn95, Win98, Windows XP, VISTA, Windows 7 32 and 64 bits
  •          Mac OS X 
  •          Unix / Linux and other unix like OSes that can link with an ELF libc
  •          Solar OS 
  •      It is fully written in ASM, Compiles itself
  •      Compiles huge and complex ASM projects like:
  •          Solar OS
  •          Hostile Encounter RTS Game 
  •      Has a rich manual and a set of samples to get you started 
[/u]

Thanks for sharing such detiled informative post about solar assembler.. I am looking to get one soon so the information will help me lot.
Title: Re: Solar Assembler location
Post by: Gunther on February 03, 2014, 09:37:40 PM
Hi GusNunnery,

yes, SOLAR Assembler is a good tool and worth a try. And welcome to the forum.

Gunther
Title: Re: Solar Assembler location
Post by: Vortex on January 05, 2015, 01:38:11 AM
Hi Bogdan,

Trying to reach your website http://oby.ro , I get the following message :

QuoteAcest site este suspendat!

I guess it means this site is suspended.
Title: Re: Solar Assembler location
Post by: BogdanOntanu on January 06, 2015, 09:41:05 AM
Hi Vortex,

The "suspended" message is the "option" of the host provider.  In fact I have stopped the hosting contract  for  the site voluntary somewhere arround August  2014 if I recall corectly.  I have not decided yet if I will make any future efforts to put the site up again.

The Solar Assembler and Solar OS and a few other undisclosed presonal projects are still under my active development but for the time being I do not want to share them or their status and make them public anymore.

Please excuse for any inconveniences and thank you and others for your support / feedback.

Best regards,
Bogdan Ontanu


Title: Re: Solar Assembler location
Post by: GoneFishing on January 07, 2015, 03:25:13 AM
Hi Bogdan,

May I ask you a question about self-assembling assemblers?
Sol_ASM is written in Sol_ASM and assembled with sol_asm1 , that's why it's called sol_asm2 , right?  Then, in what language was developed sol_asm1 itself and what assembler / compiler was it built with ?   

Title: Re: Solar Assembler location
Post by: BogdanOntanu on January 07, 2015, 09:46:00 AM
The very first version of Sol_ASM was assembled in TASM as far as I recall.

Also my first important milestone was to be able to compile itself (this is why I used very little from TASM's features) Once Sol_ASM was self asembling I started the sol_asm1 / sol_Asm2 carousel.
Title: Re: Solar Assembler location
Post by: BogdanOntanu on February 04, 2015, 07:08:54 AM
The site will be or already is back on-line so you can again download Sol_Asm from there.
http://www.oby.ro/sol_asm/index.html (http://www.oby.ro/sol_asm/index.html)


Title: Re: Solar Assembler location
Post by: GoneFishing on February 04, 2015, 07:13:46 AM
Thank you for reply.
Nice to see your site is on-line again
Title: Re: Solar Assembler location
Post by: Vortex on February 04, 2015, 07:25:36 AM
Hi Bogdan,

Thanks for your efforts. Much appreciated.
Title: Re: Solar Assembler location
Post by: hutch-- on February 06, 2015, 10:29:37 AM
Glad to see Bogdan's world back up and running. Wish I had an extra life so I could do some work in SolAsm, its looking like an excellent tool.
Title: Re: Solar Assembler location
Post by: BogdanOntanu on February 07, 2015, 10:59:10 AM
Hi Hutch,

Thanks for your nice words ;)

A few news:
- The site is there to stay from now on... I have payed it in advance for a long time.
- The site will get a nice redesign in the next months.
- Sol_Asm and Solar_Os are being re-worked/converted to 64 bits native
- The 32 bits versions will continue to be supported and kept in sync with the new 64 bits versions.

Best regards,
Bogdan Ontanu

Title: Re: Solar Assembler location
Post by: Gunther on February 09, 2015, 11:42:37 PM
Bogdan,

Quote from: BogdanOntanu on February 07, 2015, 10:59:10 AM
A few news:
- The site is there to stay from now on... I have payed it in advance for a long time.
- The site will get a nice redesign in the next months.
- Sol_Asm and Solar_Os are being re-worked/converted to 64 bits native
- The 32 bits versions will continue to be supported and kept in sync with the new 64 bits versions.

that's good news. Will SolAsm support AVX, AVX2, AVX512? If so, it could be a nice alternative to jWasm and it's under active development.

Gunther
Title: Re: Solar Assembler location
Post by: rrr314159 on February 10, 2015, 03:45:32 AM
Gunther I'm sure this implication was unintended, but in case anyone should misunderstand ...
Quote...it could be a nice alternative to jWasm and it's under active development.
Since the Australian Open is history, JWasm is, no doubt, again under active development  :biggrin:
Title: Re: Solar Assembler location
Post by: Gunther on February 10, 2015, 05:30:13 AM
Quote from: rrr314159 on February 10, 2015, 03:45:32 AM
Since the Australian Open is history, JWasm is, no doubt, again under active development  :biggrin:

Sure, but an alternative is not so bad. Furthermore, it seems to me that some parts of jWasm's AVX support is buggy. We had an appropriate discussion about that here (http://masm32.com/board/index.php?topic=3227.msg35416#msg35416).

Gunther
Title: Re: Solar Assembler location
Post by: BogdanOntanu on February 10, 2015, 08:13:38 AM
Quote from: Gunther on February 09, 2015, 11:42:37 PM
Bogdan,

Quote from: BogdanOntanu on February 07, 2015, 10:59:10 AM
A few news:
- The site is there to stay from now on... I have payed it in advance for a long time.
- The site will get a nice redesign in the next months.
- Sol_Asm and Solar_Os are being re-worked/converted to 64 bits native
- The 32 bits versions will continue to be supported and kept in sync with the new 64 bits versions.

that's good news. Will SolAsm support AVX, AVX2, AVX512? If so, it could be a nice alternative to jWasm and it's under active development.

Gunther

Hi Gunther,

Yes Sol_Asm will support the latest instruction sets.

It does support quite a lot as it is now.

If you have any instructions that you want to see implemented fast ... then just let me know here and I will try to implement them  ASAP ;)

Best reagrds,
Bogdan
Title: Re: Solar Assembler location
Post by: rrr314159 on February 10, 2015, 01:36:42 PM
@Gunther
QuoteSure, but an alternative is not so bad. Furthermore, it seems to me that some parts of jWasm's AVX support is buggy.
Agree re alternatives - "Let a thousand flowers bloom". I'd rather see everyone together on the same project, though; assembler is a big job. Admire Bogdan, Habran, and all others working to support me :P Hope someday to help also. re AVX I've been using JWasm and MASM successfully, each has exactly one problem I know of, since Habran (I assume) fixed the square root. Both can be worked around. However I've exercised less than half the commands and haven't touched AVX2.

@BogdanOntanu,
Sorry don't mean to hijack your thread, thanks for Sol ASM, great project. Like that it compiles itself. Fixes a number of MASM's quirks, e.g. logical treatment of []. Many nice touches like REV, Olly symbol support, etc. Big project, 64 bits complicates things, apparently you're not "brave enough to be lazy"  :biggrin:
Title: Re: Solar Assembler location
Post by: Gunther on February 11, 2015, 04:52:25 AM
Quote from: rrr314159 on February 10, 2015, 01:36:42 PM
Agree re alternatives - "Let a thousand flowers bloom". I'd rather see everyone together on the same project, though; assembler is a big job. Admire Bogdan, Habran, and all others working to support me :P Hope someday to help also. re AVX I've been using JWasm and MASM successfully, each has exactly one problem I know of, since Habran (I assume) fixed the square root. Both can be worked around. However I've exercised less than half the commands and haven't touched AVX2.

Bogdan is a hard working man. He's developing SolAsm and SolOs since many years, both with success.

All my projects in the last 2 years have different versions: One for MASM/JWASM and the other for YASM/NASM. Since SolAsm is under active development, I could do a third SolAsm version. Why not?

Gunther
Title: Re: Solar Assembler location
Post by: BogdanOntanu on February 11, 2015, 05:25:14 AM
Quote from: rrr314159 on February 10, 2015, 01:36:42 PM
...
@BogdanOntanu,
Sorry don't mean to hijack your thread, thanks for Sol ASM, great project. Like that it compiles itself. Fixes a number of MASM's quirks, e.g. logical treatment of []. Many nice touches like REV, Olly symbol support, etc. Big project, 64 bits complicates things, apparently you're not "brave enough to be lazy"  :biggrin:

Sol_Asm already has 64 bits support. it can directly generate 64 bits code for PE, ELF, MSCOFF and binary (for OS development).

What I mean by "64 bits" is making Sol_Asm and 64 bits application itself (currently it is an 32 bits application)


Title: Re: Solar Assembler location
Post by: K_F on April 08, 2016, 08:02:32 AM
Any more news here... ?
:biggrin:
Title: Re: Solar Assembler location
Post by: BogdanOntanu on April 08, 2016, 08:20:53 AM
Quote from: K_F on April 08, 2016, 08:02:32 AM
Any more news here... ?
:biggrin:

There is a new version: v.0.36.16 released on 2016.03.30

- It fixes a bug in x64 REX prefix encoding
Title: Re: Solar Assembler location
Post by: Vortex on April 09, 2016, 04:20:55 AM
Hi Bogdan,

What happened to the Solar Forums? I receive the following message :

QuoteNot Found

The requested URL /forum was not found on this server.
Title: Re: Solar Assembler location
Post by: BogdanOntanu on April 09, 2016, 08:38:58 AM
Hi Vortex,

Yes, I have removed the forums since almost nobody was posting there anymore :D


Title: Re: Solar Assembler location
Post by: jj2007 on April 09, 2016, 11:14:25 AM
Quote from: hutch-- on February 06, 2015, 10:29:37 AMWish I had an extra life so I could do some work in SolAsm, its looking like an excellent tool.

I can echo that :t
Title: Re: Solar Assembler location
Post by: BogdanOntanu on April 09, 2016, 11:54:03 PM
Quote from: jj2007 on April 09, 2016, 11:14:25 AM
Quote from: hutch-- on February 06, 2015, 10:29:37 AMWish I had an extra life so I could do some work in SolAsm, its looking like an excellent tool.

I can echo that :t

As always you guys are too kind ;) thank you.

Today I use SOL_ASM for all my asm projects hence it works.

However Sol_Asm needs some development. It is functional but still rough at edges (spaces) and has some quirks.
Until I reach version 1.0 I think that you are better suited by MASM/MASM32 or JWASM.

Unless you like to live on the edge ... and test new things... that is ;))

Title: Re: Solar Assembler location
Post by: GoneFishing on June 09, 2016, 04:56:33 AM
Hi, Bogdan
Today I've downloaded and built ( on Linux x64 machine ) your latest version of SOL_ASM.
Lin32 sample has no problem when compiled as 32 bit and has the same problem that was mentioned  in this post (http://masm32.com/board/index.php?topic=5130.msg55212#msg55212) .
Could you , please,  provide a working Lin64 sample ? I guess I'm doing something wrong   :icon_confused:

Thanks
Title: Re: Solar Assembler location
Post by: mineiro on June 09, 2016, 02:21:14 PM
hello Sir GoneFishing;
follow a simple native example 01.asm and some comments

section "text" class_code alias ".text"
.USE64
sys_exit equ 60
.text
.entry _start
_start:
mov rdi,77
mov rax,sys_exit
syscall

to assemble, suposing solasm on bin folder, if not, append a "./" before: sol32 01.asm 01.o -elf64
now, check object file with command "file 01.o", you will see that have x86_64 and i386 on header, we should change that by hand,
open hexadecimal editor, goto address 19 and change "03h" to "3eh", save and do a "file 01.o" again, it should work and ready to link.

I have created a script to do this instead of hexadecimal editor, change to your needs.
It works by isolating byte 19 of file object, but I'm using bash shell so it inserts an LF when I echo, this is why I remove again 1 byte from middle:
head --bytes=18 01.o > start
echo -e "\x3e" > middle
head --bytes=1 middle > middle 1
tail --bytes=+20 01.o > end
cat start middle1 end > 01.o

ld -m elf_x86_64 01.o -o 01
./01 ; echo $?

Now remove junk files ...

I have tested this way with shared libraries too and worked fine.
Follows a object.sh file, "chmod +x" on it and call it like "./object.sh 01.o"

head --bytes=18 $1 > start
echo -e "\x3e" > middle
head --bytes=1 middle > middle 1
tail --bytes=+20 $1 > end
cat start middle1 end > $1
rm start
rm middle
rm middle1
rm end

A last hint is appears to me that solasm like CRLF instead of LF on source code, setup your linux editor to handle this.
Title: Re: Solar Assembler location
Post by: GoneFishing on June 09, 2016, 05:46:19 PM
Hello MINEIRO,

Thanks for responding. On Linux we have a special utility  ELFEDIT for editing ELF headers , so one simple command does all the job:
Quoteelfedit  --output-mach x86-64  test.obj

You may check it with HEXDUMP and FILE utilities.

Talking about Lin64 sample I meant  example using shared libs  - for example puts, printf and exit functions of LIBC .
I can link it but it crashes with SEGFAULT .
I'll be much greatful if you'll post working Lin64 example using LIBC. 

P.S.: The example using only  exit function doesn't crash but ECHO $? doesn't show valid exit code - GUESS WHY ?
Title: Re: Solar Assembler location
Post by: mineiro on June 09, 2016, 11:31:01 PM
hello sir GoneFishing;
I can suppose that thats happening when you're linking the file or maybe an environment variable.
When I have started on linux I received many segmentation fault, I suppose that's because rsp register is not aligned before a call.
rsp=???????????????0
I can guess that happens if using 32 bits instead of 64 bits values (like printing an decimal interger instead of unsigned qword).
man 2 intro
man 2 syscall
man 2 syscalls
man 2 _syscall

You can try compile with gcc to have sure. I'm now on linux, so I can put more info.
I'm a hobbyst, don't expect much, but we can join forces, I can do some tests on this side if you need.
I linked with ld and with gcc this time, I try things with ld only but If I will release some software I will compile with gcc (exception handling).
If you need know whats happening behind the scene do a "-v" (verbose) on gcc comand line, this helped me to know how to use ld while trying a gtk samples using jwasm
I have used objdump -x on a generated file while reading gtk2 manual, because I do not know whats macro and whats functions.

um.asm

section "text" alias ".text" class_code
section "data" alias ".data" class_data

.USE64

stdout equ 1
sys_write equ 1
sys_exit equ 60

.data
msg_01 db 10,"Hello world",10
msg_len equ $-msg_01

.text
.entry _start
_start:

mov rdx,msg_len
mov rsi,offset msg_01
mov rdi,stdout
mov rax,sys_write
syscall

mov rdi,39
mov rax, sys_exit
syscall


mineiro@assembly:~/Assembly/solasm$ sol32 um.asm um.o -elf64

Solar Assembler version 0.36.12
Copyright (c) 2007,2012 Bogdan Valentin Ontanu, All rights reserved.
Build on 2012_11_5  at 21:44:54

Assembling file: um.asm
Assembler  pass: 1
Assembler  pass: 2
Assembler lines: 97
Output bytes   : 750
Assembler  time: 11 ms
-----------------------------
:~/Assembly/solasm$ file um.o
um.o: ELF 64-bit LSB  relocatable, Intel 80386, version 1 (SYSV), not stripped
:~/Assembly/solasm$ head --bytes=18 um.o > start
:~/Assembly/solasm$ echo -e "\x3e" > middle
:~/Assembly/solasm$ head --bytes=1 middle > middle1
:~/Assembly/solasm$ tail --bytes=+20 um.o > end
:~/Assembly/solasm$ cat start middle1 end > um.o
:~/Assembly/solasm$ file um.o
um.o: ELF 64-bit LSB  relocatable, x86-64, version 1 (SYSV), not stripped
:~/Assembly/solasm$ ld -m elf_x86_64 um.o -o um
:~/Assembly/solasm$ ./um ;echo $?

Hello world
39
:~/Assembly/solasm$ rm start
:~/Assembly/solasm$ rm middle
:~/Assembly/solasm$ rm middle1
:~/Assembly/solasm$ rm end
:~/Assembly/solasm$ gcc -nostartfiles um.o ; ./a.out ; echo $?

Hello world
39
:~/Assembly/solasm$ gcc -s -nostartfiles um.o ; ./a.out ; echo $?
:~/Assembly/solasm$ rm um.o

---------------------------------------------------------------------------------
man exit
different calling convention from native to library C functions, .

dois.asm

section "text" alias ".text" class_code
section "data" alias ".data" class_data

.USE64

extern exit
extern puts
extern printf

.entry _start

.data
msg db "hello world",10,0
msg_len equ $-msg

msg_fmt db 10,'message: %d %d %d %d %d %d %d %d %d %d %d %d %d',10,0

.text
_start:

push 15
push 14
push 13
push 12
push 11
push 10
push 9
push 8
mov r9,7
mov r8,6
mov rcx,5
mov rdx,4
mov rsi,3
mov rdi,offset msg_fmt
call printf
add rsp,8*8

mov rdi,msg
call puts

mov rdi,57
call exit


dois.sh

sol32 dois.asm dois.o -elf64
head --bytes=18 dois.o > start
echo -e "\x3e" > middle
head --bytes=1 middle > middle1
tail --bytes=+20 dois.o > end
cat start middle1 end > dois.o
ld -m elf_x86_64 -dynamic-linker /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 -L/lib/x86_64-linux-gnu -lc -o dois dois.o
rm start
rm middle
rm middle1
rm end
./dois ; echo $?



:~/Assembly/solasm$ ./dois.sh

Solar Assembler version 0.36.12
Copyright (c) 2007,2012 Bogdan Valentin Ontanu, All rights reserved.
Build on 2012_11_5  at 21:44:54

Assembling file: dois.asm
Assembler  pass: 1
Assembler  pass: 2
Assembler lines: 42
Output bytes   : 1041
Assembler  time: 10 ms
-----------------------------

message: 3 4 5 6 7 8 9 10 11 12 13 14 15
hello world

57
:~/Assembly/solasm$ gcc -nostartfiles dois.o ; ./a.out ; echo $?
message: 3 4 5 6 7 8 9 10 11 12 13 14 15
hello world
57
:~/Assembly/solasm$ ld -m elf_x86_64 -dynamic-linker /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 -L/lib/x86_64-linux-gnu -lc -o dois dois.o
:~/Assembly/solasm$ ./a.out ; echo $?
message: 3 4 5 6 7 8 9 10 11 12 13 14 15
hello world
57
:~/Assembly/solasm$

but look this, give to me errors
:~/Assembly/solasm$ ld -m elf_x86_64 -dynamic-linker -I/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 -L/lib/x86_64-linux-gnu -lc -o dois dois.o
:~/Assembly/solasm$ ./a.out ; echo $?
bash: ./a.out: Arquivo ou diretório não encontrado (like a file or folder not found) <-- Is this whats happening to you?
127
:~/Assembly/solasm$ ld -nostartfiles -m elf_x86_64 -dynamic-linker /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 -L/lib/x86_64-linux-gnu -lc -o dois dois.o
dois.o: na função `_start': <-- Is this whats happening to you?
(.text+0x4d): referência indefinida para `printf' (reference to printf not found) <-- Is this whats happening to you?
dois.o: na função `_start':
(.text+0x60): referência indefinida para `puts' (reference to puts not found)
dois.o: na função `_start':
(.text+0x6f): referência indefinida para `exit' (reference to exit not found)
:~/Assembly/solasm$ gcc -nostartfiles -dynamic-linker dois.o ; ./a.out ; echo $?
message: 3 4 5 6 7 8 9 10 11 12 13 14 15
hello world
57
:~/Assembly/solasm$


-------------edited------------
I have done an error, sub rsp,8*8 instead of add rsp,8*8, I corrected example above
Title: Re: Solar Assembler location
Post by: GoneFishing on June 10, 2016, 12:47:32 AM
Thanks MINEIRO,

Oh I'm sorry I didn't know that you're a hobbyst programmer just like me.
I'lll try to explain WHY :
SOL_ASM knows STDCALL, CDECL and WIN64/FASTCALL calling conventions .
For 32 bits STDCALL is default and WIN64/FASTCALL is default for 64 bits . When I specify option .use64 and declare  extern exit SOL_ASM follows WIN64 ABI and places the first parameter in RCX while it should be placed in RDI accordingly to SYSV ABI and so on .

Your  Lin64 example uses workaround when you yourself care where to place each parameter - the only way ( for now) to emulate FASTCALL for Linux . The sad state of affairs is that you can't just write  invoke exit, 42 etc. ( unless you substitute builtin INVOKE with your own macro like my FCALLTEST macro for JWASM ) 

Now, you execute these  5 shell commands :
Quote
head --bytes=18 dois.o > start
echo -e "\x3e" > middle
head --bytes=1 middle > middle1
tail --bytes=+20 dois.o > end
cat start middle1 end > dois.o
to achive the same effect that I get with a single line:
Quoteelfedit  --output-mach x86-64  test.obj

Try it  and compare the results - should be the same .

Don't worry I won't bother you asking for help or testing something because I'm too lazy , so lazy that I even got tired with my vacations  ;)

Good luck with your hobby  ...  and let's hope that some day SOL_ASM and maybe HJWASM will support SYSV ABI .

Title: Re: Solar Assembler location
Post by: mineiro on June 10, 2016, 03:32:20 AM
I learned elfedit with you GoneFishing, thanks.
yes, I tested and it works, your solution using elfedit is more elegant.
It's a habit when switching from one O.S. to other, look, you have used .obj instead of .o. I get the point.

On linux x86_64 we have a lot of work to do with macros, we need at least 2 of then:
one to syscall (native) and others to libraries. Should check parameters of functions, stack alignment,preserving register across called functions, registers to stack (shadow space),stack balance, ... .  :lol:

invoke function,rdi,rsi,rdx,RCX,r8,r9, push, push, push,...
and need xmm registers to floating point numbers.

scall function,arg1,arg2,arg3,arg4,arg5,arg6
scall rax,rdi,rsi,rdx,r10,r8,r9

Well, better create a preprocessing program instead of macro. We are on a wild land by using assembly, but this is what I like.
I ask myself sometimes, why not learn C, why not learn C++.
Hmm, an insane person talking to a lazy person :dazzled:
Title: Re: Solar Assembler location
Post by: GoneFishing on June 10, 2016, 04:10:32 AM
You're welcome
How do you think, should we start a new separate thread for our further discussion and leave a little bit of free space here to Bogdan ?   
Title: Re: Solar Assembler location
Post by: mineiro on June 10, 2016, 11:47:41 AM
Good idea, we can discuss in a good sense on a new thread, so we can talk not only about solasm assembler, but jwasm too and their forks like hjwasm and casm, and maybe others assemblers.
Well, only to not  pollute this topic.

edited after
------------------------------------------------------
Well sir GoneFishing, I was thinking about and will be better if we create a new topic about solasm examples to linux x86-64, I can create that in a near future. I have started reading solasm documentation and I'm doing some experiments. This way this topic remains to sir Bogdan show info about news on solasm.
When I talked about other's assemblers it's because we can assemble a program inside windows and port that to linux, maybe an other topic to specific assemblers.
Thanks.
Title: Re: Solar Assembler location
Post by: BogdanOntanu on June 11, 2016, 10:14:27 AM
Hi mineiro, Hi GoneFishing,

I am kind of busy learning for exams for IT university.
I am going to university again at "old" age ;)

I have noticed the Sol_asm bugs/problems you are talking about here.

As soon as I have some free time I will try to fix those issues and release a new version.

(after 11.06.2016 / my last exams for this year I hope ;) )

Title: Re: Solar Assembler location
Post by: mineiro on June 12, 2016, 03:07:24 AM
hello Sir Bogdan;
Good hear info about you and good luck on your's exams. Well, I'm half young and half older, at age 40 now, I continue souped.  :lol: . We get older only because body, but we can remain young forever. If the world need change simple because us, so we getting older, if we think that we can rule the world, were young.
I'm posting here some more info about solasm under linux world, so when you have time you can check.
I was not able to write/read data on a unitialized section, under linux it points to a code section instead of bss section.
I forgot now if I have tested this to initialized data section. Maybe an overview of elf header is necessary.

Other thing is about source code text new line codification. On linux a new line is LF, while on windows is CRLF, I do not have sure if macintosh is LFCR,
So, because recursion of some macros, an output is not valid.

I can be a beta tester on linux if you need, you can count with me.

Again, good luck on your It university.

Oh, I forgot to say, on solasm we can create labels like "opção" (option in portuguese), this is a good thing, does not remove this feature, latim (portuguese, spanish) programmers will like.
Title: Re: Solar Assembler location
Post by: mineiro on June 16, 2016, 04:39:11 AM
Simple tests to be done, one work and another not, what I was thinking is change only command line and compile to both 32 and x864-64.

usage is: ./make_32 source

make_32.sh
sol32 $1.asm $1.o -elf32
ld -m elf_i386 -o $1 $1.o
./$1 ; echo $?
rm $1.o

make_x86_64.sh
sol32 $1.asm $1.o -elf64 $2 $3 $4
elfedit --output-mach x86-64 $1.o
ld -m elf_x86_64 -o $1 $1.o
./$1 ; echo $?
rm $1.o

macro.inc

MACRO string
MARG name, symbols :req
name db &symbols
sz&name equ $-&name
ENDM

/*
eg: sol32 source.asm source.o -elf64 -d check
this will create a fake (not valid) object file into this context but will count function parameters
need more work, how can I know if an function needs an address but we put [address]?,
this is valid to invoke and can generated errors that are hard to find
*/
#ifdef check
define ncall invoke
#endif

#ifdef -elf64

MACRO ncall
MARG nfunction :req, p1, p2, p3, p4, p5, p6

  #ifnb <&p6>
    mov r9,p6
  #endif

  #ifnb <&p5>
    mov r8,p5
  #endif

  #ifnb <&p4>
    mov rcx,p4
  #endif

  #ifnb <&p3>
    mov rdx,p3
  #endif

  #ifnb <&p2>
    mov rsi,p2
  #endif

  #ifnb <&p1>
    mov rdi,p1
  #endif

  mov rax,nfunction
  syscall

ENDM
#endif

#ifdef -elf32

MACRO ncall
MARG nfunction :req, p1, p2, p3, p4, p5, p6

  #ifnb <&p6>
    mov ebp,p6
  #endif

  #ifnb <&p5>
    mov edi,p5
  #endif

  #ifnb <&p4>
    mov esi,p4
  #endif

  #ifnb <&p3>
    mov edx,p3
  #endif

  #ifnb <&p2>
    mov ecx,p2
  #endif

  #ifnb <&p1>
    mov ebx,p1
  #endif

  mov eax,nfunction
  int 80h

ENDM
#endif

unistd.inc
stdin equ 0
stdout          equ     1
stderr equ 2

;just to count functions parameters, so can report errors
import sys_write [3] ;fd,ptr buf,count
import sys_exit [1] ;status


;no holes allowed into syscall enumeration

#ifdef -elf64
      ENUM Native,0,314
      sys_read
      sys_write
      sys_open
      sys_close
      sys_newstat
      sys_newfstat
      sys_newlstat
      sys_poll
      sys_lseek
      sys_mmap
      sys_mprotect
      sys_munmap
      sys_brk
      sigaction
      sigprocmask
      rt_sigreturn
      sys_ioctl
      sys_pread64
      sys_pwrite64
      sys_readv
      sys_writev
      sys_access
      sys_pipe
      sys_select
      sys_sched_yield
      sys_mremap
      sys_msync
      sys_mincore
      sys_madvise
      sys_shmget
      sys_shmat
      sys_shmctl
      sys_dup
      sys_dup2
      sys_pause
      sys_nanosleep
      sys_getitimer
      sys_alarm
      sys_setitimer
      sys_getpid
      sys_sendfile64
      sys_socket
      sys_connect
      sys_accept
      sys_sendto
      sys_recvfrom
      sys_sendmsg
      sys_recvmsg
      sys_shutdown
      sys_bind
      sys_listen
      sys_getsockname
      sys_getpeername
      sys_socketpair
      sys_setsockopt
      sys_getsockopt
      stub_clone
      stub_fork
      stub_vfork
      stub_execve
      sys_exit
      sys_wait4
      sys_kill
      sys_newuname
      sys_semget
      sys_semop
      sys_semctl
      sys_shmdt
      sys_msgget
      sys_msgsnd
      sys_msgrcv
      sys_msgctl
      sys_fcntl
      sys_flock
      sys_fsync
      sys_fdatasync
      sys_truncate
      sys_ftruncate
      sys_getdents
      sys_getcwd
      sys_chdir
      sys_fchdir
      sys_rename
      sys_mkdir
      sys_rmdir
      sys_creat
      sys_link
      sys_unlink
      sys_symlink
      sys_readlink
      sys_chmod
      sys_fchmod
      sys_chown
      sys_fchown
      sys_lchown
      sys_umask
      sys_gettimeofday
      sys_getrlimit
      sys_getrusage
      sys_sysinfo
      sys_times
      sys_ptrace
      sys_getuid
      sys_syslog
      sys_getgid
      sys_setuid
      sys_setgid
      sys_geteuid
      sys_getegid
      sys_setpgid
      sys_getppid
      sys_getpgrp
      sys_setsid
      sys_setreuid
      sys_setregid
      sys_getgroups
      sys_setgroups
      sys_setresuid
      sys_getresuid
      sys_setresgid
      sys_getresgid
      sys_getpgid
      sys_setfsuid
      sys_setfsgid
      sys_getsid
      sys_capget
      sys_capset
      sys_rt_sigpending
      sys_rt_sigtimedwait
      sys_rt_sigqueueinfo
      sys_rt_sigsuspend
      stub_sigaltstack
      sys_utime
      sys_mknod
      sys_ni_syscall
      sys_personality
      sys_ustat
      sys_statfs
      sys_fstatfs
      sys_sysfs
      sys_getpriority
      sys_setpriority
      sys_sched_setparam
      sys_sched_getparam
      sys_sched_setscheduler
      sys_sched_getscheduler
      sys_sched_get_priority_max
      sys_sched_get_priority_min
      sys_sched_rr_get_interval
      sys_mlock
      sys_munlock
      sys_mlockall
      sys_munlockall
      sys_vhangup
      sys_modify_ldt
      sys_pivot_root
      sys_sysctl
      sys_prctl
      sys_arch_prctl
      sys_adjtimex
      sys_setrlimit
      sys_chroot
      sys_sync
      sys_acct
      sys_settimeofday
      sys_mount
      sys_umount
      sys_swapon
      sys_swapoff
      sys_reboot
      sys_sethostname
      sys_setdomainname
      stub_iopl
      sys_ioperm
      sys_create_module
      sys_init_module
      sys_delete_module
      sys_get_kernel_syms
      sys_query_module
      sys_quotactl
      sys_nfsservctl
      sys_getpmsg
      sys_putpmsg
      sys_afs_syscall
      sys_tuxcall
      sys_security
      sys_gettid
      sys_readahead
      sys_setxattr
      sys_lsetxattr
      sys_fsetxattr
      sys_getxattr
      sys_lgetxattr
      sys_fgetxattr
      sys_listxattr
      sys_llistxattr
      sys_flistxattr
      sys_removexattr
      sys_lremovexattr
      sys_fremovexattr
      sys_tkill
      sys_time
      sys_futex
      sys_sched_setaffinity
      sys_sched_getaffinity
      sys_set_thread_area
      sys_io_setup
      sys_io_destroy
      sys_io_getevents
      sys_io_submit
      sys_io_cancel
      sys_get_thread_area
      sys_lookup_dcookie
      sys_epoll_create
      sys_epoll_ctl_old
      sys_epoll_wait_old
      sys_remap_file_pages
      sys_getdents64
      sys_set_tid_address
      sys_restart_syscall
      sys_semtimedop
      sys_fadvise64
      sys_timer_create
      sys_timer_settime
      sys_timer_gettime
      sys_timer_getoverrun
      sys_timer_delete
      sys_clock_settime
      sys_clock_gettime
      sys_clock_getres
      sys_clock_nanosleep
      sys_exit_group
      sys_epoll_wait
      sys_epoll_ctl
      sys_tgkill
      sys_utimes
      sys_vserver
      sys_mbind
      sys_set_mempolicy
      sys_get_mempolicy
      sys_mq_open
      sys_mq_unlink
      sys_mq_timedsend
      sys_mq_timedreceive
      sys_mq_notify
      sys_mq_getsetattr
      sys_kexec_load
      sys_waitid
      sys_add_key
      sys_request_key
      sys_keyctl
      sys_ioprio_set
      sys_ioprio_get
      sys_inotify_init
      sys_inotify_add_watch
      sys_inotify_rm_watch
      sys_migrate_pages
      sys_openat
      sys_mkdirat
      sys_mknodat
      sys_fchownat
      sys_futimesat
      sys_newfstatat
      sys_unlinkat
      sys_renameat
      sys_linkat
      sys_symlinkat
      sys_readlinkat
      sys_fchmodat
      sys_faccessat
      sys_pselect6
      sys_ppoll
      sys_unshare
      sys_set_robust_list
      sys_get_robust_list
      sys_splice
      sys_tee
      sys_sync_file_range
      sys_vmsplice
      sys_move_pages
      sys_utimensat
      sys_epoll_pwait
      sys_signalfd
      sys_timerfd_create
      sys_eventfd
      sys_fallocate
      sys_timerfd_settime
      sys_timerfd_gettime
      sys_accept4
      sys_signalfd4
      sys_eventfd2
      sys_epoll_create1
      sys_dup3
      sys_pipe2
      sys_inotify_init1
      sys_preadv
      sys_pwritev
      sys_rt_tgsigqueueinfo
      sys_perf_event_open
      sys_recvmmsg
      sys_fanotify_init
      sys_fanotify_mark
      sys_prlimit64
      sys_name_to_handle_at
      sys_open_by_handle_at
      sys_clock_adjtime
      sys_syncfs
      sys_sendmmsg
      sys_setns
      sys_getcpu
      sys_process_vm_readv
      sys_process_vm_writev
      sys_kcmp
      sys_finit_module
      ENDE
#endif

#ifdef -elf32

      ENUM Native,0,348
      sys_restart_syscall
      sys_exit
      sys_fork
      sys_read
      sys_write
      sys_open
      sys_close
      sys_waitpid
      sys_creat
      sys_link
      sys_unlink
      sys_execve
      sys_chdir
      sys_time
      sys_mknod
      sys_chmod
      sys_lchown
      sys_break
      sys_oldstat
      sys_lseek
      sys_getpid
      sys_mount
      sys_umount
      sys_setuid
      sys_getuid
      sys_stime
      sys_ptrace
      sys_alarm
      sys_oldfstat
      sys_pause
      sys_utime
      sys_stty
      sys_gtty
      sys_access
      sys_nice
      sys_ftime
      sys_sync
      sys_kill
      sys_rename
      sys_mkdir
      sys_rmdir
      sys_dup
      sys_pipe
      sys_times
      sys_prof
      sys_brk
      sys_setgid
      sys_getgid
      sys_signal
      sys_geteuid
      sys_getegid
      sys_acct
      sys_umount2
      sys_lock
      sys_ioctl
      sys_fcntl
      sys_mpx
      sys_setpgid
      sys_ulimit
      sys_oldolduname
      sys_umask
      sys_chroot
      sys_ustat
      sys_dup2
      sys_getppid
      sys_getpgrp
      sys_setsid
      sys_sigaction
      sys_sgetmask
      sys_ssetmask
      sys_setreuid
      sys_setregid
      sys_sigsuspend
      sys_sigpending
      sys_sethostname
      sys_setrlimit
      sys_getrlimit
      sys_getrusage
      sys_gettimeofday
      sys_settimeofday
      sys_getgroups
      sys_setgroups
      sys_select
      sys_symlink
      sys_oldlstat
      sys_readlink
      sys_uselib
      sys_swapon
      sys_reboot
      sys_readdir
      sys_mmap
      sys_munmap
      sys_truncate
      sys_ftruncate
      sys_fchmod
      sys_fchown
      sys_getpriority
      sys_setpriority
      sys_profil
      sys_statfs
      sys_fstatfs
      sys_ioperm
      sys_socketcall
      sys_syslog
      sys_setitimer
      sys_getitimer
      sys_stat
      sys_lstat
      sys_fstat
      sys_olduname
      sys_iopl
      sys_vhangup
      sys_idle
      sys_vm86old
      sys_wait4
      sys_swapoff
      sys_sysinfo
      sys_ipc
      sys_fsync
      sys_sigreturn
      sys_clone
      sys_setdomainname
      sys_uname
      sys_modify_ldt
      sys_adjtimex
      sys_mprotect
      sys_sigprocmask
      sys_create_module
      sys_init_module
      sys_delete_module
      sys_get_kernel_syms
      sys_quotactl
      sys_getpgid
      sys_fchdir
      sys_bdflush
      sys_sysfs
      sys_personality
      sys_afs_syscall
      sys_setfsuid
      sys_setfsgid
      sys__llseek
      sys_getdents
      sys__newselect
      sys_flock
      sys_msync
      sys_readv
      sys_writev
      sys_getsid
      sys_fdatasync
      sys__sysctl
      sys_mlock
      sys_munlock
      sys_mlockall
      sys_munlockall
      sys_sched_setparam
      sys_sched_getparam
      sys_sched_setscheduler
      sys_sched_getscheduler
      sys_sched_yield
      sys_sched_get_priority_max
      sys_sched_get_priority_min
      sys_sched_rr_get_interval
      sys_nanosleep
      sys_mremap
      sys_setresuid
      sys_getresuid
      sys_vm86
      sys_query_module
      sys_poll
      sys_nfsservctl
      sys_setresgid
      sys_getresgid
      sys_prctl
      sys_rt_sigreturn
      sys_rt_sigaction
      sys_rt_sigprocmask
      sys_rt_sigpending
      sys_rt_sigtimedwait
      sys_rt_sigqueueinfo
      sys_rt_sigsuspend
      sys_pread64
      sys_pwrite64
      sys_chown
      sys_getcwd
      sys_capget
      sys_capset
      sys_sigaltstack
      sys_sendfile
      sys_getpmsg
      sys_putpmsg
      sys_vfork
      sys_ugetrlimit
      sys_mmap2
      sys_truncate64
      sys_ftruncate64
      sys_stat64
      sys_lstat64
      sys_fstat64
      sys_lchown32
      sys_getuid32
      sys_getgid32
      sys_geteuid32
      sys_getegid32
      sys_setreuid32
      sys_setregid32
      sys_getgroups32
      sys_setgroups32
      sys_fchown32
      sys_setresuid32
      sys_getresuid32
      sys_setresgid32
      sys_getresgid32
      sys_chown32
      sys_setuid32
      sys_setgid32
      sys_setfsuid32
      sys_setfsgid32
      sys_pivot_root
      sys_mincore
      sys_madvise
      sys_madvise1
      sys_getdents64
      sys_fcntl64
      sys_gettid
      sys_readahead
      sys_setxattr
      sys_lsetxattr
      sys_fsetxattr
      sys_getxattr
      sys_lgetxattr
      sys_fgetxattr
      sys_listxattr
      sys_llistxattr
      sys_flistxattr
      sys_removexattr
      sys_lremovexattr
      sys_fremovexattr
      sys_tkill
      sys_sendfile64
      sys_futex
      sys_sched_setaffinity
      sys_sched_getaffinity
      sys_set_thread_area
      sys_get_thread_area
      sys_io_setup
      sys_io_destroy
      sys_io_getevents
      sys_io_submit
      sys_io_cancel
      sys_fadvise64
      sys_exit_group
      sys_lookup_dcookie
      sys_epoll_create
      sys_epoll_ctl
      sys_epoll_wait
      sys_remap_file_pages
      sys_set_tid_address
      sys_timer_create
      sys_timer_settime
      sys_timer_gettime
      sys_timer_getoverrun
      sys_timer_delete
      sys_clock_settime
      sys_clock_gettime
      sys_clock_getres
      sys_clock_nanosleep
      sys_statfs64
      sys_fstatfs64
      sys_tgkill
      sys_utimes
      sys_fadvise64_64
      sys_vserver
      sys_mbind
      sys_get_mempolicy
      sys_set_mempolicy
      sys_mq_open
      sys_mq_unlink
      sys_mq_timedsend
      sys_mq_timedreceive
      sys_mq_notify
      sys_mq_getsetattr
      sys_kexec_load
      sys_waitid
      sys_add_key
      sys_request_key
      sys_keyctl
      sys_ioprio_set
      sys_ioprio_get
      sys_inotify_init
      sys_inotify_add_watch
      sys_inotify_rm_watch
      sys_migrate_pages
      sys_openat
      sys_mkdirat
      sys_mknodat
      sys_fchownat
      sys_futimesat
      sys_fstatat64
      sys_unlinkat
      sys_renameat
      sys_linkat
      sys_symlinkat
      sys_readlinkat
      sys_fchmodat
      sys_faccessat
      sys_pselect6
      sys_ppoll
      sys_unshare
      sys_set_robust_list
      sys_get_robust_list
      sys_splice
      sys_sync_file_range
      sys_tee
      sys_vmsplice
      sys_move_pages
      sys_getcpu
      sys_epoll_pwait
      sys_utimensat
      sys_signalfd
      sys_timerfd_create
      sys_eventfd
      sys_fallocate
      sys_timerfd_settime
      sys_timerfd_gettime
      sys_signalfd4
      sys_eventfd2
      sys_epoll_create1
      sys_dup3
      sys_pipe2
      sys_inotify_init1
      sys_preadv
      sys_pwritev
      sys_rt_tgsigqueueinfo
      sys_perf_event_open
      sys_recvmmsg
      sys_fanotify_init
      sys_fanotify_mark
      sys_prlimit64
      sys_name_to_handle_at
      sys_open_by_handle_at
      sys_clock_adjtime
      sys_syncfs
      sys_sendmmsg
      sys_setns
      sys_process_vm_readv
      sys_process_vm_writev
      ENDE

#endif


write.asm
section "text" class_code alias ".text"
section "data" class_data alias ".data"

lf equ 10

.USE64

include ../native/unistd.inc
include ../macro/macro.inc

.data
string msg_01 <"x86-64 native system calls:",lf,"syscall rax,rdi,rsi,rdx,r10,r8,r9",lf,"return: rax rdx",lf>
string msg_02 <"Registers that should be preserved accross function calls:",lf,"rbx,rbp,rsp,r12,r13,r14,r15",lf,lf>
string msg_03 <"x86-64 C function libraries:",lf,"call function,rdi,rsi,rdx,rcx,r8,r9",lf>

.text
.entry _start
_start:

ncall sys_write,stdout,msg_01,szmsg_01
ncall sys_write,stdout,msg_02,szmsg_02
ncall sys_write,stdout,msg_03,szmsg_03
ncall sys_exit,0 ;should have one "new line" at the end? or generate an error

read.asm
section "text" class_code alias ".text"
section "data" class_data alias ".data"
section "bss" class_bss alias ".bss"

lf equ 10

.USE64

include ../native/unistd.inc
include ../macro/macro.inc

.bss
buffer1 rq 1 ;<----section is created but reserved data no

.data
string msg_01 < "type anything",lf >
string msg_02 < "right",lf >
string msg_03 < "wrong",lf >
buffer dq 1

.text
.entry _start
_start:

ncall sys_write,stdout,msg_01,szmsg_01
;ncall sys_read,stdin,buffer1,8 ;buffer1 is not reserved into this section
ncall sys_read,stdin,buffer,8
mov rax, [buffer]
;.if rax == swap "anything" --->*Error** Mini string is too big: "gnihtyna"
;.if rax == "gnihtyna" ;--->*Error** Mini string is too big: "gnihtyna"
cmp rax, qword "gnihtyna" ;--->cmp rax,74796E61
jne not_right
ncall sys_write,stdout,msg_02,szmsg_02
jmp skip
not_right:
ncall sys_write,stdout,msg_03,szmsg_03
skip:
ncall sys_exit,0

That rax register can be eax register, so I can create a macro like rax|eax==r00, this way we can reach portability.
Title: Re: Solar Assembler location
Post by: BogdanOntanu on July 02, 2016, 08:06:17 AM
Hi all,

I have released a new Sol_Asm version here:

http://www.oby.ro/sol_asm/files/sol_asm_2016_07_01_v36_28.zip (http://www.oby.ro/sol_asm/files/sol_asm_2016_07_01_v36_28.zip)

I have added  a "lin64" keyword for Unix System V ABI used in invoke and proc
you can also use the "varg" keyword to signal a variable arguments procedure or imported function.
(the manual is not yet updated)

I have also added two Linux elf64 samples and a Ubuntu 14.04 LTS pre compiled binary for sol_asm2.


Title: Re: Solar Assembler location
Post by: GoneFishing on July 02, 2016, 07:14:40 PM
Hi Bogdan,
I hope you've passed your exams in IT university .

Thank you for releasing new version of SOL_ASM  with new LIN64 features . I've  built lin64 samples on my UBUNTU 14.04 .
All worked fine.

Thanks again  :t
Title: Re: Solar Assembler location
Post by: mineiro on July 02, 2016, 10:19:19 PM
Hello sir Bodgan,
The same, I hope you've passed your exams in IT university.

Good news, I build your examples and worked fine. Today I'm busy painting a wall into my house, but at night I can do more tests.

I have seen that for a while we are not able to write into global variables. Maybe sir GoneFishing can test too.

This is a test piece.
section "text" class_code alias ".text"
section "data" class_data alias ".data"
section "bss" class_bss alias ".bss"

exit equ 60

.USE64

.data
temp2 dq 0

.bss
temp rq 1

.text
.entry _start
_start:
mov [temp2],exit
mov rcx,[temp2]
mov [temp],rcx
mov rax,[temp]
syscall


I think the answer to this is relocation or maybe a symbol table. A command line 'objdump -x source.o' show me this. I will study this case with more attention at night, for a while it's just a supposition. I have seen on others object files a section like .rodata but I never have tried create this section.

Good work sir, I know that I can call a function to reserve memory space like 'globalalloc' on windows, mmap on linux and have a global data area with r/w/x permissions, so I know how to walk on this subject, I'm just posting what I'm finding.

Now we (users) have invoke, and this speedup code a lot and turns code more easy to read. So, I only have words to say thank you Bogdan.
Title: Re: Solar Assembler location
Post by: BogdanOntanu on July 03, 2016, 06:57:47 AM
Hi mineiro, Hi GoneFishing,

Yes I have passed almost all of my university exams with max scores... ;)
(well I still have to find the result to one of the last exams but I hope it is ok)

Thank you both for testing Sol_Asm on Linux 64 bits ;)

I will also check the .bss  variables issues you reported and fix them when I find the bug /problem.
I will try to add an Linux 64 syscall invoke in next releases

Let me know what other stuff you think it is important / useful for Linux 64 / 32 bits ASM programming
Title: Re: Solar Assembler location
Post by: mineiro on July 03, 2016, 09:55:17 PM
Wow, max scores, this is the man, flawless victory.  :icon_cool:

Thanks for updating solasm, I like so much your macro approach, it's minimalistic approach with maximalistic power, original idea. I'm doing a paralell study here about object files on linux world, I start today. My intention is to create a object file by hand making.

Good job sir Bogdan.

Can you check this:

.text
.entry _start
_start:

mov al,byte [rip] ;Unknown address expresion in [] : rip
nop
;solasm generate correct code on list 1 but on list 2 that's is removed, need a prefix byte '67h' before
; mov al,[rip] ;8A 05 FC FF FF FF
;nop ;90
; 67 8A 05 FC FF FF FF
Title: Re: Solar Assembler location
Post by: BogdanOntanu on July 05, 2016, 03:04:47 AM
Hi mineiro,

Yes I will check the issue ;)
Title: Re: Solar Assembler location
Post by: BogdanOntanu on July 07, 2016, 06:41:38 AM
Hi all,

There is a new version for Sol_Asm v0.36.32 here:
http://www.oby.ro/sol_asm/files/sol_asm_2016_07_05_v36_32.zip (http://www.oby.ro/sol_asm/files/sol_asm_2016_07_05_v36_32.zip)

It fixes the .bss issue for ELF64 on Linux.

I am thinking to restart the forums in order to avoid too many messages about Sol_Asm here ;)

@mineiro:

I do not think that rip is a register known to Sol_Asm
(there is no encoding for RIP register in x64)

I guess that it is considered an "yet to be resolved" symbol in first pass and not found in second pass
Title: Re: Solar Assembler location
Post by: Vortex on July 07, 2016, 07:18:39 AM
Hi Bogdan,

Congratulations on your examination scores :t

If you reactivate the Solar forums, could you enable the attachment feature? It's very unpleasant to depend on file sharing sites to send links to your forums. Thanks.
Title: Re: Solar Assembler location
Post by: mineiro on July 07, 2016, 08:05:34 AM
Hello sir Bogdan;
Thanks, I'm downloading now your new solasm version and putting my fingers on it. All of this time and I only have build an elf header on a structured way using -binary switch. I have see that solasm accepts some keywords about C headers, I was changing all to equates, ..., old customs. I'm slow to code because I read a lot, think a lot and code a little.  :lol:

That previous code about 'rip' move to al register 90h (nop). I think that this is about PIC (position independent code).
; New method
mov ah, [rip] ; RIP points to the next instruction aka NOP
nop

; Alternative new method
lea rbx, [rip] ; RBX now points to the next instruction
nop
cmp byte ptr [rbx], 90h ; Should be equal!

; Old method (using 64-bit addressing!)
call $ + 5 ; A 64-bit call instruction is still 5 bytes wide!
pop rbx
add rbx, 5 ; RBX now points to the next instruction aka NOP
nop
mov al, [rbx]

; AH and AL should now be equal :)
cmp ah, al
source: http://www.codegurus.be/Programming/riprelativeaddressing_en.htm (http://www.codegurus.be/Programming/riprelativeaddressing_en.htm)

Sounds interesting reactivating your forum.
Title: Re: Solar Assembler location
Post by: BogdanOntanu on July 08, 2016, 04:42:59 AM
OK, I have restarted the forums in order to have a place to talk about Sol_Asm and assembler programming

link is here: http://www.oby.ro/forum/index.php (http://www.oby.ro/forum/index.php)

Hi Vortex ;)
I have enabled forum attachments
Title: Re: Solar Assembler location
Post by: Vortex on July 08, 2016, 05:33:50 AM
Hi Bogdan,

Great news, thanks :t
Title: Re: Solar Assembler location
Post by: avcaballero on July 08, 2016, 05:59:41 PM
Hello, I have had a look to solasm and it has a quite good looking, small as I like :t. A few questions:

* Is there any way to include resources, at least icos for the program?
* Though its syntax seems to be very close to the masm one, is there any doc about it?

Thank you
Title: Re: Solar Assembler location
Post by: Vortex on July 08, 2016, 07:47:41 PM
Hi caballero,

Here is the Solar Assembler Manual :

http://www.oby.ro/sol_asm/docs/sol_asm_manual.htm (http://www.oby.ro/sol_asm/docs/sol_asm_manual.htm)

Chapter 8. Resource compiler :

http://www.oby.ro/sol_asm/docs/sol_asm_manual.htm#8 (http://www.oby.ro/sol_asm/docs/sol_asm_manual.htm#8)

If you create MS COFF object modules, you can link them with compiled resource files. ( .res )

When generating 32-bit PE files with the option -pe32, you need a resource linker to add icons to your executables :

\SolAsm\bin\sol_asm2.exe Window.asm Window.exe /pe32

rlink32.exe Rsrc.res Window.exe

Attached is a quick example.

To get the resource linker :

http://www.rowalt.de/pc/programming/toolse.htm (http://www.rowalt.de/pc/programming/toolse.htm)
Title: Re: Solar Assembler location
Post by: avcaballero on July 08, 2016, 07:50:33 PM
thank you, vortex, much appreciated :icon14:
Title: Re: Solar Assembler location
Post by: GoneFishing on September 24, 2016, 01:00:29 AM
Hi Bogdan ,

Today I've done a small test on Linux 64 . 
Add to test64_libc.asm following lines:

.data
...
msg_fmt3 db 13,10,'Printf message: float = %f ',13,10,0
test1 real4 10.2345

.text
invoke printf,msg_fmt3, test1
...

Sol_asm assembles it but the output is:
QuotePrintf message: float = 0.000000

Executing objdump -d ./test64_libc shows following disassembly:

Quote
00000000004005f0 <main>:
  4005f0:   48 be 75 11 60 00 00     movabs $0x601175,%rsi
  4005f7:   00 00 00
  4005fa:   48 bf 23 11 60 00 00      movabs $0x601123,%rdi
  400601:   00 00 00
  400604:   b8 00 00 00 00              mov    $0x0,%eax
  400609:   e8 82 fe ff ff                   callq  400490 <printf@plt>
  40060e:   48 bf 77 00 00 00 00     movabs $0x77,%rdi
  400615:   00 00 00
  400618:   e8 a3 fe ff ff                   callq  4004c0 <exit@plt>
  40061d:   c3                                   retq   
  40061e:   66 90                             xchg   %ax,%ax

Here goes my question :

Is it possible to add floating point arguments support to invoke ?

Thanks.

P.S.: Solar Assembler version 0.36.32

Title: Re: Solar Assembler location
Post by: BogdanOntanu on September 26, 2016, 01:19:29 AM
Hi GoneFishing,

Yes, I will add floating point arguments to invoke in Sol_Asm.

Thanks for reporting this issue ;)