RE: BRK opcode

From: Gideon Zweijtzer (gideonz_at_dds.nl)
Date: 2003-11-05 06:47:00

> 
> Everywhere I look (almost everywhere then) it lists BRK as a 
> single byte opcode but in operation it is 2. Is there some 
> official explaination? I notice most assemblers treat it as a 
> single byte and maybe causing headaches for many users.
> 
Hello Nathan,

Of course, only the design team of the 6502 knows for sure what the
reason is, but the reason that I found out is that the BRK instruction
is just on a 2-byte size location in the instruction map. This is the
rule that I use for my own processor implementation. The size of a 6502
instruction is easily derived from the opcode by the following formula:
(The result is a two-bit value, where "00" is one byte, "01" is two
bytes and "10" is three bytes):

Bit1: xxxx11xx or xxx110x1
Bit0: xxxx0xxx or xxx010x1
 
Regards,
Gideon


       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.