Sonic and Sega Retro Message Board: The Macro Assembler AS - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

The Macro Assembler AS Questions go here

#1 User is offline Aurochs 

Posted 17 December 2006 - 12:45 AM

  • Единый, могучий Советский Союз!
  • Posts: 2343
  • Joined: 09-January 05
  • Gender:Male
  • Project:Whatever catches my fancy
  • Wiki edits:325
If you have a question about AS that you want answered, post it here. If I can't answer it myself, and I'm sufficiently piqued, I'll email Alfred Arnold about it.

Any questions of the general form "yadda yadda yadda AS sucks yadda yadda" will be silently ignored.

#2 User is offline Weird Person 

Posted 17 December 2006 - 12:38 PM

  • You lost two seconds reading this
  • Posts: 367
  • Joined: 12-March 05
  • Project:Who knows?
Where I can download it?

#3 User is offline Aurochs 

Posted 17 December 2006 - 01:08 PM

  • Единый, могучий Советский Союз!
  • Posts: 2343
  • Joined: 09-January 05
  • Gender:Male
  • Project:Whatever catches my fancy
  • Wiki edits:325
Home page

#4 User is offline Hayate 

Posted 18 December 2006 - 03:07 PM

  • Posts: 2379
  • Joined: 01-February 04
  • Gender:Male
  • Location:Torquay, England
  • Wiki edits:70
(Assuming by AS you mean ASM) What do bmi and bpl mean?

#5 User is offline Puto 

Posted 18 December 2006 - 04:05 PM

  • Shin'ichi Kudō, detective.
  • Posts: 2012
  • Joined: 31-July 05
  • Gender:Male
  • Location:Portugal, Oeiras
  • Project:Part of Team Megamix, but haven't done any actual work in ages.
  • Wiki edits:51
No, by AS he means the AS assembler used in his Sonic 2 Disassembly :P

#6 User is offline Hayate 

Posted 18 December 2006 - 04:41 PM

  • Posts: 2379
  • Joined: 01-February 04
  • Gender:Male
  • Location:Torquay, England
  • Wiki edits:70
o.

I guess my question still holds, though.

#7 User is offline Quickman 

Posted 18 December 2006 - 05:35 PM

  • Posts: 5584
  • Joined: 03-December 03
  • Gender:Male
  • Location::x
  • Project:omg porjcet
  • Wiki edits:10
Branch if MInus (sign bit set) and Branch if PLus (sign bit clear).

#8 User is offline Hivebrain 

Posted 18 December 2006 - 07:05 PM

  • Posts: 2656
  • Joined: 15-January 03
  • Gender:Male
  • Location:53.4N, 1.5W
  • Project:HivePal 2.0
  • Wiki edits:6,176

View PostQuickman, on Dec 18 2006, 10:35 PM, said:

Branch if MInus (sign bit set) and Branch if PLus (sign bit clear).

In other words, branch if a value is negative and branch if a value is 0 or positive.

#9 User is offline Puto 

Posted 23 December 2006 - 12:16 AM

  • Shin'ichi Kudō, detective.
  • Posts: 2012
  • Joined: 31-July 05
  • Gender:Male
  • Location:Portugal, Oeiras
  • Project:Part of Team Megamix, but haven't done any actual work in ages.
  • Wiki edits:51
What's the AS equivalent of "even"?

#10 User is offline Aurochs 

Posted 23 December 2006 - 12:47 AM

  • Единый, могучий Советский Союз!
  • Posts: 2343
  • Joined: 09-January 05
  • Gender:Male
  • Project:Whatever catches my fancy
  • Wiki edits:325
Since several people have complained about AS emitting errors for indexed addressing modes, I've decided to explain it here.

The problem is not in the instructions that give the errors. They are perfectly fine. The problem is in certain JMP statements, particuraly absolute jumps without a specified length. They take the form

<tt>jmp someLabel</tt>

When AS encounters this in the first pass, and <tt>someLabel</tt> hasn't been defined yet, it will reserve two extension words and move on. In the second pass, the extension words are filled in with the destination address, and if it's found to need only a single word, AS will size-optimize. This is precicely the problem.

When that second word is removed, the entire ROM after that will be shifted down two bytes. This messes up all later references. Occasionally, the address space will be shifted such that AS will attempt to allocate extra space for other references - and if this isn't allowed for some addressing mode, it will emit an error.

This is rather simple to fix. Simply specify the width of the destination address in absolute jumps. The above instruction becomes

<tt>jmp (someLabel).[swl]</tt>

You can choose any of s, w, or l for the length attribute depending on the expected address width. (s and w mean the same thing.) AS will emit an error if .[sw] isn't allowed because the destination address is too long.

EDIT: s/path/pass
This post has been edited by Aurochs: 29 December 2006 - 07:47 PM

#11 User is offline Puto 

Posted 23 December 2006 - 12:57 AM

  • Shin'ichi Kudō, detective.
  • Posts: 2012
  • Joined: 31-July 05
  • Gender:Male
  • Location:Portugal, Oeiras
  • Project:Part of Team Megamix, but haven't done any actual work in ages.
  • Wiki edits:51
Posted Image
I get this when building my hack with AS. The same source code, with bincludes changed to incbins, and "align 2"s changed to evens, works perfectly. Anybody has any idea of the problem?
This post has been edited by puto: 23 December 2006 - 12:57 AM

#12 User is offline Puto 

Posted 23 December 2006 - 02:04 AM

  • Shin'ichi Kudō, detective.
  • Posts: 2012
  • Joined: 31-July 05
  • Gender:Male
  • Location:Portugal, Oeiras
  • Project:Part of Team Megamix, but haven't done any actual work in ages.
  • Wiki edits:51
Attention, double posting: The previous problem was fixed by adding "padding off" to the very beginning of the code.

#13 User is offline shobiz 

Posted 10 August 2007 - 02:28 AM

  • Posts: 863
  • Joined: 27-March 05
  • Gender:Male
  • Location:Karachi, Pakistan
  • Wiki edits:4,411
How would one use a DATA segment? The AS manual is kinda vague about that.

#14 User is offline Puto 

Posted 10 August 2007 - 04:23 AM

  • Shin'ichi Kudō, detective.
  • Posts: 2012
  • Joined: 31-July 05
  • Gender:Male
  • Location:Portugal, Oeiras
  • Project:Part of Team Megamix, but haven't done any actual work in ages.
  • Wiki edits:51
I think that's irrelevant for genesis programming.

#15 User is offline shobiz 

Posted 10 August 2007 - 05:55 AM

  • Posts: 863
  • Joined: 27-March 05
  • Gender:Male
  • Location:Karachi, Pakistan
  • Wiki edits:4,411
The reason I was asking was that Aurochs said he was going to use a data segment to define RAM variables in the 2007 release of his disassembly, and I was interested in seeing how that would have worked. Perhaps a PM would have been better, but meh.

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users