mybusinessbasic-devel Mailing List for My Business Basic
Status: Alpha
Brought to you by:
mikecurry1974
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(90) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mike C. <mi...@mj...> - 2006-04-03 19:31:38
|
We have again started working on MyBB and expect a new release in the months to come. Our plans are to add a Native SQL engine for the database to make it a fully functional business basic product. We will also be revisiting many functions and modules to fix errors and improve our product. We will also be looking into a windows release soon. Mike Curry April 3/2006 |
From: <ben...@id...> - 2004-05-25 08:05:19
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: Karl T. <ket...@co...> - 2004-01-27 16:02:01
|
Hi, I was excited to find this project, but I am wondering is it dying off now? I have watched for a couple weeks with what looks like no activity. I have undertaken an effort to put some basic commenting into your source files to make them easier to follow as well as pointing out some places where I think some activities should take place (for example parsing the config file). I also have posted a few bugs up on the buglist. I hope this e-mail generates a little activity (at least to the point of adding my ID ktatgenhorst to the developers list so I can post my files. Cheers, Karl Tatgenhorst |
From: <mti...@us...> - 2003-12-31 17:36:39
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv30537 Modified Files: operators.h Log Message: added ITR() function and also reworked RTI() Index: operators.h =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/operators.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** operators.h 18 Dec 2003 17:17:31 -0000 1.1 --- operators.h 31 Dec 2003 17:36:36 -0000 1.2 *************** *** 266,269 **** --- 266,270 ---- #define FNC_INT 0x74 #define FNC_IOR 0x75 + #define FNC_ITR 0x8DE0 #define FNC_KEY 0x76 #define FNC_LEN 0x77 |
From: <mti...@us...> - 2003-12-31 17:36:23
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv30517 Modified Files: tables.c Log Message: added ITR() function and also reworked RTI() Index: tables.c =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/tables.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tables.c 29 Dec 2003 19:36:55 -0000 1.2 --- tables.c 31 Dec 2003 17:36:19 -0000 1.3 *************** *** 398,401 **** --- 398,402 ---- { "INT", FNC_INT, 1, 1 }, { "IOR", FNC_IOR, 2, 2 }, + { "ITR", FNC_ITR, 1, 1 }, { "KEY", FNC_KEY, 1, 2 }, { "LCS", FNC_LCS, 1, 2 }, |
From: <mti...@us...> - 2003-12-31 17:36:05
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv30443 Modified Files: functions.c Log Message: added ITR() function and also reworked RTI() Index: functions.c =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/functions.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions.c 20 Dec 2003 13:08:23 -0000 1.2 --- functions.c 31 Dec 2003 17:36:01 -0000 1.3 *************** *** 45,67 **** int fnc_err(statement *stmt, int start); int fnc_tcb(int num); ! long fnc_rti(const char *str); struct utsname Uname; - struct numeral { - long val; - int ch; - }; - - static struct numeral numerals[] = { - { 1L, 'I' }, - { 5L, 'V' }, - { 10L, 'X' }, - { 50L, 'L' }, - { 100L, 'C' }, - { 500L, 'D' }, - { 1000L, 'M' } - }; - void exec_function(program *pgm, statement *stmt, int pos) { --- 45,53 ---- int fnc_err(statement *stmt, int start); int fnc_tcb(int num); ! void fnc_rti(void); ! void fnc_itr(void); struct utsname Uname; void exec_function(program *pgm, statement *stmt, int pos) { *************** *** 362,368 **** break; case FNC_RTI: ! c = strexecpop(); ! fltexecpush(int2flt(fnc_rti(c.str))); break; --- 348,357 ---- break; + case FNC_ITR: + fnc_itr(); + break; + case FNC_RTI: ! fnc_rti(); break; *************** *** 1644,1672 **** } - long fnc_rti(const char *str) - { - int i, j, k; - long retval = 0L; ! if (!str || '\0' == *str) ! return -1L; ! for (i = 0, k = -1; str[i]; ++i) { ! for (j = 0; j < 7; ++j) ! { ! if (numerals[j].ch == toupper(str[i])) ! break; ! } ! if (7 == j) ! return -1L; ! if (k >= 0 && k < j) ! { ! retval -= numerals[k].val * 2; ! retval += numerals[j].val; ! } ! else retval += numerals[j].val; ! k = j; } ! return retval; } --- 1633,1768 ---- } ! //----- ! // Convert an number to a (extened) Roman number ! //----- ! void fnc_itr( void ) ! { ! long p=0; ! long w=0; ! long arabic=0; ! char *roman=NULL; ! ! typedef struct ! { ! long highNum; // arabic number ! char *highStr; // roman numeral ! char highLen; // length of roman numeral ! long lowNum; // arabic number ! char *lowStr; // roman numeral ! char lowLen; // length of roman numeral ! } ROMAN; ! ! static ROMAN Roman[]= ! { ! { 1000000L, "m", 1, 900000L, "cm", 2 }, ! { 500000L, "d", 1, 400000L, "cd", 2 }, ! { 100000L, "c", 1, 90000L, "xc", 2 }, ! { 50000L, "l", 1, 40000L, "xl", 2 }, ! { 10000L, "x", 1, 9000L, "ix", 2 }, ! { 5000L, "v", 1, 4000L, "iv", 2 }, ! { 1000L, "M", 1, 900L, "CM", 2 }, ! { 500L, "D", 1, 400L, "CD", 2 }, ! { 100L, "C", 1, 90L, "XC", 2 }, ! { 50L, "L", 1, 40L, "XL", 2 }, ! { 10L, "X", 1, 9L, "IX", 2 }, ! { 5L, "V", 1, 4L, "IV", 2 }, ! { 1L, "I", 1, 1L, "I", 1 } ! }; ! ! arabic = flt2long(fltexecpop()); ! ! //----- allocate space for roman number ----- ! roman = (char*) calloc(1,128); ! if( !roman ) { strexecpush(""); return; } ! ! //----- keep processing the arabic until its zero ----- ! do ! { ! //----- try all of the "high" Roman numerals ----- ! while( arabic >= Roman[w].highNum ) { ! memcpy( roman+p, Roman[w].highStr, Roman[w].highLen ); ! p += Roman[w].highLen; ! arabic -= Roman[w].highNum; ! if( p>= 128 ) { strexecpush(""); return; } } ! ! //----- try all of the "low" Roman numerals ----- ! if( arabic>= Roman[w].lowNum ) ! { ! memcpy( roman+p, Roman[w].lowStr, Roman[w].lowLen ); ! p += Roman[w].lowLen; ! arabic -= Roman[w].lowNum; ! if( p >= 128 ) { strexecpush(""); return; } ! } ! w++; ! } while( arabic>0 ); ! realloc(roman,p+1); // reallocate base on space used ! ! strexecpush(roman); ! ! return; } + + //----- + // convert a (extended) Roman numeral to arabic. lower case roman numerals + // represent the "bar" syntax. which means that the numeral is 1000 + // times its normal (upper case) value. + //----- + void fnc_rti( void ) + { + char *p=NULL; // temp ptr + char *rom=NULL; // copy of original roman numeral + long i=0; // forloop counter + long l=0; // length of original roman numeral + long arabic=0; // result to return + mybbstring roman; + + typedef struct + { + char *roman; // a roman numeral + char len; // its length + int arabic; // its arabic equivalent + } ROMAN; + + static ROMAN Roman[]= + { + {"i", 1, 1000}, + {"iv", 2, 4000}, {"ix", 2, 9000}, {"xl", 2, 40000}, + {"xc", 2, 90000}, {"cd", 2, 400000}, {"cm", 2, 900000}, + {"v", 1, 5000}, {"x", 1, 10000}, {"l", 1, 50000}, + {"c", 1, 100000}, {"d", 1, 500000}, {"m", 1, 1000000}, + {"IV", 2, 4}, {"IX", 2, 9}, {"XL", 2, 40}, + {"XC", 2, 90}, {"CD", 2, 400}, {"CM", 2, 900}, + {"I", 1, 1}, {"V", 1, 5}, {"X", 1, 10}, + {"L", 1, 50}, {"C", 1, 100}, {"D", 1, 500}, + {"M", 1, 1000}, + {NULL, 0, 0} + }; + + roman = strexecpop(); + + l = roman.len; // get len of original + rom = (char *)calloc(1,l+1); // get space for a copy + memcpy(rom,roman.str,l); // make a copy + + // test each entry in the Roman table + while( Roman[i].roman ) + { + while( (p=strstr(rom,Roman[i].roman)) ) // found one? + { + arabic += Roman[i].arabic; // increment arabic + memset(p,' ',Roman[i].len); // "delete" found numeral + } + i++; + } + + free(rom); + + fltexecpush(long2flt(arabic)); + + return; + } + |
From: <mti...@us...> - 2003-12-31 17:35:49
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv30383 Modified Files: utilities.c Log Message: added ITR() function and also reworked RTI() Index: utilities.c =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/utilities.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** utilities.c 30 Dec 2003 03:52:28 -0000 1.5 --- utilities.c 31 Dec 2003 17:35:45 -0000 1.6 *************** *** 514,517 **** --- 514,532 ---- } + + //----- + // Convert a long into an mybbfloat + //----- + mybbfloat long2flt(long num) + { + mybbfloat flt; + + flt.mantisa.i = num; + flt.exp = 0; + + return flt; + } + + mybbfloat asc2flt(char *str) { *************** *** 610,613 **** --- 625,649 ---- return x; } + + + //----- + // Return a float cast as an long + //----- + long flt2long(mybbfloat flt) + { + long x, y; + char tmp[32], tmp2[32]; + + if (flt.exp) + { + sprintf(tmp, "%ld", flt.mantisa.i); + for (y=0; y<strlen(tmp)+flt.exp; y++) { tmp2[y] = tmp[y]; } + x = atoi(tmp2); + } + else x = flt.mantisa.i; + + return x; + } + double flt2dbl(mybbfloat flt) |
From: <mti...@us...> - 2003-12-31 17:35:34
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv30355 Modified Files: mybb.h Log Message: added ITR() function and also reworked RTI() Index: mybb.h =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/mybb.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mybb.h 29 Dec 2003 19:37:09 -0000 1.7 --- mybb.h 31 Dec 2003 17:35:30 -0000 1.8 *************** *** 370,374 **** --- 370,376 ---- void reduce(mybbfloat *flt); mybbfloat int2flt(int x); + mybbfloat long2flt(long x); int flt2int(mybbfloat flt); + long flt2long(mybbfloat flt); mybbfloat dbl2flt(double dbl); double flt2dbl(mybbfloat flt); |
From: <is...@us...> - 2003-12-30 23:44:57
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv24646 Modified Files: mybb.c Log Message: Fixed compile problem, though I'm not sure why. Index: mybb.c =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/mybb.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mybb.c 30 Dec 2003 22:52:18 -0000 1.4 --- mybb.c 30 Dec 2003 23:44:51 -0000 1.5 *************** *** 62,71 **** program *pgm; FILE *fp; - char *prompt; ! prompt=fgetValue("ConsolePrompt"); ! char *StartUpProgram; ! StartUpProgram=fgetValue("StartUp"); signal(SIGFPE, fpe_handler); --- 62,71 ---- program *pgm; FILE *fp; char *prompt; ! char *startup; ! prompt = fgetValue("ConsolePrompt"); ! ! startup = fgetValue("StartUp"); signal(SIGFPE, fpe_handler); *************** *** 79,83 **** envinfo.argv[x] = argv[x]; ! if ((fp = fopen("start_up", "rb")) == NULL) printf("\n"); else --- 79,83 ---- envinfo.argv[x] = argv[x]; ! if ((fp = fopen( startup, "rb")) == NULL) printf("\n"); else *************** *** 86,90 **** pgm = SafeMalloc(sizeof(program)); envinit(); ! loadall(pgm, "start_up"); runprog(pgm, 1); free(pgm); --- 86,90 ---- pgm = SafeMalloc(sizeof(program)); envinit(); ! loadall(pgm, startup); runprog(pgm, 1); free(pgm); |
From: <is...@us...> - 2003-12-30 22:52:21
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv11207 Modified Files: mybb.c Log Message: Removed some end-of-line carriage returns Index: mybb.c =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/mybb.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mybb.c 20 Dec 2003 03:30:52 -0000 1.3 --- mybb.c 30 Dec 2003 22:52:18 -0000 1.4 *************** *** 62,71 **** program *pgm; FILE *fp; ! ! char *prompt; ! prompt=fgetValue("ConsolePrompt"); ! ! char *StartUpProgram; ! StartUpProgram=fgetValue("StartUp"); signal(SIGFPE, fpe_handler); --- 62,71 ---- program *pgm; FILE *fp; ! ! char *prompt; ! prompt=fgetValue("ConsolePrompt"); ! ! char *StartUpProgram; ! StartUpProgram=fgetValue("StartUp"); signal(SIGFPE, fpe_handler); |
From: Michael S. L. <mi...@ha...> - 2003-12-30 19:34:05
|
Gary McClellan <mailto:ga...@bb...> wrote: >> 6) Fields in Multi-keyed files should be named and access should be >> permitted by name as well as by field number. For instance if field >> number 8 in a file is named "Partnum" then an IOLIST could be >> written as either "IOLIST #8=PART$" or "IOLIST #PARTNUM=PART$" or >> more traditionally as "IOLIST *,*,*,*,*,*,*,PART$" >> >> 7) Fields in direct files should not be named and access should be >> permitted only by field number. For instance if field number 8 in a >> file contains the "Partnum" information then an IOLIST could be >> written as either "IOLIST #8=PART$" or more traditionally as "IOLIST >> *,*,*,*,*,*,*,PART$" >> >> 8) The key fields in multi-keyed files can be used in the "KEY=" >> function to specify which of the keys to use for access. For >> instance if the "Partnum" field is designated as a key field then a >> read command could be written as follows "READ >> (1,KEY=#PARTNUM=PART$)A1$,A2$,A3$..." or as "READ >> (1,KEY=#8=PART$)A1$,A2$,A3$..." > > Just out of curiousity, which BB uses this syntax? It's part OpenBasic and part BBx. > Why the special exception for Direct files (#7)? Because in every flavor of BB that I've used, Direct files do not have named fields. > What is the syntax for defining the field names (#PARTNUM) and key > names? A good point. I need to define the command that will create multi-keyed files as that will determine the format string containing the field definitions and names. I'll make a suggestion based on how it works in OpenBasic and you folks can hammer on it. ;-) > Should we also allow for the ProvideX method of having an embedded > data dictionary and IOLIST? (OPEN (chan,iol=*) means use the embedded > IOLIST on all future I/O operations where an IOLIST is not > specififed). It specifies the variable names to be used? Wow... that's interesting. Comments anyone? -- Michael St. Laurent Hartwell Corporation |
From: Michael S. L. <mi...@ha...> - 2003-12-30 19:18:36
|
Montgomery Tidwell <mailto:MTi...@ca...> wrote: [snip] > has the decision been made that PBL will be used as the DB library? > if not, i suggest you look at the miniDB library > http://www.atbas.org/minidb/index.php . one thing that i like better > about miniDB is that it will allow you to create/build/delete indices > on the fly. We were leaning that way but it's not set in stone yet. Hmmm... Let's see... The miniDB data files produced are ASCII and can therefore be parsed using standard unix tools like grep. That's a nice feature. I wonder if there is a speed penalty for it? My impression is that unless there are performance issues the miniDB library will work just as well (and perhaps even better than) the PBL library. Both libraries use the GPL so licensing is not an issue. Does anyone else have comments or a preference? >> 5) We should add a "DIR=" function to be used in READ statements >> that will indicate the direction of the read. > > i think you are asking for BBx compatible commands/features, and i > agree. Acutally it's a combination of features from BBx and MAI's OpenBasic. I'm not a big BBx user though so if you see something missing from the spec please mention it. >> 6) Fields in Multi-keyed files should be named and access should be >> permitted by name as well as by field number. For instance if field >> number 8 in a file is named "Partnum" then an IOLIST could be >> written as either "IOLIST #8=PART$" or "IOLIST #PARTNUM=PART$" or >> more traditionally as "IOLIST *,*,*,*,*,*,*,PART$" >> >> 7) Fields in direct files should not be named and access should be >> permitted only by field number. For instance if field number 8 in a >> file contains the "Partnum" information then an IOLIST could be >> written as either "IOLIST #8=PART$" or more traditionally as "IOLIST >> *,*,*,*,*,*,*,PART$" > > are these features that other BB's have, or is this something new? > the use of "should" comes across rather heavy. i'd rather not see > this as a requirement. (maybe i'm reading too much into "should" :) Again, in an effort to be as broadly compatible as possible, these are a combination of features from BBx and OpenBasic. I was saying "should" in an attempt to provoke discussion. ;-) Also, to indicate that nothing was set in stone yet. >> 8) The key fields in multi-keyed files can be used in the "KEY=" >> function to specify which of the keys to use for access. For >> instance if the "Partnum" field is designated as a key field then a >> read command could be written as follows "READ >> (1,KEY=#PARTNUM=PART$)A1$,A2$,A3$..." or as "READ >> (1,KEY=#8=PART$)A1$,A2$,A3$..." > > i suggest the use of the BBx syntax of "KNUM=X". where X is generally > a number, but could be expanded to accept "#PARTNUM". Hmmm... if people don't like the OpenBasic format we could use KNUM= and KNAM= functions instead I suppose. Comments? -- Michael St. Laurent Hartwell Corporation |
From: Montgomery T. <MTi...@ca...> - 2003-12-30 16:50:44
|
Howdy, >1) Indexed files should be easy enough to implement using some of the > functions from the PBL Base functions. has the decision been made that PBL will be used as the DB library? if not, i suggest you look at the miniDB library http://www.atbas.org/minidb/index.php . one thing that i like better about miniDB is that it will allow you to create/build/delete indices on the fly. >5) We should add a "DIR=3D" function to be used in READ statements = that will > indicate the direction of the read. i think you are asking for BBx compatible commands/features, and i agree. > 6) Fields in Multi-keyed files should be named and access should be > permitted by name as well as by field number. For instance if field number > 8 in a file is named "Partnum" then an IOLIST could be written as either > "IOLIST #8=3DPART$" or "IOLIST #PARTNUM=3DPART$" or more traditionally = as > "IOLIST *,*,*,*,*,*,*,PART$" >=20 > 7) Fields in direct files should not be named and access should be > permitted only by field number. For instance if field number 8 in a file > contains the "Partnum" information then an IOLIST could be written as either > "IOLIST #8=3DPART$" or more traditionally as "IOLIST *,*,*,*,*,*,*,PART$" =20 are these features that other BB's have, or is this something new? the use of "should" comes across rather heavy. i'd rather not see this as a requirement. (maybe i'm reading too much into "should" :) >8) The key fields in multi-keyed files can be used in the "KEY=3D" function > to specify which of the keys to use for access. For instance if the > "Partnum" field is designated as a key field then a read command could be > written as follows "READ (1,KEY=3D#PARTNUM=3DPART$)A1$,A2$,A3$..." or = as "READ > (1,KEY=3D#8=3DPART$)A1$,A2$,A3$..." =20 i suggest the use of the BBx syntax of "KNUM=3DX". where X is generally = a number, but could be expanded to accept "#PARTNUM". \\//_ |
From: Montgomery T. <MTi...@ca...> - 2003-12-30 16:31:07
|
Howdy, when doing this please place a #ifdef/#else/#endif around the assembler and C parts. not all of us (me) are compiling on Intel based CPUs :) \\//_ |
From: <mik...@us...> - 2003-12-30 03:52:32
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv16434 Modified Files: utilities.c Log Message: Repaired Index: utilities.c =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/utilities.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** utilities.c 30 Dec 2003 02:31:41 -0000 1.4 --- utilities.c 30 Dec 2003 03:52:28 -0000 1.5 *************** *** 2,6 **** * MyBB(r) - My Business Basic Interpreter * * ------------------------------------------------------------------- * ! * Program: utilities.c * ************************************************************************/ --- 2,6 ---- * MyBB(r) - My Business Basic Interpreter * * ------------------------------------------------------------------- * ! * Program: utilities.c * ************************************************************************/ *************** *** 137,146 **** short BigShort(short l) { - /* byte flip for a word... no need for temp variables in asm */ - __asm("mov ax,word [l]"); /* so store word in a register */ - __asm("xchg al,ah"); /* swap the bytes in that register */ - __asm("retn"); /* return that register */ - - /* byte b1, b2; --- 137,140 ---- *************** *** 149,153 **** return (b1 << 8) + b2; - */ } --- 143,146 ---- *************** *** 168,179 **** long BigLong(long l) { - /* byte flip for a dword... if we had 486 for sure we could use BSWAP, but this works on 386 too (though is a bit slower) */ - __asm("mov eax,dword [l]"); - __asm("xchg al,ah"); /* byte flip for low word */ - __asm("ror eax,0x10"); /* word flip for a dword */ - __asm("xchg al,ah"); /* byte flip for high word (whichs now low) */ - __asm("retn"); - - /* byte b1, b2, b3, b4; --- 161,164 ---- *************** *** 184,188 **** return ((long)b1 << 24) + ((long)b2 << 16) + ((long)b3 << 8) + b4; - */ } --- 169,172 ---- *************** *** 203,211 **** float BigFloat(float l) { - /* i'd recomed using - tmp = (float)BigLong((long)l); - instead, it does the same thing... and we don't want to waste memory too - casting takes no execution, it just tells the compiler not to raise an error - */ union { byte b[4]; --- 187,190 ---- *************** *** 224,243 **** char *strLeft(char *str,int n) { - /* now hope i got this right; i'm not very failiar with the functions */ - char tmp[n+1]; /* this should alloc n+1 bytes */ - __asm("mov esi,dword [str]"); - __asm("lea edi,[tmp]"); - __asm("push edi"); /* trick: store ptr so we don't hafta recalculate it*/ - __asm("xor ecx,ecx") /* define n as long to get rid of this. note that you hafta also alter the next line*/ - __asm("mov cx,word [n]"); - __asm("cld"); - __asm("rep"); - __asm("movsb"); /* string copy */ - __asm("xor al,al"); - __asm("stosb") /* insert zero terminator */ - __asm("pop eax"); - __asm("retn"); /* return ptr */ - - /* char *tmp; tmp = strdup(str); --- 203,206 ---- *************** *** 245,249 **** return tmp; - */ } --- 208,211 ---- *************** *** 318,344 **** int itoh(byte num, char *pt) { - /* this one's much faster in asm */ - __asm("mov edi,dword [pt]"); - __asm("mov al,byte [num]"); - __asm("push ax"); /* store num or second round */ - __asm("shr al,0x04"); /* take high nibble */ - __asm("call near itoh_3"); /* use our subfunction located below */ - __asm("pop ax") /* reget num */ - __asm("and al,0x0F"); /* take low nibble */ - __asm("call near itoh_3"); /* use our subfunction located below */ - __asm("xor ax,ax"); - __asm("retn"); /* return zero word */ - - /* this one is a function that converts low nibble in al to hex stores it with stosb - does look weird if you don't know assembly */ - __asm("itoh_3: cmp al,0x0A"); - __asm("jnc itoh_1"); - __asm("add al,0x30"); /* add either 0x30... */ - __asm("jmp itoh_2"); - __asm("itoh_1: add al,0x37"); /* ...or 0x37 */ - __asm("itoh_2: stosb"); /* store character */ - __asm("retn"); /* get back */ - - /* unsigned char nm[2]; --- 280,283 ---- *************** *** 373,377 **** *(pt+1)=(char)nm[1]; return(0); - */ } --- 312,315 ---- *************** *** 993,1007 **** void *SafeMalloc(long size) { - /* you can optimize even simple code like this */ - __asm("push dword [size]"); - __asm("call near malloc"); /* call normally, NOTE: this is a stdcall, may bug on other call systems */ - __asm("or eax,0x00000000"); - __asm("jz SafeMalloc_1"); /* if we got zero */ - __asm("retn"); - __asm("SafeMalloc_1: push dword ERR_MEMORY_CAPACITY"); - __asm("leave"); - __asm("jmp rterror"); /* skip double retn, NOTE: not 100% sure about this - i should test it, it depends how compiler assembles a function frame */ - - /* void *ptr; --- 931,934 ---- *************** *** 1012,1016 **** return ptr; - */ } --- 939,942 ---- |
From: <mik...@us...> - 2003-12-30 02:31:51
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv4175 Modified Files: utilities.c Log Message: Some Assembler Optimization by Matti Heikki Hakkinen. Nice and quick! ;) Index: utilities.c =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/utilities.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** utilities.c 29 Dec 2003 19:36:40 -0000 1.3 --- utilities.c 30 Dec 2003 02:31:41 -0000 1.4 *************** *** 137,146 **** short BigShort(short l) { ! byte b1, b2; ! ! b1 = l & 255; ! b2 = (l >> 8) & 255; ! ! return (b1 << 8) + b2; } --- 137,153 ---- short BigShort(short l) { ! /* byte flip for a word... no need for temp variables in asm */ ! __asm("mov ax,word [l]"); /* so store word in a register */ ! __asm("xchg al,ah"); /* swap the bytes in that register */ ! __asm("retn"); /* return that register */ ! ! /* ! byte b1, b2; ! ! b1 = l & 0xFF; ! b2 = (l >> 8) & 0xFF; ! ! return (b1 << 8) + b2; ! */ } *************** *** 161,172 **** long BigLong(long l) { ! byte b1, b2, b3, b4; ! ! b1 = l & 255; ! b2 = (l >> 8) & 255; ! b3 = (l >> 16) & 255; ! b4 = (l >> 24) & 255; ! ! return ((long)b1 << 24) + ((long)b2 << 16) + ((long)b3 << 8) + b4; } --- 168,188 ---- long BigLong(long l) { ! /* byte flip for a dword... if we had 486 for sure we could use BSWAP, but this works on 386 too (though is a bit slower) */ ! __asm("mov eax,dword [l]"); ! __asm("xchg al,ah"); /* byte flip for low word */ ! __asm("ror eax,0x10"); /* word flip for a dword */ ! __asm("xchg al,ah"); /* byte flip for high word (whichs now low) */ ! __asm("retn"); ! ! /* ! byte b1, b2, b3, b4; ! ! b1 = l & 255; ! b2 = (l >> 8) & 255; ! b3 = (l >> 16) & 255; ! b4 = (l >> 24) & 255; ! ! return ((long)b1 << 24) + ((long)b2 << 16) + ((long)b3 << 8) + b4; ! */ } *************** *** 186,190 **** float BigFloat(float l) ! { union { byte b[4]; --- 202,211 ---- float BigFloat(float l) ! { ! /* i'd recomed using ! tmp = (float)BigLong((long)l); ! instead, it does the same thing... and we don't want to waste memory too ! casting takes no execution, it just tells the compiler not to raise an error ! */ union { byte b[4]; *************** *** 203,211 **** char *strLeft(char *str,int n) { ! char *tmp; ! tmp = strdup(str); ! strncpy(tmp + n,"",abs(strlen(tmp) - n)); ! ! return tmp; } --- 224,249 ---- char *strLeft(char *str,int n) { ! /* now hope i got this right; i'm not very failiar with the functions */ ! char tmp[n+1]; /* this should alloc n+1 bytes */ ! __asm("mov esi,dword [str]"); ! __asm("lea edi,[tmp]"); ! __asm("push edi"); /* trick: store ptr so we don't hafta recalculate it*/ ! __asm("xor ecx,ecx") /* define n as long to get rid of this. note that you hafta also alter the next line*/ ! __asm("mov cx,word [n]"); ! __asm("cld"); ! __asm("rep"); ! __asm("movsb"); /* string copy */ ! __asm("xor al,al"); ! __asm("stosb") /* insert zero terminator */ ! __asm("pop eax"); ! __asm("retn"); /* return ptr */ ! ! /* ! char *tmp; ! tmp = strdup(str); ! strncpy(tmp + n,"",abs(strlen(tmp) - n)); ! ! return tmp; ! */ } *************** *** 280,315 **** int itoh(byte num, char *pt) { ! unsigned char nm[2]; ! ! nm[0]=(char)((int)num/16); ! nm[1]=(char)((int)num%16); ! ! for (num=0;num<2;(num)++) ! { ! switch (nm[num]) ! { ! case 10: ! ! case 11: ! ! case 12: ! ! case 13: ! ! case 14: ! ! case 15: ! nm[num]+=55; ! break; ! ! default: ! nm[num]+=48; ! break; ! } ! } ! ! *pt=(char)nm[0]; ! *(pt+1)=(char)nm[1]; ! return(0); } --- 318,377 ---- int itoh(byte num, char *pt) { ! /* this one's much faster in asm */ ! __asm("mov edi,dword [pt]"); ! __asm("mov al,byte [num]"); ! __asm("push ax"); /* store num or second round */ ! __asm("shr al,0x04"); /* take high nibble */ ! __asm("call near itoh_3"); /* use our subfunction located below */ ! __asm("pop ax") /* reget num */ ! __asm("and al,0x0F"); /* take low nibble */ ! __asm("call near itoh_3"); /* use our subfunction located below */ ! __asm("xor ax,ax"); ! __asm("retn"); /* return zero word */ ! ! /* this one is a function that converts low nibble in al to hex stores it with stosb ! does look weird if you don't know assembly */ ! __asm("itoh_3: cmp al,0x0A"); ! __asm("jnc itoh_1"); ! __asm("add al,0x30"); /* add either 0x30... */ ! __asm("jmp itoh_2"); ! __asm("itoh_1: add al,0x37"); /* ...or 0x37 */ ! __asm("itoh_2: stosb"); /* store character */ ! __asm("retn"); /* get back */ ! ! /* ! unsigned char nm[2]; ! ! nm[0]=(char)((int)num/16); ! nm[1]=(char)((int)num%16); ! ! for (num=0;num<2;(num)++) ! { ! switch (nm[num]) ! { ! case 10: ! ! case 11: ! ! case 12: ! ! case 13: ! ! case 14: ! ! case 15: ! nm[num]+=55; ! break; ! ! default: ! nm[num]+=48; ! break; ! } ! } ! ! *pt=(char)nm[0]; ! *(pt+1)=(char)nm[1]; ! return(0); ! */ } *************** *** 931,942 **** void *SafeMalloc(long size) { ! void *ptr; ! ! ptr = malloc(size); ! ! if (!ptr) ! rterror(ERR_MEMORY_CAPACITY); ! ! return ptr; } --- 993,1016 ---- void *SafeMalloc(long size) { ! /* you can optimize even simple code like this */ ! __asm("push dword [size]"); ! __asm("call near malloc"); /* call normally, NOTE: this is a stdcall, may bug on other call systems */ ! __asm("or eax,0x00000000"); ! __asm("jz SafeMalloc_1"); /* if we got zero */ ! __asm("retn"); ! __asm("SafeMalloc_1: push dword ERR_MEMORY_CAPACITY"); ! __asm("leave"); ! __asm("jmp rterror"); /* skip double retn, NOTE: not 100% sure about this - i should test it, it depends how compiler assembles a function frame */ ! ! /* ! void *ptr; ! ! ptr = malloc(size); ! ! if (!ptr) ! rterror(ERR_MEMORY_CAPACITY); ! ! return ptr; ! */ } |
From: Mike <mik...@ro...> - 2003-12-30 01:00:34
|
We will soon be pruning the developers list based on activity. We plan on doing this for February 1st, 2004. It will just keep things current and clean. Thanks, Mike |
From: Michael S. L. <mi...@ha...> - 2003-12-29 23:21:09
|
Just after hitting the send button I re-read my post and found all the mistakes I had made! :-( Please delete the previous message and use this one instead: I imagine that the INDEXED, SORT and DIRECT file types will be added first as they will be the least controversial. ;-) Here are my thoughts so far. Please comment. 1) Indexed files should be easy enough to implement using some of the functions from the PBL Base functions. 2) The "Keyed" file type can be used to implement SORT files. 3) The "ISAM" file type can be used to implement DIRECT files. 4) The "ISAM" file type can also be used to implement MULTI files; however, new code will need to be added to the library to implement the additional features we will want (It's been a long time but if I recall correctly, the MULTI class will inherit the ISAM class and add onto it). 5) We should add a "DIR=" function to be used in READ statements that will indicate the direction of the read. The default is to be "1" indicating that the next record should be read. Other possible values include "-1" to read the previous record, "0" to re-read the current record, "2" to skip a record, you get the idea. 6) Fields in Multi-keyed files should be named and access should be permitted by name as well as by field number. For instance if field number 8 in a file is named "Partnum" then an IOLIST could be written as either "IOLIST #8=PART$" or "IOLIST #PARTNUM=PART$" or more traditionally as "IOLIST *,*,*,*,*,*,*,PART$" 7) Fields in direct files should not be named and access should be permitted only by field number. For instance if field number 8 in a file contains the "Partnum" information then an IOLIST could be written as either "IOLIST #8=PART$" or more traditionally as "IOLIST *,*,*,*,*,*,*,PART$" 8) The key fields in multi-keyed files can be used in the "KEY=" function to specify which of the keys to use for access. For instance if the "Partnum" field is designated as a key field then a read command could be written as follows "READ (1,KEY=#PARTNUM=PART$)A1$,A2$,A3$..." or as "READ (1,KEY=#8=PART$)A1$,A2$,A3$..." -- Michael St. Laurent Hartwell Corporation |
From: Michael S. L. <mi...@ha...> - 2003-12-29 23:09:09
|
I'm gathering my thoughts before creating the specification for file I/O and was wondering if anyone wanted to throw their ideas into the mix. I imagine that the SORT and DIRECT file types will be added first as they will be the least controversial. ;-) Here are my thoughts so far. Please comment. 1) Indexed files should be easy enough to implement using either standard file I/O or with some of the functions from the PBL Base functions. 2) The "Keyed" file type can be used to implement SORT files. 3) The "ISAM" file type can be used to implement DIRECT files. 4) The "ISAM" file type can also be used to implement MULTI files; however, new code may need to be added to the library depending on the features we will want (It's been a long time but if I recall correctly, the MULTI class will inherit the ISAM class and add onto it). 5) We should add a "DIR=" function to be used in READ statements that will indicate the direction of the read. The default is to be "1" indicating that the next record should be read. Other possible values include "-1" to read the previous record, "0" to re-read the current record, you get the idea. 6) Fields in Multi-keyed files should be named and access should be permitted by name as well as by field number. For instance if field number 8 in a file is named "Partnum" then an IOLIST could be written as either "IOLIST #8=PARTNUM$" or "IOLIST #PARTNUM=PART$" or more traditionally as "IOLIST *,*,*,*,*,*,*,PART$" 7) Fields in direct files should not be named and access should be permitted only by field number. For instance if field number 8 in a file is named "Partnum" then an IOLIST could be written as either "IOLIST #8=PARTNUM$" or more traditionally as "IOLIST *,*,*,*,*,*,*,PART$" 8) The key fields in multi-keyed files can be used in the "KEY=" function to specify which of the keys to use for access. For instance if the "Partnum" field is designated as a key field then a read command could be written as follows "READ (1,KEY=#PARTNUM=PART$)A1$,A2$,A3$..." or as "READ (1,KEY=#8=PART$)A1$,A2$,A3$..." -- Michael St. Laurent Hartwell Corporation |
From: <mti...@us...> - 2003-12-29 22:35:59
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv26379 Modified Files: mybb.h Log Message: fixes for task 90822 Index: mybb.h =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/mybb.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mybb.h 23 Dec 2003 20:49:56 -0000 1.6 --- mybb.h 29 Dec 2003 19:37:09 -0000 1.7 *************** *** 16,19 **** --- 16,20 ---- typedef unsigned char byte; + typedef void (*SHORTCUT) (void); // Platform *************** *** 89,92 **** --- 90,101 ---- } sysvartbl[]; + extern struct shortcuts { + char code[2]; + char word[12]; + int wordLen; + int result; + SHORTCUT func; + } shortcuttbl[]; + extern struct mnemonics { char name[10]; *************** *** 344,347 **** --- 353,357 ---- filetbl *get_chaninfo(int channel); void ExtractFilename(char *path, char *dest); + int doShortCut( void ); // stack.c |
From: Michael S. L. <mi...@ha...> - 2003-12-29 22:18:10
|
In Linux I find that the cursor is placed at the start of the line instead of following the prompt. In other words, using the default prompt the cursor appears on top of the "-" instead of one space after the ">". -- Michael St. Laurent Hartwell Corporation |
From: Michael S. L. <mi...@ha...> - 2003-12-29 22:11:07
|
I tried commenting out lines 68 and 69. That allows the code to compile. I can't find anything wrong with the lines in question though. :-( Michael St. Laurent <> wrote: > I just now checked out a fresh version from CVS, edited the mybb.h > file to switch it from WIN32 to LINUX and tried to compile. Below > are the results: > > [root@hart-nas mybb]# make > gcc -ggdb -Wall -c -o mybb.o mybb.c > mybb.c: In function `main': > mybb.c:68: parse error before `char' > mybb.c:69: `StartUpProgram' undeclared (first use in this function) > mybb.c:69: (Each undeclared identifier is reported only once > mybb.c:69: for each function it appears in.) > make: *** [mybb.o] Error 1 > > I noticed some extra carriage return characters at the end of several > lines in this area of code but removing them made no difference. > I've done my best to hunt for hidden control characters but I can't > seem to find any problem. -- Michael St. Laurent Hartwell Corporation |
From: Michael S. L. <mi...@ha...> - 2003-12-29 20:59:36
|
I just now checked out a fresh version from CVS, edited the mybb.h file to switch it from WIN32 to LINUX and tried to compile. Below are the results: [root@hart-nas mybb]# make gcc -ggdb -Wall -c -o mybb.o mybb.c mybb.c: In function `main': mybb.c:68: parse error before `char' mybb.c:69: `StartUpProgram' undeclared (first use in this function) mybb.c:69: (Each undeclared identifier is reported only once mybb.c:69: for each function it appears in.) make: *** [mybb.o] Error 1 I noticed some extra carriage return characters at the end of several lines in this area of code but removing them made no difference. I've done my best to hunt for hidden control characters but I can't seem to find any problem. -- Michael St. Laurent Hartwell Corporation |
From: <mti...@us...> - 2003-12-29 19:39:12
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv26209 Modified Files: parser.c Log Message: fixes for task 90822 Index: parser.c =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/parser.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** parser.c 18 Dec 2003 17:17:31 -0000 1.1 --- parser.c 29 Dec 2003 19:36:16 -0000 1.2 *************** *** 37,51 **** } ! if(*prog == '?') ! { ! prog++; ! tokenpos++; ! *temp++ = 'P'; ! *temp++ = 'R'; ! *temp++ = 'I'; ! *temp++ = 'N'; ! *temp++ = 'T'; ! return(token_type = TOK_COMMAND); ! } if((*prog == '\'') && (lasttype == 1)) --- 37,53 ---- } ! if ( (token_type = doShortCut()) ) return(token_type); ! ! // if(*prog == '?') ! // { ! // prog++; ! // tokenpos++; ! // *temp++ = 'P'; ! // *temp++ = 'R'; ! // *temp++ = 'I'; ! // *temp++ = 'N'; ! // *temp++ = 'T'; ! // return(token_type = TOK_COMMAND); ! // } if((*prog == '\'') && (lasttype == 1)) |
From: <mti...@us...> - 2003-12-29 19:38:43
|
Update of /cvsroot/mybusinessbasic/mybb In directory sc8-pr-cvs1:/tmp/cvs-serv26268 Modified Files: utilities.c Log Message: fixes for task 90822 Index: utilities.c =================================================================== RCS file: /cvsroot/mybusinessbasic/mybb/utilities.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** utilities.c 20 Dec 2003 03:30:52 -0000 1.2 --- utilities.c 29 Dec 2003 19:36:40 -0000 1.3 *************** *** 242,245 **** --- 242,281 ---- } + //----- + // check for single char shortcuts + //----- + int doShortCut( void ) + { + int x=0; + + while (1) + { + //----- end of table ----- + if ( !shortcuttbl[x].code[0] ) break; + //----- check this shortcut ----- + if ( shortcuttbl[x].code[0] == *prog ) + { + prog++; + tokenpos++; + //----- function attached to shortcut? ----- + if ( shortcuttbl[x].func != NULL ) shortcuttbl[x].func(); + //----- replace shortcut with full command ----- + if ( shortcuttbl[x].wordLen ) + { + memcpy(token,shortcuttbl[x].word,shortcuttbl[x].wordLen); + } + else + { + token[0] = 0; + } + return( shortcuttbl[x].result ); + } + x++; + } + + return(0); + } + + int itoh(byte num, char *pt) { |