artrag Posted February 8, 2021 Share Posted February 8, 2021 I'm sorry I return on the topic but something strange is happening with varptr... This lines do not work, as intybasic keeps telling that the expression is not constant const #max_bit_index = (VARPTR #bitstream_end(0) - VARPTR #bitstream(0)) * 16 but it is very constant as the arrays are #bitstream: DATA &1001100110011001,&1001100110011001,&1001100110011001,&1001100110011001,&1001100110011001 #bitstream_end: Moreover, I spotted that randomly, if I use the minuscule varprt, sometimes it does not compile, telling that some brackets is odd #max_bit_index = (varprt #bitstream_end(0) - varprt #bitstream(0)) * 16 It is like varprt (in minuscule) sometimes is confused by a variable name.... Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 8, 2021 Share Posted February 8, 2021 (edited) For the first problem, I just checked that the compiler does not evaluate VARPTR as a numeric expression. From "eval_leval7()" It returns: return new node(C_NAME_R, temp, NULL, NULL); But the "Const" parser is checking exclusively for "C_NUM" type. This seems to be a current limitation or an oversight. For the second problem, it's ... a little more silly. You've mistyped "VARPTR" in lower-case: You've put the "R" before the "T", "VARPRT". If you correct that, it'll work. I recommend enabling "Option Explicit" to catch these sort of errors. You'll have to declare all your variables before hand, but in my opinion it is worth it. With "Option Explicit" the error I get is: Error: variable 'VARPRT' not defined previously in line 23 Error: missing right parenthesis in line 23 Where the first line makes it obvious that there is a typo. -dZ. Edited February 8, 2021 by DZ-Jay Quote Link to comment Share on other sites More sharing options...
mmarrero Posted February 9, 2021 Share Posted February 9, 2021 On the 1st problem, I've seen CONST limitations, DEF FN can be used as a workaround. 'asm BitStreamX: EQU ((label_BITSTREAM_END - label_BITSTREAM) * 16) DEF FN BitStream = ((VARPTR bitstream_end(0) - VARPTR bitstream(0)) * 16) 'PRINT AT 120,<>BitStream Too bad IntyBasic can't use asm constants. I'd probably use placeholder IntyBasic constants, then replace them in the final .asm source. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.