This fragment is from the Acorn Teletext VDU manual. It determines if an Op-Code is a single byte, 2-byte or 3-byte instruction. It only works for the NMOS instruction set and doesn't give any details of the addressing mode but somebody might find it useful.
Code:
Enter with the Op-Code in A
CMP #$20 JSR is an anomaly and is done first
BEQ BYTE3
AND #$9F
BEQ BYTE1 binary OXX00000 is 1 byte
AND #$1D
CMP #$19
BEQ BYTE3 binary XXX110X1 is 3 bytes
AND #$0D
CMP #$08
BEQ BYTE1 binary XXXXX0X0 (now) is 1 byte
AND #$0C
CMP #$0C
BEQ BYTE3 binary XXXX11 XX is 3 bytes
If we get to here, it must be a 2-byte instruction