![]() |
Negative STEP does not work (*solved*) - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15) +---- Thread: Negative STEP does not work (*solved*) (/showthread.php?tid=85) |
Negative STEP does not work (*solved*) - LCD - 03-15-2009 Hi Boriel, I just trying to write some stuff in ZX Basic compiler 1.1.0, but I ran into some problems: Code: x=0 I got the message "Unexpected end of file", so if it is a part of FOR NEXT Loop, I got the message "Unexpected Token 'NEXT' <NEXT>". ELSE alone works, but I was sure, ELSE IF should work too, Or maybe I'm wrong? Another one: the program does not accept Exponents: 2e4 (=2000) or similar. And finally: Negative STEP does not work with integers or long, only with floats or byte: Code: dim x as integer The compiler is otherwise fantastic! Please continue your great work! Re: Bug report - boriel - 03-16-2009 LCD Wrote:Hi Boriel, I just trying to write some stuff in ZX Basic compiler 1.1.0, but I ran into some problems:Hmmm. Every if should be closed with END IF, so another END IF is missing in your code. Try this way: Code: x=0 ![]() Quote:Another one: the program does not accept Exponents: 2e4 (=2000) or similar.Yes, I also find out yesterday. Will be fixed in 1.1.2. Quote:And finally:Oops! :? This is very important. I will check this immediately. Quote:The compiler is otherwise fantastic! Please continue your great work!Thanks a lot for your feedback :!: I will replay when this is Fixed (ASAP). By the way, version 1.1.1 is out. I suggest you to try it and check if this bug is still there, because I fixed many things. Re: Bug report - LCD - 03-16-2009 boriel Wrote:Hmmm. Every if should be closed with END IF, so another END IF is missing in your code. Try this way: In fact I tried ELSEIF too, but it was not working too (I prefer Syntax like ELSEIF or ENDIF much more than ELSE IF or END IF), but you are absolutly right, I was expecting, it works like you displayed in the link, where only one ENDIF is needed for one IF...THEN...ELSEIF...ELSE...ENDIF block Quote:Yes, I also find out yesterday. Will be fixed in 1.1.2. Great! Quote:Just downloaded the new version.Quote:And finally:Oops! :? This is very important. I will check this immediately. This loop works still only with Byte or Float definition for x, and not with ubyte, integer, uinteger, long or ulong. I guess unsigned types are not suitable for negative steps even if the value does not reach negative numbers. BTW: does Memory Allocation mean, it will utilise 128K Spectrum (Maybe later SAM Coupé) memory one day? Re: Bug report - boriel - 03-16-2009 Well, I've released 1.1.2 (in .zip and .tar.gz format only). It fixes the FOR issue and also the scientific notation number issue. It also adds PRINT TAB compatibility. You can check it out to see if it works now. Thanks a lot! :!: Re: Bug report - LCD - 03-16-2009 boriel Wrote:Well, I've released 1.1.2 (in .zip and .tar.gz format only). It fixes the FOR issue and also the scientific notation number issue. It also adds PRINT TAB compatibility. You can check it out to see if it works now.Thanks! I just downloaded python and the new zxb, but I can`t get ConText to work with it again (the PATH is entered in config). Maybe it is a bit unhealthy to use msi and py version at the same time... Maybe it will work better after restarting the computer... Re: Bug report - boriel - 03-16-2009 LCD Wrote:Ok, I've created and uploaded the .MSI package, so if you want to give it a try... download it form the installation page.boriel Wrote:Well, I've released 1.1.2 (in .zip and .tar.gz format only). It fixes the FOR issue and also the scientific notation number issue. It also adds PRINT TAB compatibility. You can check it out to see if it works now.Thanks! ![]() I didn't wanted to upload the .msi until you tested it a bit more... but it's ok anyway. Re: Bug report - LCD - 03-17-2009 Wonderfull! now it works perfectly, thanks! The best way to find bugs, is to write some games. So I will continue now one of my projects... Re: Bug report - boriel - 03-30-2009 LCD Wrote:Wonderfull! now it works perfectly, thanks!Please, give a try to the just new release 1.1.4, since it used (finally) a peephole optimizer (use -O3). Maybe you will notice a faster program execution with this flag. Re: Bug report - LCD - 03-30-2009 Thanks! Downloading it... Btw: I think, it will be possible to change SpLib (Sprite Library from <!-- m --><a class="postlink" href="http://www.geocities.com/aralbrec/">http://www.geocities.com/aralbrec/</a><!-- m -->) from Z88dk to your compiler and write a wrapper, after removing Hires and hicolor code. The only problem I ecountered, is the transfer of parameters, even without optimisations switched on, it often do not work, even not with dummy variables. Example: Code: Sub PutGfx(x,y,adr) Thanks! Re: Bug report - boriel - 03-30-2009 LCD Wrote:Thanks! Downloading it... Btw: I think, it will be possible to change SpLib (Sprite Library from <!-- m --><a class="postlink" href="http://www.geocities.com/aralbrec/">http://www.geocities.com/aralbrec/</a><!-- m -->) from Z88dk to your compiler and write a wrapper, after removing Hires and hicolor code. The only problem I ecountered, is the transfer of parameters, even without optimisations switched on, it often do not work, even not with dummy variables. Example: Yes, that's it. I use IX as a stack pointer. A tip to guess the parameter address: Code: Sub PutGfx(x,y,adr) Compile with -A flag only. This will give you unoptimized assebler code. Now edit the generated .asm file and you will see there the addresses of parameters adr, x and y. I think I need to write a tutorial. :!: Re: Bug report - LCD - 03-31-2009 Just tested some stuff. Wow, it is much faster!!! Still a little bit slower than HiSoft Basic, but this does not matter anymore. It is the best Compiler around! I know the option to use -A flag to create the assembly, and used it often, but that is not the best solution. I test my programs often, and using -A causes slow down in the development process because there are some additional steps like checking the adress, editing and recompiling the code. I personally think, each DIM'ed variable should create a label in any case. At least there could be a option to do so. Anyway, your work is great!!! I thank you very much for all efforts, you put into this software, as it turns slowly out, to be my favorite software on PC. Re: Bug report - boriel - 03-31-2009 LCD Wrote:DIM'ed variable should create a label in any case. At least there could be a option to do so.Hey! That's a GREAT idea! :!: Thanks a lot. I think I could implement them as a macro so you cuould do something like: Code: Function f The local variable 'a' (parameters are also local variables in the end) could be translated as: Code: #define _f_a ix + 3 Code: ld a, (_f_a) ¿What do you think? Re: Bug report - LCD - 03-31-2009 boriel Wrote:Hey! That's a GREAT idea! :!: Thanks a lot. I think I could implement them as a macro so you cuould do something like:I think, this could work, but it maybe could also be forced using this syntax Code: DIM _a as uinteger Thats just a idea, sorry, but I never created a compiler myself yet. |