![]() |
|
Is possible to do this? - 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: Help & Support (https://forum.boriel.com/forumdisplay.php?fid=16) +---- Thread: Is possible to do this? (/showthread.php?tid=878) |
Is possible to do this? - maeloterkim - 2019-04-30 Hi : ) I want to do something like this iniSuperSub: SUB mySuperSub() .... ... .... END SUB endSuperSub: SUB otherSub() ASM defs 6144-(@endSuperSub - @iniSuperSub),0 END ASM END SUB The compiler says -> Error: illegal preprocessor character '@' I want to do in assembler -> defs (6144 - size mySuperSub ), 0 There is some way to do something like this? Thanks Re: Is possible to do this? - boriel - 2019-04-30 Not sure why do you need that, but the compiler reallocates functions and subs at the end of the program, so @endSuperSub - @iniSuperSub = 0 You have to put the labels within the function body. Within an ASM context, don't use @. Use just the label name, prefixing it with '_'. So use: Code: SUB mySuperSub()Also, not sure if defs will work here instead of db or dw... Re: Is possible to do this? - maeloterkim - 2019-04-30 I'ts not working either with "_" Well i try to figure out, how manage better, where to put things I need space in at exactly number of memory and i don't know if there are directives like in assembler ORG to control better, where are every thing I'm looking the generated memory map but is a little mess If i want per example, n bytes of space beginning on 43456 Can i do that with some directive? Re: Is possible to do this? - boriel - 2019-05-01 When doing things like this, just compile with --asm flag to see the resulting asm file, and examine it. I was wrong: you have to prefix ("mangle") you labels in ASM, with __LABEL__. So this should work: Code: SUB mySuperSub()Re: Is possible to do this? - maeloterkim - 2019-05-01 Yes this __LABEL__ before works Thanks |