Quick 68k ASM question

Discussion in 'Engineering & Reverse Engineering' started by Hivebrain, May 20, 2005.

Thread Status:
Not open for further replies.
  1. Hivebrain

    Hivebrain

    Administrator
    2,863
    18
    18
    53.4N, 1.5W
    HiveView
    Does anyone know how to get "include" to work in 68k? I tried this:
    Code (Text):
    1. include file.asm
    and this:
    Code (Text):
    1. include "file.asm"
    ...but SNASM68K refuses to compile either.
     
  2. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    Are you sure the command is right?

    Try using the syntax you have to use to compile a normal file. If worst comes to worst, couldn't you just stick the extra ASM in the first file?
     
  3. Aurochs

    Aurochs

    Единый, могучий Советский Союз! Tech Member
    2,343
    0
    0
    Whatever catches my fancy
    I don't believe SNASM68k has a preprocessor. If it did, the help text would be a helluva lot longer. :P

    You could put both on the command line and output them to the same binary. Try that. Or, do what Tweaker said.

    EDIT: I just checked out the output of "snasm68k /?" and found that it does have a macro processor. Unfortunately, I have no idea how to use it. I'll do some research and get back to you.
     
  4. Weird Person

    Weird Person

    You lost two seconds reading this Member
    367
    0
    0
    Who knows?
    Try (TAB) or (SPACE) before include. Really, snasm68k sometimes refuses accept a instruction if there's no space before it. (That Happend a lot of times with me...)
     
  5. Hivebrain

    Hivebrain

    Administrator
    2,863
    18
    18
    53.4N, 1.5W
    HiveView
    I could probably write a program to combine ASM files. My only concern would be that a line-by-line search for a string would be slow in a file of several thousand lines.
     
  6. Hivebrain

    Hivebrain

    Administrator
    2,863
    18
    18
    53.4N, 1.5W
    HiveView
    I wrote a program to perform ASM inclusions, and it's surprisingly fast. It'll be released as part of my disassembly.
     
  7. ICEknight

    ICEknight

    Researcher Researcher
    Disassembly from which game?
     
  8. Hivebrain

    Hivebrain

    Administrator
    2,863
    18
    18
    53.4N, 1.5W
    HiveView
    Sonic 1.
     
  9. Aurochs

    Aurochs

    Единый, могучий Советский Союз! Tech Member
    2,343
    0
    0
    Whatever catches my fancy
    Okay, I finally finished my research. :P

    First off, INCLUDE must be preceded by a label to work. Most assembler directives do. Second, SNASM68K supports the INCBIN directive. This means that you can include binary files, I.e. data, I.e. the stuff that SPLIT.EXE generates. That means that WE CAN THROW OUT COMBINE.EXE!!! Finally, I can get rid of that slow-ass program! :D

    Research is ongoing here. :)

    EDIT: Long filenames aren't valid. I'm going to come up with another data naming scheme so that the filenames will fit in 8 characters.

    Then, maybe, I might just hack the directive processor to accept UMSDOS names. :P
     
  10. LOst

    LOst

    Tech Member
    4,889
    1
    16
    Include works as long as you have it in the same tab field as the instructions. So <tab>include 'filename.asm'<tab>;comments is how you do it.
     
  11. Hivebrain

    Hivebrain

    Administrator
    2,863
    18
    18
    53.4N, 1.5W
    HiveView
    I wrote a program to combine ASM files anyway, and you can use long filenames.
     
Thread Status:
Not open for further replies.