Disarray

edited January 2014 in Development
For the sake of having some clarity for once I have the project data in several source files according to their types. E.g. there's your usual LUTs, aka punch in the values once and then forget about it, and another type of LUTs, those that will require manual adjustments later (kept separate). Variables are likewise kept separate.

Due to the way the program works, some of these data have to be located next to each other in the memory in a certain manner. For the most part stuff tends to align nicely since most of the LUTs sizes are multiples of 256. There however is one particularly nasty 256B block which is supposed to have a 24 byte LUT in the middle of it, another 8 byte one in the beginning and hopefully something else in there because it's obviously not a good way to make use of the memory space otherwise.

So here I was thinking about maybe moving a bunch of these other LUTs along with a few variables in there - wherever the order isn't important basically - but I just can't come up with a neat clean-cut way to do it (one that is less of a 'dirty hack', for the object oriented around these parts) seeing as everything is in separate files.

TL;DR there's 2 source files and I want to take something from the 1st one and locate it (memory wise) in the middle of the 2nd one without repeating what's already been said, using the clipboard and/or resorting to throwing a bunch of ORGs around one way or the other, T.I.A. #naive #trivial
Post edited by Hikaru on

Comments

  • edited January 2014
    Do you want to interleave the data? Write a script in high level language on PC to generate the text file as part of the build process. Python is nice for stuff like that.

    If you just want to dump some data in the middle of some other data use an INCLUDE directive or whatever it is called in your assembler of choice.
  • edited January 2014
    In other words, split a file into two identical smaller files or use another language entirely. I mean, there's just this one place where this problem ever arises. Surely this isn't exactly where one is supposed to begin shooting oneself in the foot immediately and all that?..
  • edited January 2014
    I assume this is z80 code. What assembler are you using?

    This sounds like the sort of thing that using binutils makes trivial* :)


    * Well okay, linker scripts aren't trivial to write, but copy pasting one that someone else wrote and tweaking it is ;D
  • edited January 2014
    What I'd actually like to know is whether there's an established way of dealing with this sorta situations while preferably still staying within the domain of typical (cross-)assembler functionality. Once again, maybe I'm wrong and bloating your build process - presently consisting of

    1) sjasmplus.exe filename.asm

    - with third party tools or something along the line is the way to go; I don't know. I just can't help feeling that I'm literally missing something rather simple here in the way of organizing things/'good practices' and such. If it really isn't that, then well, case closed as far as this thread is concerned I guess.

    (As an aside, f.ck yay for formulating questions not being trivial :) )

    Back to your question, I'm using SjAsm+ and yes, it is Z80 code.
  • edited January 2014
    That's why winston abandoned sjasmplus for spectranet - there's no easy way to do it other than clumsy includes and orgs.
Sign In or Register to comment.