The MASM Forum

Miscellaneous => The Orphanage => Topic started by: shankle on February 14, 2016, 01:46:33 AM

Title: Assembler languages for Linux
Post by: shankle on February 14, 2016, 01:46:33 AM
Only interested in 64-bit assemblers.
I have found 4 assemblers that will work for Linux. Trouble is I don't
want to pick the wrong one. I already went from MASM32 to Goasm64.
Now due to Windows 10, I have to start all over again. Thank you Microsoft!

The Linux assemblers are: NASM, YASM, FASM and TASM.
From what I have read FASM seems to be the way to go.
Opinions Please....
Title: Re: Assembler languages for Linux
Post by: mabdelouahab on February 14, 2016, 01:56:34 AM
I prefer HJWAsm
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 14, 2016, 02:21:32 AM
There's also SOLAR ASSEMBLER  (http://www.oby.ro/sol_asm/docs/sol_asm_manual.htm#1.2) written by Bogdan Ontanu

When I moved to Linux I used JWASM  for the first time .
Pros of using JWASM :
         it's 100% MASM compatible and you can focus on learning new platform  - not new syntax
         If you want to program in 32 bit  - you may use Open Watcom standard library ( JWLINK can link it  ) . It's well documented! 
Cons:
         it has limited support for Linux  - no FASTCALL  for example  but you may write your own macro or use sombody else's one to call functions from C lib etc . I have written such a macro - FCALLTEST - it can handle up to 12 parameters but doesn't have floating point arguments support.
         JWLINK in 64 bit mode is very unstable and limited in functionality
Title: Re: Assembler languages for Linux
Post by: Magnum on February 14, 2016, 04:40:02 AM
I tried Solar Asm under Linux.

When I run

Quote
sol_asm2.exe test.asm test.obj -elf32

I get

Quote
# ./test.sh
./test.sh: line 5: sol_asm2.exe: command not found
# sol_asm2.exe
bash: sol_asm2.exe: command not found
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 14, 2016, 04:54:49 AM
Most likely execute permission was not set
Open terminal in directory with sol_asm and execute
Code: [Select]
llIt will show permissions
To set exec permission:
Code: [Select]
sudo chmod +x sol_asm2.exeTo make sure that your binary is valid ELF executable:
Code: [Select]
file sol_asm2.exe
[EDIT] Oops, my bad , you should use this notation (assumed that terminal is opened in directory where sol_asm lives ):
Quote
./sol_asm2.exe ...
Title: Re: Assembler languages for Linux
Post by: Magnum on February 14, 2016, 05:43:54 AM
Looks like it is not a Linux exe.

Quote
sol_asm2.exe: PE32 executable (console) Intel 80386, for MS Windows
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 14, 2016, 06:06:28 AM
Yes, sol_asm is distributed in object form
You must link it to your C lib
Read this ( if you have the latest version) : sol_asm_2012_10_30_v36_12/bin/obj_unix_elf/read_me.txt
Title: Re: Assembler languages for Linux
Post by: Vortex on February 14, 2016, 06:46:56 AM
Hi shankle,

Did you find some good Linux x86-64 assembly tutorials? I guess the options are limited.
Title: Re: Assembler languages for Linux
Post by: shankle on February 14, 2016, 08:52:34 AM
HI Vortex,
Yes a gentleman on the Linux mint forum gave me 3 references about NASM.
The 1st one seems to be very detailed and just what I need.
I'll probably take several weeks trying to digest them.

Until I do more reading and research, I do not at this time know if I can write,
compile and run an assembler program using NASM in Linux.

   
Title: Re: Assembler languages for Linux
Post by: sbk on February 14, 2016, 10:38:09 AM
Hey shankle,

Yes a gentleman on the Linux mint forum gave me 3 references about NASM.
The 1st one seems to be very detailed and just what I need.
I'll probably take several weeks trying to digest them.

Would you mind sharing those references. I'm always interested in NASM related material and I think others following your footsteps toward the Linux world might be interested as well.

Until I do more reading and research, I do not at this time know if I can write,
compile and run an assembler program using NASM in Linux.

