Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Routine mapping?
#1
Right now, ZX BASIC already supports variable mapping. If I already have a variable defined at a certain memory address, I can reference it as follows:

Code:
DIM x AS UBYTE AT 64000

It would be nice if ZX BASIC could also support routine mapping. If I already have an assembly routine implemented at a certain memory address, I would like to reference it as follows:

Code:
DECLARE sub FASTCALL doSomething(src as UINTEGER, dst as UINTEGER) AT 64000

In the meantime, I'm having to use this workaround:

Code:
sub FASTCALL doSomething(src as UINTEGER, dst as UINTEGER)
    asm
        jp 64000
    end asm
end sub


EDIT: Of course routine mapping should also work with both sub-routines and functions, either FASTCALL or not, exactly like any other ZX BASIC routine implemented in asm directly inside the routine body.
Reply
#2
Bump!

Any chance this is going to be implemented?
Reply
#3
(02-27-2021, 02:55 AM)einar Wrote: Bump!

Any chance this is going to be implemented?

This is "on hold" (FUNC/SUB ... AT) because it's very platform dependent and I'm moving towards an arch-agnostic compiler.
Instead, in the future, a linker will do the final obj linking, and the developer could specify a memory-map of for functions and modules (that is, specifying where the code should be placed in memory).

Also remember you can call asm code directly with USR <address>.

For the moment your solution is the best I can think of... Confused
I'm currently working hard in namespaces and modules to allow obj files and code relocation.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)