Author Topic: exit code not 0  (Read 1672 times)

0 Members and 1 Guest are viewing this topic.

jack

  • Guest
exit code not 0
« on: June 27, 2019, 08:55:06 AM »
I had not noticed the exit-code while using Oxide, but then decided to try geany and even a very simple 2 line program will exit with code other than 0
Code: [Select]
' ARITHMETIC

print 1+2+3+4

print 1 2 3 4
gxo2.exe -64 Arithmetic.o2bas
(program exited with code: -1879506944)
is this normal?

gxo2.exe -32 Arithmetic.o2bas     exit-code 0
but I also saw 32-bit programs with non-zero exit code

btw, what's the difference between co2 and gxo2?

Arnold

  • Guest
Re: exit code not 0
« Reply #1 on: June 28, 2019, 12:24:32 AM »
The -64 / -32 switch was new to me. But if this works this is a great feature. I saved your code in a file and in a DOS window I applied:

D:\OxygenBasic\Tests>d:\OxygenBasic\co2.exe -64 print_test.o2bas

This created an exe file which seems not to need oxygen.dll. -32 created a 32bit exe file. The Messagebox says: Okay. The exe prints 10 and 10 which is expected.

I suppose the -64 / -32 switches are still in the testing phase, otherwise Charles would already have mentioned them?

Charles Pegge

  • Guest
Re: exit code not 0
« Reply #2 on: June 28, 2019, 12:39:59 AM »
I'll have to do a health check on exit-codes. I noticed the RTLs code was not correct. It should be:

32bit
Code: [Select]
push eax
call ExitProcess
64bit
Code: [Select]
mov rcx,rax
call ExitProcess

jack

  • Guest
Re: exit code not 0
« Reply #3 on: June 28, 2019, 12:53:52 AM »
hello Charles and Arnold
what I miss in Oxide is a "run" button that will launch the compiled program, because I was unable to "run program directly" when the source has uses rtl64 or uses rtl32, for this reason I tried the geany IDE, if only there was some way to have the compilation feedback sent to the geany compilation log pane instead of the message box

Mike Lobanovsky

  • Guest
Re: exit code not 0
« Reply #4 on: June 28, 2019, 02:28:19 AM »
... otherwise Charles would already have mentioned them?

Not necessarily. ;D

Arnold

  • Guest
Re: exit code not 0
« Reply #5 on: June 28, 2019, 05:13:59 AM »
Hi Jack,

with my PsPad editor I can add options to start co2.exe of different Oxygen distributions (no need for a batch file). For this special -64 switch I created a batch file in the Oxygenbasic folder (at the moment I am only experimenting too):

Code: [Select]
:: Filename without .o2bas extension

d:\Oxygenbasic\co2.exe -64 %1%

%1%.exe

In the Highlighter Menu of my editor I added this command for external programs:

"D:\Oxygenbasic\CompileRun64.bat" "%Dir%%Name%"

I suppose for Geany something similiar should be possible too. In Oxide you can create project files, but I do not exactly know how this works. I also think Oxide needs some revision?

Roland


jack

  • Guest
Re: exit code not 0
« Reply #6 on: June 28, 2019, 05:55:48 AM »
@Arnold
yes, geany is quite flexible, but at the moment there's no syntax file for O2 which makes the source look bland.
on the other hand, I am hesitant to say this, but it seems to me that O2-64 does not conform to the windows x64 ABI, because the atan2l function that I tried to call should have worked, see the thread https://www.oxygenbasic.org/forum/index.php?topic=1922.msg20651;topicseen#msg20651
I apologize if (more than likely) I am wrong.
« Last Edit: June 28, 2019, 06:06:23 AM by jack »

JRS

  • Guest
Re: exit code not 0
« Reply #7 on: June 28, 2019, 08:01:52 AM »
Has anyone looked at open source Visual Studio Code? There seems to be an extensive assortment of addons.

Aurel

  • Guest
Re: exit code not 0
« Reply #8 on: June 28, 2019, 08:14:24 AM »
I really don't get it, people
What you see in editor like Geany...
I never liked that one for many reasons.

Jack
Do you tried any other editor than Geany?
Do you tried my Aurel Edit ..written in Oxygen Basic.It have button RUN.
here is topic:
https://www.oxygenbasic.org/forum/index.php?topic=1488.0
It is open source ..o you can modify,change..do what you wish..  :)
To run directly you must have oxygen.dll inside your program folder and that is all.

jack

  • Guest
Re: exit code not 0
« Reply #9 on: June 28, 2019, 08:33:55 AM »
thank Aurel, will give it a try :)

Charles Pegge

  • Guest
Re: exit code not 0
« Reply #10 on: June 28, 2019, 12:22:11 PM »
I'll add some more options to the co2 compiler


  -d               compile to DLL instead of EXE
  -r               run compiled file


Code: [Select]
  compiler options:
  <filename>       compile and execute directly in memory
  -a <filename>    list assembly code
  -b <filename>    list o2 machine script
  -c <filename>    <optional filename>  compile to 32bit binary
  -32 <filename>   <optional filename>  compile to 32bit binary
  -64 <filename>   <optional filename>  compile to 64bit binary
  -i <filename>    list intermediate code
  -m               output to console
  -d               compile to DLL instead of EXE
  -r               run compiled file

This will help provide more run options in Oxide and other IDEs