I'm learning 6502 assembly language, and having trouble working something out. I've been trying out a JavaScript 6502 assembler/emulator, and noticed that most examples have a section that looks like:
colors:
dcb 0,0,0,0,0,$9,$9,1,1,0,0,0,0,0
I've tried to Google what dcb
means, and the closest I've got is decimal-coded binary. From looking at the source code, it looks like the assembler is taking the values and inserting each one as a separate byte at the current point in the code.
I'm using DASM locally to assemble my code, and it doesn't support dcb
. Is there an equivalent way in DASM to set byte values directly in the code like this?
.DC
works fine, but the direct equivalent in DASM isThe
b
is for bytes, as AusCBloke said. You could replace it withw
for words (2 bytes) orl
for long words (4 bytes).You have correctly surmised that the purpose of
dc.x
is to inject constant values at the current location.