![]() |
|
Routine mapping? - Printable Version +- Boriel Basic Forum (https://forum.boriel.com) +-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11) +---- Forum: Wishlist (https://forum.boriel.com/forumdisplay.php?fid=14) +---- Thread: Routine mapping? (/showthread.php?tid=617) |
Routine mapping? - einar - 2014-11-02 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 64000It 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 64000In the meantime, I'm having to use this workaround: Code: sub FASTCALL doSomething(src as UINTEGER, dst as UINTEGER)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. RE: Routine mapping? - einar - 2021-02-27 Bump! Any chance this is going to be implemented? RE: Routine mapping? - boriel - 2021-02-28 (2021-02-27, 03:55 AM)einar Wrote: Bump! 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... I'm currently working hard in namespaces and modules to allow obj files and code relocation. |