Disarray
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
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
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.
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
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.