[Slackbuilds-users] X11Basic - testers required if you please
Duncan Roe
duncan_roe at acslink.net.au
Thu Mar 13 23:16:40 UTC 2014
Sure - send me a copy (or URL)
Cheers ... Duncan.
On Thu, Mar 13, 2014 at 10:25:34PM +0000, Nick Warne wrote:
> Hi all,
>
> Bare with me:
>
> If you are old enough and remember the Atari ST there was a great
> programming language called 'GFA Basic' (I coded my own word processor and
> file manager [amongst other things] in it many years ago).
>
> First of, it was a BASIC type, but it was so powerful you could do almost
> anything as fast as today's C type languages.
>
> Anyway, following on from this thread in a crossword forum I frequent:
>
> http://www.boards2go.com/boards/board.cgi?action=read&id=1394535442.74065&user=dharrison
>
> I wondered about GFA basic - a search reveals:
>
> http://x11-basic.sourceforge.net/
>
> It takes a bit of sussing out how to build on Slack 14.1, and I am looking
> to do a build for the community.
>
> But first I need to find out a few things.
>
> I knocked up a quick X11Basic program that finds factors of numbers
> (attached factors.bas [text file]) and also the interim converted file to
> compile as a native ELF binary that can be compiled with GCC (attached,
> factors.c [text file BYTECODE text]).
>
> X11Basic also has a tool that can build this as a static binary, so you
> shouldn't need X11Basic at all.
>
> Here is my request.
>
> Can anybody here be willing to test the static binary so I know it does
> work? I can't ask anybody else, as I don't know anybody else that runs
> GNU/Linux except on the Internet...
>
> If you do, I can mail it [factors_static.gz 463K ~ gunzipped 1.1M].
>
> Thanks,
>
> Nick
> --
> "A bug in the code is worth two in the documentation."
> FSF Associate Member 5508
> http://linicks.net/
> http://pi.linicks.net/
> 'double Ctrl+C to exit
> cls
> again:
> c=1
> print "Input a number to factorize"
> input f
> for a = 1 to sqr(f)
> if floor(f/a)=(f/a)
> print c*2;":";a;"x";(f/a)
> inc c
> endif
> next a
> if c=2
> print f;" is a prime"
> endif
> goto again
> /* X11-Basic-Compiler Version 1.22
> (c) Markus Hoffmann 2002-2014
>
>
> Bytecode: factors.b (352 Bytes)
>
> txt: $00000028 108
> rodata: $00000094 76
> sdata: $000000e0 0
> data: $000000e0 0
> bss: $000000e0 24
> str: $000000e0 32
> sym: $00000100 96
> Strings: compiled by xbbc
>
> 8 symbols:
> */
> #include <x11basic/xb2csol.h>
>
> /* Data section compiled by xb2c. */
>
>
> /* Function prototypes */
>
> /* Variables */
> double VARf_C; /* typ=0x2, subtyp=0x0; vnr=0 sym=3 $0000: */
> double VARf_A; /* typ=0x2, subtyp=0x0; vnr=1 sym=4 $0008: */
> double VARf_F; /* typ=0x2, subtyp=0x0; vnr=2 sym=5 $0010: */
>
> main(int anzahl, char *argumente[]) {
> MAIN_INIT;
> databufferlen=0;
> add_variable("C",0x2,0,V_STATIC,(char *)&VARf_C); /*0 $00: */
> add_variable("A",0x2,0,V_STATIC,(char *)&VARf_A); /*1 $08: */
> add_variable("F",0x2,0,V_STATIC,(char *)&VARf_F); /*2 $10: */
> /* 00 */ PUSHCOMM(32,0); /* CLS */
> /* 03 */LBL_3: PUSH1;
> /* 04 */ X2F;
> /* 05 */ ZUWEIS(0); /* C */
> /* 08 */ PUSHX("\"Input a number to factorize\""); /*len=29*/
> /* 0e */ PUSHCOMM(148,1); /* PRINT */
> /* 11 */ PUSHX("F"); /*len=1*/
> /* 17 */ PUSHCOMM(95,1); /* INPUT */
> /* 1a */ PUSH1;
> /* 1b */ ZUWEIS(1); /* A */
> /* 1e */LBL_1e: PUSHV(2); /* F */
> /* 21 */ PUSHV(1); /* A */
> /* 24 */ DIV;
> /* 25 */ PFUNC_FLOOR; /* FLOOR() */
> /* 28 */ PUSHV(2); /* F */
> /* 2b */ PUSHV(1); /* A */
> /* 2e */ DIV;
> /* 2f */ EQUAL;
> /* 30 */ JUMPIFZERO LBL_44; /* JEQ(0x44); */
> /* 35 */ PUSHX("C*2;\":\";A;\"x\";(F/A)"); /*len=19*/
> /* 3b */ PUSHCOMM(148,1); /* PRINT */
> /* 3e */ PUSHVV(0); /* C */
> /* 41 */ COMM_INC; /* 93 1 INC */
> /* 44 */LBL_44: PUSH1;
> /* 45 */ PUSHV(1); /* A */
> /* 48 */ ADD;
> /* 49 */ DUP;
> /* 4a */ ZUWEIS(1); /* A */
> /* 4d */ PUSHV(2); /* F */
> /* 50 */ PFUNC_SQR; /* SQR() */
> /* 53 */ GREATER;
> /* 54 */ JUMPIFZERO LBL_1e; /* BEQ_s(-56); */
> /* 56 */ PUSHV(0); /* C */
> /* 59 */ PUSH2;
> /* 5a */ EQUAL;
> /* 5b */ JUMPIFZERO LBL_69; /* JEQ(0x69); */
> /* 60 */ PUSHX("F;\" is a prime\""); /*len=15*/
> /* 66 */ PUSHCOMM(148,1); /* PRINT */
> /* 69 */LBL_69: goto LBL_3; /* BRA_s(-104); */
> }
> _______________________________________________
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - http://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - http://slackbuilds.org/faq/
>
--
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
More information about the SlackBuilds-users
mailing list