News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Linus programming

Started by Magnum, March 30, 2014, 05:01:43 PM

Previous topic - Next topic

carlos

Youŕe rigth Gunther, Assembler is the LEAST portable of all languages, but my point is, that is not the same to switch from nasm (an masm like assemembler) in intel linux, to GAS in Raspberry, that to switch from GAS Intel to GAS ARM,  NASM is TOTALY diferent from GAS, and it works only for Intel proccesor.  GAS is uniform acros all the Linux platforms,  if you learn GAS, (ugly as it is) you could prorogramm in assembler in intel, PowerPC, ARM  and all processors that Linux is ported on, or even to where it is not ported, (gpasm is based on GAS, and is an assembler for the microcchip PIC)

Yes GAS is ugly, but is the lingua franca in assembler, across platforms.

Carlos


jj2007

http://www.japheth.de/JWasm/Samples.html

Hit Control F, then insert Linux

JWasm (apart from being pretty) even has a very powerful macro engine, and is Masm compatible.

As to the "it runs everywhere" argument: Yes, that's true. For example, bicycles can be used on Earth and on the Moon, while Ferraris can be used only on Earth. Is that a valid argument to use bicycles on Earth?

I do use my bicycle, but not for reasons of cross-platform compatibility ;-)

Gunther

Hi Carlos,

Quote from: carlos on April 11, 2014, 01:27:32 PM
GAS is uniform acros all the Linux platforms,  if you learn GAS, (ugly as it is) you could prorogramm in assembler in intel, PowerPC, ARM  and all processors that Linux is ported on, or even to where it is not ported, (gpasm is based on GAS, and is an assembler for the microcchip PIC)

I don't agree with you. The PowerPC hasn't registers %eax, %ebx etc. See my example in post #14. And here is an example for ARM:

        AREA     ARMex, CODE, READONLY
                                ; Name this block of code ARMex
        ENTRY                   ; Mark first instruction to execute
start
        MOV      r0, #10        ; Set up parameters
        MOV      r1, #3
        ADD      r0, r0, r1     ; r0 = r0 + r1
stop
        MOV      r0, #0x18      ; angel_SWIreason_ReportException
        LDR      r1, =0x20026   ; ADP_Stopped_ApplicationExit
        SVC      #0x123456      ; ARM semihosting (formerly SWI)
        END                     ; Mark end of file


Do you see any similarity to the GAS Intel syntax? I can't see that.

Gunther
You have to know the facts before you can distort them.

qWord

Quote from: carlos on April 11, 2014, 01:27:32 PMGAS is ugly
just as side note, GAS is designed as backend assembler and thus has a simple-to-parse syntax:
Quote from: as documentation"`as' is primarily intended to assemble the output of the GNU C
compiler `gcc' for use by the linker `ld'.
MREAL macros - when you need floating point arithmetic while assembling!

Gunther

Quote from: qWord on April 11, 2014, 08:18:28 PM
just as side note, GAS is designed as backend assembler and thus has a simple-to-parse syntax:
that's right. But one can use GAS with:
.intel_syntax noprefix
It's comfortable.

Gunther
You have to know the facts before you can distort them.

Vortex

The Solar Assembler is another alternative for Linux programming.

Gunther

Quote from: Vortex on April 12, 2014, 03:53:10 AM
The Solar Assembler is another alternative for Linux programming.

yes, it's a good alternative. Thank you, Erol. :t Here is Bogdans site.

Gunther
You have to know the facts before you can distort them.

Guenther78

Hello,

I found the NASM forum (http://forum.nasm.us/index.php?topic=1457.0), where the user Gunner sent some links to his tutorials. One, for example, is nasm and gtk, code that works for windows and linux: http://www.dreamincode.net/forums/topic/292403-nasm-cross-os-app-for-linuxwindows-using-gtk/

Best regards,

Guenther

Gunther

Thank you for the interesting link, Guenther. By the way, Gunner is member of our forum, too.

Gunther
You have to know the facts before you can distort them.

Gunner

I had many requests for a Linux version of one of my Windows programs, so I finally bit the bullet and moved over to Linux.  Once I am done, (can't give a time frame since I work on it in my spare time) I will release the source fully commented.  It uses GTK+, libcURL, Glade (to design the interface), gcc to link, and might add SQLite if I decide to use a database.  I like the fact that you can use CSS to change the styles of the windows and widgets.  GTK support for windows is a bit lacking (the binaries are a bit behind linux).  It has been an interesting learning experience for sure.
~Rob

Magnum

Great to hear.

What version are you running ?
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

Gunther

Quote from: Gunner on November 04, 2014, 02:03:48 PM
I had many requests for a Linux version of one of my Windows programs, so I finally bit the bullet and moved over to Linux.  Once I am done, (can't give a time frame since I work on it in my spare time) I will release the source fully commented.  It uses GTK+, libcURL, Glade (to design the interface), gcc to link, and might add SQLite if I decide to use a database.  I like the fact that you can use CSS to change the styles of the windows and widgets.  GTK support for windows is a bit lacking (the binaries are a bit behind linux).  It has been an interesting learning experience for sure.

That's good news, Gunner. Go forward. :t

Gunther
You have to know the facts before you can distort them.

Guenther78

Hello,

I just have found another example:
http://programminggroundup.blogspot.de/2007/01/appendix-gui-programming.html

I have Ubuntu 12.04 and I am going to test it.
Best regards,

Günther

Gunther

Günther,

Quote from: Guenther78 on November 06, 2014, 10:37:35 PM
I just have found another example:
http://programminggroundup.blogspot.de/2007/01/appendix-gui-programming.html

interesting link. It's AT&T syntax and that's not very popular by the majority of our forum members. But it's easy to convert. Thank you for the information. :t

Gunther
You have to know the facts before you can distort them.

Gunner

Ugh, if the year in the URL is any indication, that is way old and probably obsolete!

GTK+ API Documentation and Official GTK site

GTK+ Tutorials over at ZetCode

There are tons of samples, tutorials, and open source apps on the net that use GTK+.  It is mostly in C, but it is trivial to convert to Assembly.

Here is something I wrote about a year ago.

https://github.com/GunnerInc/ip-country-info

It takes an IP address and queries IPInfoDB for the Country info and displays that info along with the flag of the country. (NASM, GTK+, libcURL, Linux)
~Rob