Jump to content

  •  

Photo

ASM Highlighter Explanation


  • Please log in to reply
11 replies to this topic

#1 Qjimbo

Qjimbo

    7 Chaos Emeralds

  • Pro User
  • 808 posts
  • Gender:Male
  • Location:Vancouver, BC
  • Interests:Webdesign, HTML, PHP,
    Programming, Delphi, C++

Posted 31 January 2009 - 04:02 PM

I've recently set up an M68000 Assembly code highlighter on here (using gnombat's SHJS), which works when you enclose code in [asm] tags.

Here is a guide to the colour scheme:
68000 instructions
68000 conditional instructions
68000 registers
68000 opcode parameters
Numbers
Comments

Example of code:
loc_13A9C:
lea (SonAni_Run).l,a1; use running animation
cmpi.w #$600,d2; is Sonic at running speed?
bcc.s loc_13AB4; if yes, branch
lea (SonAni_Walk).l,a1; use walking animation


It does take a few seconds for the highlighting to appear as it is javascript based. It doesn't work on the classic skin either.

Anyway, enjoy!
  • 0

#2 SonicVaan

SonicVaan

    The probably one and only cybergoth in this community. '_

  • Pro User
  • 386 posts
  • Gender:Male
  • Location:Germany, Cologne
  • Interests:ASM, Betatesting, Synthesizers and music production

Posted 31 January 2009 - 04:06 PM

I completely do thank you. It might be helpful for the community!

Edited by SonicVaan, 31 January 2009 - 04:13 PM.

  • 0

#3 Spanner

Spanner

    Capable when people thought I wasn't...

  • Staff
  • 1478 posts
  • Gender:Male
  • Location:United Kingdom

Posted 31 January 2009 - 04:40 PM

I see that you're adding more things from GB to here, the asm tags were good though, it beats having to do [code=auto:0] all the time.

It doesn't work on the classic skin either.


Why? If you're adding a feature you should at least make it available to both skins. I prefer using the Classic skin at most times, I don't want to be forced into using the Wacky Workbench theme right now.

Edited by SOTI, 31 January 2009 - 04:41 PM.

  • 0

#4 Qjimbo

Qjimbo

    7 Chaos Emeralds

  • Pro User
  • 808 posts
  • Gender:Male
  • Location:Vancouver, BC
  • Interests:Webdesign, HTML, PHP,
    Programming, Delphi, C++

Posted 31 January 2009 - 04:47 PM

Well what can I say, it was one of my better ideas that I implemented on that forum ;)

It also now works on the classic skin. Feel free to improve the CSS file if you want and I'll upload it.
  • 0

#5 Selbi

Selbi

    Obligatory new year's avatar remake.

  • Pro User
  • 1675 posts
  • Gender:Male
  • Location:Lüneburg, Germany

Posted 31 January 2009 - 05:11 PM

loc_13A9C:
lea (SonAni_Run).l,a1; use running animation
cmpi.w #$600,d2; is Sonic at running speed?
bcc.s loc_13AB4; if yes, branch
lea (SonAni_Walk).l,a1; use walking animation

You should use another color for comments (grey for example). But good work so far! ;)

EDIT: It's fixed, so shut your mouth.

Edited by Selbi, 18 May 2009 - 08:08 PM.

  • 0

#6 Qjimbo

Qjimbo

    7 Chaos Emeralds

  • Pro User
  • 808 posts
  • Gender:Male
  • Location:Vancouver, BC
  • Interests:Webdesign, HTML, PHP,
    Programming, Delphi, C++

Posted 31 January 2009 - 05:44 PM

Yeah comments are turning out to be a bit of a hassle. Hopefully I'll be able to get that fixed.
  • 0

#7 Selbi

Selbi

    Obligatory new year's avatar remake.

  • Pro User
  • 1675 posts
  • Gender:Male
  • Location:Lüneburg, Germany

Posted 03 February 2009 - 12:18 AM

Yeah comments are turning out to be a bit of a hassle. Hopefully I'll be able to get that fixed.

Well, when I use ' it got commend out. Here is an example:
Comment_Check:
cmpi.b #1,($FFFFFFF5) 'is this a n00b comment?'
beq.s No_Comment_Change ; if yes, branch
move.b #1,($FFFFFFF5) 'change comment to a n00b comment'

No_Comment_Check:
rts


Good example? :) Can you change the ' to ;? If yes, branch!

Edited by Selbi, 03 February 2009 - 12:20 AM.

  • 0

#8 Qjimbo

Qjimbo

    7 Chaos Emeralds

  • Pro User
  • 808 posts
  • Gender:Male
  • Location:Vancouver, BC
  • Interests:Webdesign, HTML, PHP,
    Programming, Delphi, C++

Posted 03 February 2009 - 09:53 AM

So you're saying if someone wants to use apostrophes for comments then I should edit it so it uses a ; instead? I can't do that since the highlighter just adds in CSS code for colours.
  • 0

#9 Selbi

Selbi

    Obligatory new year's avatar remake.

  • Pro User
  • 1675 posts
  • Gender:Male
  • Location:Lüneburg, Germany

Posted 03 February 2009 - 12:32 PM

Oh, that sucks... is there no way to change it to ;?

EDIT: I see, you've add a comment function for ; sign. You can trash this small issue! :)

Edited by Selbi, 04 February 2009 - 05:38 PM.

  • 0

#10 Selbi

Selbi

    Obligatory new year's avatar remake.

  • Pro User
  • 1675 posts
  • Gender:Male
  • Location:Lüneburg, Germany

Posted 04 April 2009 - 07:39 PM

Sorry for double post, but I have a suggestion: What about changing the color for include and incbin? If I use it in a ASM box, this happends:
incbin 'blah.bin'

I don't believe, this .b is suposed to be in this color. Hope you can fix it. :P
  • 0

#11 Oerg866

Oerg866

    The dense kraut(tm)

  • Member
  • 231 posts
  • Gender:Male
  • Location:Frankfurt

Posted 07 April 2009 - 09:42 AM

By the way, normally the comments are in green color on pretty much every highlighter out there.
  • 0

#12 Qjimbo

Qjimbo

    7 Chaos Emeralds

  • Pro User
  • 808 posts
  • Gender:Male
  • Location:Vancouver, BC
  • Interests:Webdesign, HTML, PHP,
    Programming, Delphi, C++

Posted 20 April 2009 - 12:48 AM

Are you really suggesting Green on Green? =P
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users