Changes

Jump to: navigation, search

Assembler Basics

50 bytes added, 18:22, 15 September 2022
6502 Assembly Language in the Emulator
[[Category:Assembly Language]]
When you program in [[AssemblerAssembly Language|assembly language]], you're directly programming the "bare metal" hardware. This means that many of the compile-time and run-time checks, error messages, and diagnostics that are present in other languages are not available. The computer will follow your instructions exactly, even if they are completely wrong (like executing data), and when something goes wrong, your program won't terminate until it tries to do something that's not permitted, such as execute an invalid opcode or attempt to access a protected or unmapped region of memory. When that happens, the CPU will signal an exception, and in most cases the operating system will shut down the offending process.
== Format of an Assembly Language program ==
== 6502 Assembly Language in the Emulator ==
The [[6502 Emulator]] provides a very simple assemblerfor [[6502]] code:
* Simple text-substitution macros can be defined with <code>define ''name'' ''value''</code> like this:
define SCREEN $f000
* The DCB (Declare Constant Byte) directive can be used to create a group of bytes in memory. Byte values are comma-separated and may be double-quoted single printable characters (except space, double quote, or comma), decimal values, or hexadecimal values prefixed with $, like this:
dcb 12,34,56
dcb $33,$66,$CC,$FF

Navigation menu