Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about the ORG value
#1
Maybe the question could result dumb to Assembly experts; however, is there a way to make an ORiGin memory address flexible? Saying it more clearly, even setting an ORG value in the ZXB commandline, is there a way to import the code into a new memory address?
Reply
#2
Currently not. What do you want to achieve exactly?
Reply
#3
boriel Wrote:What do you want to achieve exactly?

...just to avoid to repeat the compile process regarding multiple bas files when the first org value is incorrectly calculated. I thought there was a way to freely import the compiled bin files as it happens with other tools like screen compressors or sound fx generators.
Reply
#4
LukeBord1 Wrote:
boriel Wrote:What do you want to achieve exactly?

...just to avoid to repeat the compile process regarding multiple bas files when the first org value is incorrectly calculated. I thought there was a way to freely import the compiled bin files as it happens with other tools like screen compressors or sound fx generators.
You can, but not with ZX Basic cdeo, but with ASM code:

1) Compile your code with zxbasm for example
2) Your code must be relocatable (no org, no JP's, just JR, etc)
3) In your ZX Basic program do:

Code:
PRINT "Hello world"
GOTO AfterBinary  : REM Avoid the CPU entering this region
MyBinary:   REM here starts your rutine
ASM
incbin "myfile.bin" ;  This include a binary file "as is"
END ASM
AfterBinary:
REM Now let's invoke the rutine

RANDOMIZE USR @MyBinary : REM @ means "address of", like "&" operator in C
Have not tested this, but it should work. Please, try this and tell me

In the mean time, just to let you know that, at this moment, ZX Basic does not have a linker (yet to be done).
But I think is what you're asking for. Basically, libraries (.BAS and asm) to be compiled once and stored in a binary format in a lib/ directory to be reused later, like C and other languages do. Still working on it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)