Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Negative STEP does not work (*solved*)
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:
Function f
  DIM a as byte
End Function

The local variable 'a' (parameters are also local variables in the end) could be translated as:
#define _f_a  ix + 3
Notice the _f (function name) is prepended to the variable names defined into that funcion. This is because there could be more than one "a" variable (one in the global scope and another in the local scope). So now you can do this:
ld a, (_f_a)
add a, 2
ld (_f_a), a ; LET a = a + 2

┬┐What do you think?
I think, this could work, but it maybe could also be forced using this syntax
DIM _a as uinteger
where "a as integer" does not force the label creation, "_a as integer" does it. Maybe this will be simpler to implement and to use. I would be happy with any of the solutions. It is unusual for most users to access functions from assembly, and maybe not very easy to do, but it should be easy to tell the compiler in a DIM statement: If you see a variable with underscore as the first char, you must create a label for this variable in any case. Local scope variables could be defined in a similar way.
Thats just a idea, sorry, but I never created a compiler myself yet.
------------------------------------------------------------ redirector is dead
Visit my home page!

Messages In This Thread

Forum Jump:

Users browsing this thread: 1 Guest(s)