Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Mar 31, 2016 8:15:09 GMT -5
It's been a while since I posted an update, so I thought I'd give everyone a quick one As I mentioned in my previous post, I had to rewrite the parsing engine (let me just say that trying to build a compiler/parsing engine is definitely not a quick and simple process, especially if you've never written one before), which means some of the previous additions I had added no longer work. Not the end of the world as the main focus of this project was to be as compatible with BEX as possible. Anyway, I have all of the commands and functions working, and now I'm going through and fixing some things that I either missed, implemented incorrectly, or weren't 100% finished when putting everything together. So far I've been able to compile 2 of my previous projects successfully in Second BASIC. There's still some things I need to add in (such as +=, -=, *=), as well as fixing a few array related bugs. I'd say I'm at about 90% complete with the project before it's ready for a public beta test. Stef's XGM driver also compiles nicely. I'll hopefully have something ready within a week, but there's still quite a bit to do for the interface. Once the Genesis/MD parser is 100% finished, I do want to expand Second BASIC to the NES, and possibly SMS, though those wouldn't be added until much later. Here's a quick video of Second BASIC compiling a 9,000 line code file: www.youtube.com/watch?v=Q5IfX-RvJ1QThe one side effect of the new compiler is that it actually compiles slower than BEX. The same source compiles in about 3.5 seconds in BEX, while this took 18 seconds. That's quite a bit of difference, and unsure if I'll be able to speed it up easily. I attribute that to my lack of knowledge in compiler design, so I do apologize for that in advance. More to come in the upcoming weeks
|
|
|
Post by mekanaizer on Apr 1, 2016 22:32:04 GMT -5
Hello. I tried it yesterday and most of my examples didn't compile plus it's abit instable under wine. I wonder if the wine crashs are related to missing stuff that the compiler doesn't yet support.
The example below doesn't compile with SBS. But it compiles ok under BEX. And since you are going to fix array related bugs it my be useful for you to test.
And using SNASM68K like below make things better will using it: snasm68k.exe -emax 0 -p -o ae- source.asm, ROM.bin
Since you are doing this great work you could make a option for us to chose which assembly "tool" to use. For example by using the BEX lib from BEX v1.20 and so using SNASM68K.
print "Days between two dates within same year" dim M(12) as integer for X = 1 to 12 read M(X) next X print "Is this a leap year 1=YES 2=NO)"; input A if A=1 then M(2)=29 print "Input first date: DAY, MONTH" input D1, M1 print "Input second date: DAY, MONTH" input D2, M2 if M1=M2 then DA=D2-D1: goto prog0 EM=M(M1)-D1 if M1+1=M2 then goto prog1 for X=M1+1 to M2-1 DA=DA+M(X) next X
prog1: DA=DA+EM+D2 prog0: Print "The number of days=";DA end data 31,28,31,30,31,30,31,31,30,31,30,31
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Apr 4, 2016 7:56:24 GMT -5
mekanaizer, thanks for the sample code to test out! It probably was related to arrays with the issues you were having. I recoded the parser and things seem to be running more smoothly now (though there are a few hiccups I'm ironing out now). The last big issue I had was trying to parse this line: if a > 5 and a < 10 OR (a > 100 and a < 125) then [rest of IF block] I'll post an updated build for you to try if you'd like (same with anyone else) in the next few days. I'm now using Inno installer instead of the Package and Deployment Wizard that comes with Visual Studios, so I need to make sure all of the controls are included with it and registered/installed properly. There are a few bugs still that I need to work out, such as using colon's as line breaks and the order of the user functions and subs. For instance:
declare function test() as integer a = test2() return a end function
declare function test2() as integer return 5 end function
This will throw an error saying that "test2" isn't defined. A quick fix is to generate the list of function names before parsing the functions, but it's low priority at the moment. To work around it, you'd just declare test2() before test() (in the example above). I also started creating the help files this weekend (as well as the preferences/settings section). I plan on including a compiled HTML help file for the application (.CHM). The Help program (I believe it's Help Maker, but unsure as I'm not on that computer at the moment) allows me to make .CHM, .HLP (unsupported on Windows 7 and newer OS's, so I'm going to avoid that format), and as a webpage. I can definitely add in an option for which assembler to use, but some things may not be compatible with SNASM68k or other assemblers (I believe that's possibly the issue with some of BEX's broken commands, the switch from SNASM68k to ASMX). You probably know the risks, but just in case others aren't aware, I thought it was worth a mention. Do you have a download link for SNASM68 by chance? Thanks for the input! It's much appreciated and welcomed. Cheers!
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Apr 4, 2016 8:13:01 GMT -5
Here's a screen shot of the most recent build. I added "Themes" to the style editor, and am including a Basiegaxorz theme for those who like the color style of BEX, as well as a few others that I personally like
|
|
|
Post by mekanaizer on Apr 4, 2016 19:38:11 GMT -5
Hello and thank you. You can get BasiEgaXorz v120 here it's from it's old official repo archive. And so you have the old BEX LIB plus the SNASM68K used with it. What I ask here too is for a way for us to have the two "diff" BEX in one program too. or You can try the "latest" SNASM68K see here. I have a couple of examples that crash/close the SBS, but since I'm running it under WINE it maybe it. Since this type of thing can happen you could create a backup system so we don't lose our work/changes. I would be very happy to try a new build as soon as possible . Can you add a window/tab split like this?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Apr 5, 2016 8:39:23 GMT -5
I don't think I'll be including 2 different versions of BEX - that's a lot of work if the BEX asm library is different. I did add a section in the options/preferences to specify a different assembler other than asmx, so you'll be able to choose whichever one you'd like I actually do have a "CRASH" folder, which will save all currently opened documents in case the IDE crashes during a compile (and will prompt for a reopen if any files exist in that folder), and ironically I do want to make a split window, it's just figuring out the best way to handle that. You can already open multiple documents in separate child windows and use the tile arrange buttons (cascade, vertical, and horizontal), but if I understand you right, you want the split documents on 1 form, not 2. I tried your sample code above in the current build, and I need to fix the READ command as it bombs out when using arrays.
|
|
|
Post by vetea on Apr 5, 2016 9:29:05 GMT -5
Great Work !! I hope I can compile my new project with soon ... Keep up the good Work Elusive ! Cheers.
|
|
|
Post by mekanaizer on Apr 5, 2016 13:08:39 GMT -5
For example if I want to try something different I would just click on a botton and with that it would split into two windows and create a second file so I could experiment. And the split windows system could be used to compare two already existing projects.
About the option for the different assembly compilers. Can we add the compile flags for each one?
Have you fixed the READ problem?
If you write down the below line REM is not working. The code still formats.
REM if A = 1
Here is another example, but this time it reports back a error message.
DIM A$(5) AS STRING FOR X = 1 TO 5 READ A$(X) PRINT X;" "; PRINT A$(X) ' * way doing a if WITH end if * if A$(5) = "SEX" then ' change 5 and SEX to see results if needed PRINT X;" "; print "BEX" else PRINT "NO TEXT MATCH" end if NEXT X DATA "REWARD","LOVE","FATHER","BEAUTY","SEX"
You are free to use the examples for your Second Basic example tree.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Apr 5, 2016 23:55:16 GMT -5
For example if I want to try something different I would just click on a botton and with that it would split into two windows and create a second file so I could experiment. And the split windows system could be used to compare two already existing projects. About the option for the different assembly compilers. Can we add the compile flags for each one? Have you fixed the READ problem? If you write down the below line REM is not working. The code still formats. REM if A = 1 Here is another example, but this time it reports back a error message. [/code]You are free to use the examples for your Second Basic example tree.[/quote] Yeah, I'll see what I can do about the split code/window thing Here's a screenshot of your previous code compiled: (SecondBASIC on the left, BEX on the right) I did have to change the single line IF statements to regular IF...END IF blocks, so that's something I need to fix. I did fix the READ issue (also the INPUT issues). The sample code you posted above compiles just fine with the new version Here's what the compiler options are: Cheers!
|
|
|
Post by mekanaizer on Apr 6, 2016 15:32:12 GMT -5
I would love to have that build elusive . One more array example to test and it works fine with SBS and BEX: DIM N(100) AS INTEGER N(50) = 25 PRINT N(50) -BUT- If we go for this example that is valid for BEX with SBS it crashs: DIM N(1 TO 100) AS INTEGER N(50) = 25 PRINT N(50) The options are looking cool . Can't wait to put my hands on a next build. Now here is a example to see if reset array works with SBS: Read in example comments for more info. DIM A$(5) AS STRING FOR X = 1 TO 5 READ A$(X) PRINT X;" "; PRINT A$(X) 'restore words 'reset array to the start reload words 'same as the above line ' * way doing a if WITH end if * if A$(5) = "SEX" then ' change 5 and SEX to see results if needed PRINT X;" "; print "BEX" else PRINT "NO TEXT MATCH" end if NEXT X words: DATA "SEX","LOVE","FATHER","BEAUTY","REWARD"
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Apr 6, 2016 17:51:10 GMT -5
Your example at the bottom works As for the DIM N(1 to 100) as integer, a few things on this: 1.) I'm not quite sure what BEX is doing with that command (1 to 100, that is). When compiled, it specifies enough room for a 2 dimension array: __INTEGER_B EQU $FF004C __INTEGER_A EQU $FF004E __INTEGER_C EQU $FF0052 HEAPSTART EQU $FF0054
I suspect that there could be issues with variable data if used with that call. After doing some testing, it looks like my suspicions are correct. Try copy/pasting the following into BEX and run it:
dim b as integer,a(1 to 100) as integer, c as integer b = 5 c = 6 for i = 1 to 100 a(i) = 3 next print a(1),b,c
It should print: 3 5 6, but prints 3 5 3 instead. In other words, dim var(lowerBound to upperBound) doesn't work 2.) BEX doesn't boundary check, so you can do a(0) even if the lower bound is set to 1, or 100 even if you specify an index of 3 (dim a(3) as integer). So, because it doesn't work in BEX, I'm not going to worry about it in SBS for the time being. I'll add it to the list of things to do, though, so it may eventually get done I'll send you a PM once I fix the single line IF statements, as I believe that's the last major thing at the moment. A lot of the options and functionality of the interface isn't done yet - I just designed what it will look like and been adding functionality to it slowly, when I get tired of working on the parser haha.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Apr 6, 2016 18:31:00 GMT -5
BEX doesn't support "ranged" arrays .. it simply doesn't throw a syntax error ( it should though ) and ignores the invalid part of the statement. So, the following snippets all produce the exact same result ( a 16 byte block of memory ) dim table(7) as integer dim table(7 + 7) as integer dim table(7 to 77) as integer dim table(7th heaven) as integer
|
|
|
Post by mekanaizer on Apr 6, 2016 19:45:46 GMT -5
DIM N(1 TO 3) is one of those things not documented over BEX that I see got unfinished. I pointed this so you could fix it within SBS. COLOR is another command that works with BEX but it's not documented.
This example crashs SBS:
ink 2 'COLOR 2 does the same print chr$(219);
And if you look COLOR doesn't even format correct with BEX but it's valid.
Thank you Titan for the deep info about DIM.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Apr 6, 2016 19:59:45 GMT -5
Didn't know about COLOR, that's a quick addition. I actually like that more than INK. The above code works (prints a green square)
|
|
|
Post by mekanaizer on Apr 6, 2016 20:03:30 GMT -5
Great! Did you add both INK and COLOR?
|
|