Welcome, Guest. Please login or register.

Author Topic: Need help again, hehe, this time in asm  (Read 3467 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Cymric

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 1031
    • Show all replies
Re: Need help again, hehe, this time in asm
« on: May 10, 2004, 02:58:34 PM »
Without a single line of code to work with, my guess is as good as anybody else's. We don't know at all if the problem truly resides with a copper list being loaded into FastMem. To be more specific: I think that in fact it *is not* the source of the problem at all, as I can think of no particular reason why an assembler would wilfully assemble code into ChipMem if FastMem is available. Unless the assembler specifically asks for ChipMem to do so, but that would make it a lousy assembler in my book.

Under the assumption that FastMem is indeed the source of the problem, I don't even understand why manually reserving ChipMem and copying the copper lists into that area would be a Bad Thing. You would have to do some minor arithmetic in order to have the correct pointers inside the copper list---in other words, modify the copper list after it has been copied over---but that isn't so bad, is it?

Finally, you can insert some pseudo-opcodes into the assembly source to instruct the linker to emit some stuff so that later on the DOS loader automatically places that particular section of code or data into ChipMem. But that would still involve a bit of pointer arithmetic, and probably even more than before as you'd have to track down yourself where that segment ended up---not a fun thing to do.

Bottom line: without code, it all boils down to pure speculation.
Some people say that cats are sneaky, evil and cruel. True, and they have many other fine qualities as well.
 

Offline Cymric

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 1031
    • Show all replies
Re: Need help again, hehe, this time in asm
« Reply #1 on: May 10, 2004, 04:23:53 PM »
Kinking? Oh, you mean linking! Err, what does a linker do... Well, what you say is not too far from the truth, although traditionally, assemblers are much less involved with linkers than higher languages such as C or C++. A linker's job is to glue together all kinds of separate source files or modules into a single executable file, often adding information in the process. Think of a list of symbols or names for debugging purposes, hints as to whether a section of that file contains data or code, and in what part of memory those sections should be stored. A very important task of the linker is to resolve all so-called cross references: references to variables and functions which are used, but not defined in a source code module. The assembler cannot compute the correct offset itself (it is defined in another file, after all), but the linker can. It keeps track of every location in each and every assembled file where such a reference is made, then computes all the correct offsets and addresses before writing them out to the final executable file.

You can do without a linker if you write all your code into a single file (although some extra information to make the assembled result into an executable would still have to be added) or if you use absolute addresses. The latter is useful in a few rare cases.
Some people say that cats are sneaky, evil and cruel. True, and they have many other fine qualities as well.