News:

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

Main Menu

Assembler languages for Linux

Started by shankle, February 14, 2016, 01:46:33 AM

Previous topic - Next topic

jj2007

Quote from: jcfuller on February 19, 2016, 10:01:50 PMAm I correct there is not a working INVOKE for 64bit (Windows or Linux)?

There is nvk by rrr314159. He has used it on major sources (>10k lines).

GoneFishing

#31
Hello James,
Yes, I know your example gtk01. It was my starting point . I compiled it in 64 bit , see attachment below.

Quote from: jcfuller on February 19, 2016, 10:01:50 PM
...
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 .
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

jcfuller


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

GoneFishing

Thanks , James
Quote from: jcfuller on February 20, 2016, 01:04:21 AM
buttonbox.asm -> could not compile: missing fcXMM.asm
Just rename it to fc.asm : include fc.asm

Quote from: jcfuller on February 20, 2016, 01:04:21 AM
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 :
QuoteIllegal instruction

jcfuller

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



jcfuller

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


GoneFishing

#36
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

jcfuller


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
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*




GoneFishing

#38
Fine!
Thanks James
I spotted the same typo in gtk_handlebox . Fixed version attached

jcfuller

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

GoneFishing

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 ?

shankle

#41
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....


sbk

Quote from: 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.

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.

Quote from: shankle on February 21, 2016, 06:30:23 AM
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
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.

shankle

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.

Magnum

Quote from: 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.

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. :-)

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org