It's really not that different from coding on Windows. The biggest difference between the two are the amount of options. With Windows you have the Win API which provides you with uniform access to various features of the operating system. On Linux, the libraries can be different from system to system. For example, simple GUI applications might be dependent on Qt, or GTK, or X/Motif, or whatever.. not all systems are going to have your chosen target by default. This means that, aside from simple system call's and use of the standard C library, your code is usually going to require at least some people to install various libraries to get your program to work. This is oddly acceptable in the Linux world and because of the large number of options for configurations and frameworks, one of the first things the Windows programmer has to learn when switching to Linux is... there is no one correct way to do anything on Linux. I myself kinda miss that about Win32 systems, being able to look up the Windows API reference and know the one correct method to implement a given feature. But it's also liberating, in a way, to be able to choose to develop your software around libraries which share your style of coding.

Anyway, I have faith that you'll do just fine as a Linux programmer. Just avoid telling people what editor you use.. for some reason that starts HUGE arguments within the Linux community.  :lol:

Best Regards,
~ Bryant
Title: Re: Assembler languages for Linux
Post by: shankle on February 14, 2016, 11:50:14 AM
HI SBK,
The references that you requested can be found on Linuxmint.com/forum.
Then go to the Newbie folder and look under my post called "assembler
languages that work in linux". The references are given by the gentleman
called Reorx. Hope this helps.
If not tell me and I will try to find another way of getting the info to you.
Title: Re: Assembler languages for Linux
Post by: sbk on February 14, 2016, 12:25:11 PM
Only interested in 64-bit assemblers.

This is the reason I wanted to see the references. The examples you were given were specific to 32-bit mode Linux systems. These will build and work under your 64-bit Linux using compatibility mode, but you're question (at least here) was much more specific.

I would say bookmark the Linux Assembly (http://asm.sourceforge.net/) page, that one has been a great resource for years. The third link he gave you is on that page, so he really gave you 2 links. The first one is okay, but you're interested in 64-bit systems and there isn't really enough to that tutorial to warrant spending a lot of time on it.

Check out the following:
Title: Re: Assembler languages for Linux
Post by: Gunther on February 14, 2016, 09:50:36 PM
Hi shankle,

my favorite assembler under Linux and BSD is YASM. You'll find some of my Linux sources inside the forum.

The Linux assemblers are: NASM, YASM, FASM and TASM.
From what I have read FASM seems to be the way to go.
Opinions Please....

I think TASM won't work under Linux.

Gunther
Title: Re: Assembler languages for Linux
Post by: anta40 on February 15, 2016, 12:24:46 PM
If you prefer MASM-style assembler, definitely pick JWASM/HJWASM.
But if you don't mind trying different assemblers, NASM/FASM are fine.
Both are still under active development.

BTW, there's an interesting visual IDE  (http://fresh.flatassembler.net)and UI library (http://fresh.flatassembler.net/index.cgi?page=content/related/0_FreshLib.txt) for FASM, which runs on Windows as well on Linux.

 ;)
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 15, 2016, 08:15:33 PM
...
BTW, there's an interesting visual IDE  (http://fresh.flatassembler.net)and UI library (http://fresh.flatassembler.net/index.cgi?page=content/related/0_FreshLib.txt) for FASM, which runs on Windows as well on Linux.
...
Didn't tried it yet but have heard of it earlier . Their site looks very original . I really like it .

BTW One should  not forget Linux native GAS assembler .

EDIT: I noticed a couple of issues with SOL_ASM's -elf64 output object format:
assemble /obj_libc/test.asm with -elf64 switch and link :
Quote
/usr/bin/ld: fatal error: test.obj: unsupported ELF machine number 3
I had to edit ELF header to link it successfully
Code: [Select]
elfedit  --output-mach x86-64  test.objNow test app is built but crashes with  Segmentation fault
The reason - no FASTCALL for Linux .
It's very sad news
The thread on  SOL_ASM development froze a year ago that's why I wan't to post there   
Title: Re: Assembler languages for Linux
Post by: Magnum on February 18, 2016, 04:07:41 PM
I tried Sol Asm, but the examples were only programs that output text.

I am still looking for Linux programs that produce GUI programs. :-)

Title: Re: Assembler languages for Linux
Post by: anta40 on February 18, 2016, 05:26:35 PM
I am still looking for Linux programs that produce GUI programs. :-)

