6502 Machine Language Tables and Aids

When programming using machine code there are a few useful aids that can make it easier to do. I have created a couple of tables for the 6502 that can make the process easier. They are based on tables found in 'Machine Code for Beginners', which Usborne have made available as a PDF for free.

6502 Machine Language Hex Codes

When writing a program in machine code we need to be able to quickly find the machine language hex code for the instruction we want to enter. The following table should make this fairly simple.

Two's Complement Hex Code

If we need to use a negative number such as when using relative addresses, then the following table will allow us to quickly find the correct hex code to use. For example the two's complement of -92 in hex is A4.

Source Files

If you want to alter these tables, I have put the original files used to create them in a repo on GitHub.

Creative Commons License
6502 Machine Language Tables and Aids by Lawrence Woodman is licensed under a Creative Commons Attribution 4.0 International License.

Share This Post

Feedback/Discuss

Related Articles

Getting the Address of BASIC Variables on the VIC-20

Getting the address of a BASIC variable can be useful if you want to pass data to a machine code routine or want to access the bytes of a variable directly to improve speed and reduce garbage collectio...   Read More

Saving and Loading Memory on the VIC-20

Saving and loading memory is quite easy on the VIC-20 once you know how. However, it isn't obvious how to do this and therefore this article will present a few simple ways of doing it from BASIC and A...   Read More

Programming in Assembly with VICMON on the VIC-20

VICMON is a machine language monitor released by Commodore in 1982 and is great for programming the VIC-20. Its interactive nature means that it can often be quicker to develop via this rather than us...   Read More

Storing Machine Code in REM Statements on the VIC-20

BASIC programs often contain machine code routines but they take up quite a lot of space in BASIC. An interesting way to reduce the amount of space that they take is to store the machine code in REM s...   Read More

Code and Data in Display Memory on the VIC-20

The unexpanded Commodore VIC-20 only had 5K of RAM and therefore creative ways had to be found to maximize the available RAM. The display memory would use some of this memory and therefore one option ...   Read More