[plug] Cross-assembler IDE

Simon Scott simon.scott at flexiplan.com
Fri Jul 13 09:59:14 WST 2001


	OK, then you get to the point where you realise that its not
actually that simple when you have data embedded in your code (some
disassemblers can detect that sort of thing) and in fact you want labels
created for every jmp, jsr and branch instruction

	Suddenly you wake up and realise you might as well just go find a
good one :)






	From:	Leon Brooks <leonb at brooks.fdns.net> on 13/07/2001 09:48 AM
	Please respond to plug at plug.linux.org.au@SMTP at Exchange
	To:	plug at plug.linux.org.au@SMTP at Exchange
	cc:	 

	Subject:	Re: [plug] Cross-assembler IDE

	Simon.Scott at flexiplan.com wrote:

	> Im looking for a good cross-assembler/disassembler IDE for linux,
preferably for
	> the 6502 processor.


	> Ive found a few assemblers, no disassemblers, and nothing that
even resembles an
	> IDE.

	And how hard can a 6502 disassembler be to write? It only has 1-byte

	opcodes - which are highly systematic - and a very simple set of 
	addressing schemes.

	char * opcodes [256] = {
	     "BRK", "ORA", "=error=", "SLO", ...
	};

	enum {
	     NONE, IMPLIED, IMMEDIATE, RELATIVE,
	     INDIRX, INDIRY, ZEROPX, ZEROPY, ... } mode;
	#define UNDOC 0x80;

	short modes [256] = {
	     NONE, INDIRX, NONE, INDIRX|UNDOC, ...
	};

	char * operands (unsigned * pc, mode thismode) {
	     char retval [30];

	     switch (thismode & ~UNDOC) {
	     case NONE:
	         retval [0] = '\0';
	         break;
	     case DIRECT:
	         sprintf (retval, "\t#%02X", getchar () & 0xFF);
	         break;
	     case ...
	     }
	}

	void main (void) {
	     int opcode;
	     unsigned address;

	     address = 0U;
	     while ((opcode = getchar ()) != EOF) {
	         printf ("%04x\t%s%s\n", address ++, opcodes [opcode &
0xFF],
	           operands (& address, modes [opcode & 0xFF]));
	     }
	}

	Give me an opcode table and it's yours in under an hour. (-:

	
http://pmwww.cs.vu.nl/home/ipoorten/Atari.8bit.Homepage/texts/c64.65xx.85xx.
document




**********************************************************************
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they   
are addressed. If you have received this email in error please notify 
the system manager.

This footnote also confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



More information about the plug mailing list