Author Topic: Way to determine if an Assembly program was created from Axe source?  (Read 6509 times)

0 Members and 1 Guest are viewing this topic.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Way to determine if an Assembly program was created from Axe source?
« Reply #15 on: February 25, 2011, 10:03:48 pm »
Because Axe source code is compiled into the same assembly language as a "normal" assembly program, there is no surefire way to determine the origins of an assembly program. However, you can make a very accurate educated guess by looking at the disassembled code. Here are a few differences I can think of that should be fairly noticeable between a "normal" assembly program and one generated by Axe:

  • Axe programs have a strong foundation in the hl register. A very high amount of h/l usage (and also a very low amount of b/c usage) should hint to a program compiled by Axe parser. This is probably the strongest indicator.
  • Axe programs also rely on storage of values in memory, often in the range from saveSScreen+714 to saveSScreen+767. Values are only carried from block to block in either memory or hl. (Or on the stack for subroutines)
  • Axe programs will have a lot of conditional branches following the format ld a,h \ or l \ jp (n)z,$XXXX. Very rarely will you see a conditional absolute jump that does not follow the above format or does not use the z flag.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Way to determine if an Assembly program was created from Axe source?
« Reply #16 on: February 25, 2011, 10:54:26 pm »
Okay, here is the Axe starting code for an APP:
CD8B40       ;jumps to the program code
EF364C       ;gets ready to exit
CD50002740   ;exits

I believe that last one can be a simple EF2740 because that bcall automatically exits (meaning you don't need to use bjump)
No, you have to use bjump here.  In fact, if you didn't, it would load stuff on the stack that isn't taken off, which is bad.