You might want to try these examples (http://flatassembler.net/examples/gtk-examples.tar.gz)...
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 18, 2016, 08:08:08 PM
Here are those examples translated to JWASM
NOTE: samples were linked against  GTK 2. 24

GTK source code (http://www.gtk.org/download/linux.php) comes with nice set of examples.
Title: Re: Assembler languages for Linux
Post by: jcfuller on February 18, 2016, 09:25:27 PM
GoneFishing,
Thanks for the gtk examples.
First attempt on Ubuntu MATE:
  The gtk_button example seg faults on closing.
To correct it I replaced the DeleteEvent with the one from gtk_combo.

I have not done much else but it appears the examples need a little tweaking ?

James
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 18, 2016, 09:32:49 PM
Hi James,
gtk_button example ( and all the rest ) works fine here on Ubuntu 14.04
Tweak it as you like as I don't know why it doesn't work on your machine ( if you know it, please tell me )

[EDIT] Well, looks like I commented out
Quote
;  sub rsp,16
Thanks for noticing  :t

[EDIT] fixed version attached
Title: Re: Assembler languages for Linux
Post by: shankle on February 18, 2016, 11:33:08 PM
For what it's worth I settled on NASM.
From the little I know so far, it seems that it is a function (macro) driven 
assembler. For ex: to put a point on the screen you call the gotoxy function.
There must be hundreds of these macros. I would guess 1 for each
corresponding windows api. Lord what a year this will be :dazzled:
Good Bye Microsoft!
Title: Re: Assembler languages for Linux
Post by: jcfuller on February 19, 2016, 12:00:31 AM
No go.
Still a seg fault when window closes with gtk_button when run from terminal.
Ubuntu MATE 15.10
All gtk dev files from the repository.

James
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 19, 2016, 12:05:07 AM
Hmm,  it must be something wrong with stack ..
Does it show message "closing application..." ?
Did you try to re-compile it from source code ?
What's about other examples?

Maybe version thing . I used GTK 2.24
Your distro seems using  GTK 3.4
Title: Re: Assembler languages for Linux
Post by: Magnum on February 19, 2016, 12:18:00 AM
Thanks anta40
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 19, 2016, 12:55:06 AM
...
  The gtk_button example seg faults on closing.
To correct it I replaced the DeleteEvent with the one from gtk_combo.
...
Oh, after visiting dentist I was a little bit nervous and didn't notice that in gtk_combo :
Quote
sub rsp,8
applied it now to gtk-button
attach updated, fingers crossed
I'm surprised how tolerant my os is - it's eagerly satisfied with  all 3 variants:
Quote
; sub rsp, 16
 sub rsp, 16
 sub rsp,8

P.S.: Personally I prefer LTS  (Long Time Support) Ubuntu distros  - they have *.04 in version number
Title: Re: Assembler languages for Linux
Post by: jcfuller on February 19, 2016, 04:25:43 AM

gtk_handlebox and gtk_checkmenu seg fault on execution

window.asm will not compile
HJWasm v2.13, Jan 30 2016, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
window.asm : Error A2168: General Failure

All others ok

GTK+ version: 2.24.28

James
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 19, 2016, 04:46:30 AM
Thanks James
I get this warning from GTK running gtk_handlebox and gtk_checkmenu:
Quote
(gtk_handlebox:2003): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'detailed_signal != NULL' failed
Do you get SEGFAULT or this warning?
I used JWASM 2.11 when I  translated these examples more than year ago  ... so am using  it now 

[EDIT] Tomorrow I'll upload special versions of gtk_handlebox and gtk_checkmenu examples with checkpoints after each call . It'll save our time and  show where exactly the crash happens
Title: Re: Assembler languages for Linux
Post by: jcfuller on February 19, 2016, 05:19:01 AM
No warning on compile. Seg fault on running.

James
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 19, 2016, 05:20:00 AM
Ok, thanks
PLease, re-read my previous msg - it was updated
Title: Re: Assembler languages for Linux
Post by: jcfuller on February 19, 2016, 10:01:50 PM
Just a FYI.
  I have no experience with 64bit assembler.
I did a little Linux 32bit jwasm testing with gtk eons ago :)
I want to get at least a basic understanding of the 64bit implementation.
My interest is sparked because I am working on a new cross platform Basic -> c/c++ translator with Glib/Gtk as the base.
I have run into many inconsistencies with the Gtk2/3 platforms on both Linux and Windows.
I have spent many hours with the assorted documentation scattered around the internet, but my old brain ......

You might want to revise your demos to not use depreciated gtk functions.
It took zetcode (http://zetcode.com/gui/gtk2/) until this past July to update their offerings.

Looking forward to more info.

Am I correct there is not a working INVOKE for 64bit (Windows or Linux)?

James
Title: Re: Assembler languages for Linux
Post by: jj2007 on February 19, 2016, 10:49:38 PM
Am I correct there is not a working INVOKE for 64bit (Windows or Linux)?

There is nvk by rrr314159 (http://masm32.com/board/index.php?topic=3988.0). He has used it on major sources (>10k lines).
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 20, 2016, 12:05:37 AM
Hello James,
Yes, I know your example gtk01. It was my starting point . I compiled it in 64 bit , see attachment below.

...
Am I correct there is not a working INVOKE for 64bit (Windows or Linux)?
Jwasm doesn't support invoke in 64 bit on Linux . That's why I wrote FCALLTEST macro (http://masm32.com/board/index.php?topic=5153) .
Maybe I should not post yesterday's demos as they are my first steps in using JWASM on linux . Today I attach re-written version of gtk_checkmenu demo . Now it takes advantages of FCALLTEST macro . PROTOs were replaced by EXTERNs . CHECKPOINT macro was added to help us in spotting the problem.
See gtk_checkmenu_checkpoints.zip:
fc.asm - FCALLTEST macro
ISFLOAT?.asm - helper macro
gtk_checkmenu_checkpoints - is compiled with CHECKPOINT macro enabled
gtk_checkmenu - is compiled with CHECKPOINT macro disabled

At some point I was forced to stop further learning GTK development  as I realised that without  floating point arguments support I have poor chances to succeed in it .
Hopefully , with QWORD's help , we will fix this problem and be able to go further.

[EDIT] : added some GTK demos that come with GTK source code
 
Thank you for nice reference . For sure I'll revise the source code of the demos ASAP
Title: Re: Assembler languages for Linux
Post by: jcfuller on February 20, 2016, 01:04:21 AM

Here are my results:

arrow.asm -> seg fault on closing window
aspectframe.asm -> seg fault on closing window
buttonbox.asm -> could not compile: missing fcXMM.asm
gtk01.asm -> OK
base.asm -> OK
buttons.asm -> OK

James
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 20, 2016, 01:19:21 AM
Thanks , James
buttonbox.asm -> could not compile: missing fcXMM.asm
Just rename it to fc.asm : include fc.asm

arrow.asm -> seg fault on closing window
aspectframe.asm -> seg fault on closing window
These demos have no invoke exit,0
Try this:
aspectframe.asm
Quote

_start:
       sub rsp,8
       call main
      invoke exit,0
end   _start

arrow.asm
Quote
  ; Rest in gtk_main and wait for the fun to begin!
  call gtk_main   
  invoke exit,0         
end _start   

AS I've already told my OS is totally forgiving . In these 2 cases it only complains :
Quote
Illegal instruction
Title: Re: Assembler languages for Linux
Post by: jcfuller on February 20, 2016, 01:53:58 AM
No go! I still get Segmentation fault (core dumped)

Here is the result of gtk_checkmenu:
checkpoint 0
checkpoint 1
checkpoint 2
checkpoint 3
checkpoint 4
checkpoint 5
checkpoint 6
checkpoint 7
checkpoint 8
checkpoint 9
checkpoint 10
checkpoint 11
checkpoint 12
checkpoint 13
checkpoint 14
checkpoint 15

(gtk_checkmenu:4197): Gtk-CRITICAL **: IA__gtk_menu_shell_insert: assertion 'GTK_IS_MENU_ITEM (child)' failed
checkpoint 16
checkpoint 17
checkpoint 18
checkpoint 19
checkpoint 20

(gtk_checkmenu:4197): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'detailed_signal != NULL' failed
checkpoint 21
checkpoint 22
checkpoint 23
checkpoint 24
checkpoint 25
checkpoint 26
checkpoint 27
checkpoint 28
checkpoint 29
checkpoint 30
checkpoint 31
checkpoint 32
checkpoint 33
checkpoint 34
checkpoint 35
checkpoint 36
checkpoint 37
checkpoint 38
checkpoint 39
checkpoint 40
checkpoint 41
checkpoint 42
checkpoint 43
checkpoint 44
checkpoint 45
checkpoint 46
checkpoint 47
checkpoint 48
checkpoint 49
checkpoint 50
checkpoint 51
checkpoint 52
checkpoint 53
checkpoint 54
checkpoint 55
checkpoint 56
checkpoint 57
checkpoint 58
checkpoint 59
checkpoint 60
checkpoint 61
checkpoint 62
checkpoint 63
checkpoint 64
checkpoint 65
checkpoint 66
checkpoint 67
checkpoint 68
checkpoint 69
checkpoint 70
checkpoint 71
checkpoint 72
checkpoint 73
closing application...

checkpoint 74


Title: Re: Assembler languages for Linux
Post by: jcfuller on February 20, 2016, 02:00:27 AM
Ok I found it.
aspectframe.asm
I added your change plus I changed
    invoke g_signal_connect_data , window, offset destroy, offset gtk_main_quit, NULL
To this
    invoke g_signal_connect_data , window, offset destroy, gtk_main_quit,0,0,0           

James

Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 20, 2016, 02:09:46 AM
That's odd
All checkpoints passed. Should be ok
Sorry , I didn't get it - is it  gtk_checkmenu segfaulting or arrow / aspectframe ( or all 3 !) ?

Now aspectframe is ok. What about arrow ?
I'll apply your changes on my side
After changing aspectframe - I get SEGFAULT at closing app
This works for aspectframe and arrow ( plus invoke exit,0 as I wrote ):
  invoke g_signal_connect_data , window, offset destroy, offset gtk_main_quit,0,0,0

I found typo in gtk_checkmenu (lines 179-180 in yesterday's archive):
Quote
     xor r9,r9
    xor r8,r8
    xor rcx,rcx
    mov rdx, offset DeleteEvent
    mov rsi, offset szActivate
    mov rdi,[hMenuItem]
    call g_signal_connect_data

   mov rdi,[hMenuItem]
    call g_signal_connect_data

   
Deleted those 2 lines, recompiled, attached
Title: Re: Assembler languages for Linux
Post by: jcfuller on February 20, 2016, 03:51:11 AM

I compiled gtk_checkmenu and then ran it. No seg fault.
James

results:
checkpoint 0
checkpoint 1
checkpoint 2
checkpoint 3
checkpoint 4
checkpoint 5
checkpoint 6
checkpoint 7
checkpoint 8
checkpoint 9
checkpoint 10
checkpoint 11
checkpoint 12
checkpoint 13
checkpoint 14
checkpoint 15

(gtk_checkmenu:6066): Gtk-CRITICAL **: IA__gtk_menu_shell_insert: assertion 'GTK_IS_MENU_ITEM (child)' failed
checkpoint 16
checkpoint 17
checkpoint 18
checkpoint 19
checkpoint 20

(gtk_checkmenu:6066): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'detailed_signal != NULL' failed
checkpoint 21
checkpoint 22
checkpoint 23
checkpoint 24
checkpoint 25
checkpoint 26
checkpoint 27
checkpoint 28
checkpoint 29
checkpoint 30
checkpoint 31
checkpoint 32
checkpoint 33
checkpoint 34
checkpoint 35
checkpoint 36
checkpoint 37
checkpoint 38
checkpoint 39
checkpoint 40
checkpoint 41
checkpoint 42
checkpoint 43
checkpoint 44
checkpoint 45
checkpoint 46
checkpoint 47
checkpoint 48
checkpoint 49
checkpoint 50
checkpoint 51
checkpoint 52
checkpoint 53
checkpoint 54
checkpoint 55
checkpoint 56
checkpoint 57
checkpoint 58
checkpoint 59
checkpoint 60
checkpoint 61
checkpoint 62
checkpoint 63
checkpoint 64
checkpoint 65
checkpoint 66
checkpoint 67
checkpoint 68
checkpoint 69
checkpoint 70
checkpoint 71
checkpoint 72
checkpoint 73
closing application...

checkpoint 74
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*



Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 20, 2016, 04:14:51 AM
Fine!
Thanks James
I spotted the same typo in gtk_handlebox . Fixed version attached
Title: Re: Assembler languages for Linux
Post by: jcfuller on February 20, 2016, 05:52:37 AM
GoneFishing,
  In case you want to play with 64bit Gtk on Windows:
http://lvserver.ugent.be/gtk-win64/sdk/gtk2-gtk3-sdk-2.24.29-3.18.6-2016-01-27-ts-win64.zip
A full Gtk 2&3 development SDK.
This is what I use on the Windows side to test my new translator.

James
Title: Re: Assembler languages for Linux
Post by: GoneFishing on February 20, 2016, 05:58:00 AM
Thanks James,
Somewhere I have old XP box but  use it not so often.
I have  a present for you too ...
https://glade.gnome.org/ GTK WISIWIG (I hope so) editor.
Ther're lots of things to play with ... talking about Linux GUi : QT creator , for example

So... do we have something that's still  crashing ?
Title: Re: Assembler languages for Linux
Post by: shankle on February 21, 2016, 06:30:23 AM
Writing this to Gunther as I know he uses YASM or anyone
else so inclined. Running Linux Mint 17.3.
I downloaded yasm-1.3.0.tar.gz which I assume is for 64-bit
and the Linux mint os.
Unzipped it into /home/jack/yasmfld and extracted it there.
clicked on yasm-1.3.0 and got into the terminal and ran 'make'.
It ran fine. ' Make install'  however had the following errors:
cannot create regular file '/usr/local/bin/yasm:
permission denied'. Got errors 1 &  2

I think this is caused by me putting yasm-1.3.0.tar.gz
in to wrong place. However I don't know how to put it into
/usr/local/bin/yasm in Linux Mint.

Gave up on NASM - documentation is terrible to non existent
or erroneous....

Title: Re: Assembler languages for Linux
Post by: sbk on February 21, 2016, 09:21:54 AM
Writing this to Gunther as I know he uses YASM or anyone
else so inclined. Running Linux Mint 17.3.
I downloaded yasm-1.3.0.tar.gz which I assume is for 64-bit
and the Linux mint os.
Unzipped it into /home/jack/yasmfld and extracted it there.
clicked on yasm-1.3.0 and got into the terminal and ran 'make'.
It ran fine. ' Make install'  however had the following errors:
cannot create regular file '/usr/local/bin/yasm:
permission denied'. Got errors 1 &  2

I think this is caused by me putting yasm-1.3.0.tar.gz
in to wrong place. However I don't know how to put it into
/usr/local/bin/yasm in Linux Mint.

This issue is because you can run make as a normal user, but you need administrative (root) access to the filesystem to install things to /usr/local/bin. Run the make install command as root, or through the sudo command if you have sudoer's support.

Gave up on NASM - documentation is terrible to non existent
or erroneous....

Terrible? I've never had issue with it, that's each person has their own opinions...
Non existent? Absolutely not. NASM Documentation (http://www.nasm.us/doc/)
Erroneous? If you have any examples of that, I'd be interested. Open source projects are great like that, if there is an error, there is almost always someone willing to fix the problem.
Title: Re: Assembler languages for Linux
Post by: shankle on February 21, 2016, 09:48:33 AM
I stand corrected sbk.
Since I am such novice with Linux I should keep
my mouth shut. Sorry.
I saw nothing to tell me I had to run 'make install'
as root. Will do.
Title: Re: Assembler languages for Linux
Post by: Magnum on February 21, 2016, 11:27:36 AM
I stand corrected sbk.
Since I am such novice with Linux I should keep
my mouth shut. Sorry.
I saw nothing to tell me I had to run 'make install'
as root. Will do.

Mint, unlike Puppy, does not run as root.

Look for files with a sh extension.

They are scripts that are useful for installations, etc.

Scripts are like batch files, but are much more powerful.

You are doing great with Linux.

It's a learning curve as with most everything. :-)

 
Title: Re: Assembler languages for Linux
Post by: shankle on February 21, 2016, 11:53:34 AM
Thanks Andy for the encouragement.
NASM and I didn't get along to well.
Trying Yasm to see how it goes....
Title: Re: Assembler languages for Linux
Post by: sbk on February 21, 2016, 04:56:07 PM
Since I am such novice with Linux I should keep
my mouth shut. Sorry.

That's exactly what you shouldn't do. If you have problems, you should always ask for help. You'd be surprised how many people make the same exact mistake when coming from a Windows environment. It's always difficult to remember that the default setup for most Linux systems is to give the user as little access as required to operate. Especially so if, on Windows, you always ran with a user that had administrative privileges. That's oddly common on Windows, but almost unheard of on Linux/BSD systems.

Don't be ashamed at things you don't know, there is way too much information out there for anyone to pretend they know everything. I prefer to think i know nothing, then I'm always happily surprised when I have an answer. :)
Title: Re: Assembler languages for Linux
Post by: Gunther on February 22, 2016, 04:45:06 AM
Hi shankle,

Thanks Andy for the encouragement.
NASM and I didn't get along to well.
Trying Yasm to see how it goes....

Yasm is a re-write of NASM (same syntax, same commands etc.). It's sometimes a bit more effective. By the way, Agner Fog is using more and more YASM.

Gunther
Title: Re: Assembler languages for Linux
Post by: shankle on February 26, 2016, 11:03:01 PM
Nasm has a forum.
I can't find a forum for Yasm. Therefor it's useless for me.
Wonder if any other Linux assemblers have any forums?
In my opinion, the lack of a good organized text to learn a new
programming language is essential. 

On the NASM forum i'm lucky if I get 1 response per day to my questions.
With no books to study about the language and erroneous, outdated and
hard to find solutions, one wonders how anyone can program in NASM.
As an example; I have compiled a program called Demo64. Then I linked
it. But when I try to execute it with ./demo64 it will only execute in a terminal.
I want it to run it on a full screen. From what I have read there is no explanation
on how to execute a program with ./demo64 to a screen.
Title: Re: Assembler languages for Linux
Post by: sbk on February 27, 2016, 05:48:42 AM
As an example; I have compiled a program called Demo64. Then I linked
it. But when I try to execute it with ./demo64 it will only execute in a terminal.
I want it to run it on a full screen. From what I have read there is no explanation
on how to execute a program with ./demo64 to a screen.

If you run the program from a terminal emulator, it's going to run in the emulator (like xterm, rxvt, or gome-terminal). If you want to use console applications directly in the system's console (fullscreen), you have to switch to the console using ALT+CTRL+F1. Linux runs several consoles, my system has 8, ALT+CTRL+F8 runs console that the graphical environment is on, and from ALT+CTRL+F1 to ALT+CTRL+F7 run text-mode consoles. When you switch to a console, you'll have to enter your username and password, but from there you can enter commands just like you do in the terminal emulator.
Title: Re: Assembler languages for Linux
Post by: cman on February 27, 2016, 09:12:18 AM
I've seen some books available for Nasm programming on the Linux Operating system: http://www.amazon.com/s/ref=nb_sb_ss_c_0_23/186-0258296-3939720?url=search-alias%3Dstripbooks&field-keywords=linux+assembly+language+programming&sprefix=linux+assembly+language%2Caps%2C1051 . I haven't read any of them yet , so I can't recommend any of them. From what I've seen , Nasm is sort of a lower- level version of the Masm syntax , so I don't think it would be hard to learn: https://courses.engr.illinois.edu/ece390/archive/mp/f99/mp5/masm_nasm.html .
Title: Re: Assembler languages for Linux
Post by: cman on February 27, 2016, 10:16:30 AM
I forgot , there is also a Nasm manual available in .pdf format : http://www.nasm.us/xdoc/2.09.04/nasmdoc.pdf. 
Title: Re: Assembler languages for Linux
Post by: Gunther on March 06, 2016, 12:56:01 AM
Thank you cman for providing the book sources. I think Ray Seyfarth's (http://www.amazon.com/Introduction-Bit-Assembly-Programming-Linux/dp/1484921909/ref=sr_1_4/190-7809170-9108402?s=books&ie=UTF8&qid=1457185937&sr=1-4&keywords=linux+assembly+language+programming) book is worth reading. I've an older edition.

Gunther
Title: Re: Assembler languages for Linux
Post by: cman on March 06, 2016, 05:16:26 AM
I noticed some schools have older versions of these books available to read online , like "Assembly Language Step-by-Step: Programming with Linux" can be found here: http://faculty.petra.ac.id/indi/files/Assembly%20Language%20step%20by%20step.pdf. You have to read the book on your computer, though , which isn't much fun. :biggrin:
Title: Re: Assembler languages for Linux
Post by: Gunther on March 16, 2016, 03:46:30 AM
Hi cman,

You have to read the book on your computer, though , which isn't much fun. :biggrin:

I think it's a PDF file, but it has 465 pages. That's the point.

Gunther