ShaneM wrote:
koitsu wrote:
.db $bf, $0971
.db is a single byte, .dw is for two bytes and .dbw is three bytes. So it'll need to be:
.dbw $bf, $71, $09, since ROM addressing is assembled in Little-Endian. But good point. The question is, will it run? I've already finished my hack, but if I ever find more unknown original glitches (so far, I fixed em' all), I'll definitely give these a whirl! ;) --
ShaneMThe documentation for asm6 that I have doesn't mention anything about a
.dbw pseudo-op. I believe you're thinking of
.dcw (more appropriately known as
.dw), which you WOULD NOT use here. Quoting the manual:
Code:
DB, DW (also BYTE/WORD, DCB/DCW, DC.B/DC.W)
Emit byte(s) or word(s). Multiple arguments are separated by
commas. Strings can be "shifted" by adding a value to them (see
example).
DB $01,$02,$04,$08
DB "ABCDE"+1 ;equivalent to DB "BCDEF"
DB "ABCDE"-"A"+32 ;equivalent to DB 32,33,34,35,36
.dw will generate a word (16-bit) value, so
.dw $bf, $71, $09 would actually "generate" the following values: $00bf, $0071, $0009, which would get stored in the file as
$bf 00 71 00 09 00 (due to the 6502 being little-endian). This isn't what you want, and would result in some very broken code. Think about how those values would get turned into opcodes:
Code:
bf 00 71 = LAX $7100
00 09 = BRK $09
00 ... = BRK ??
An opcode is a single byte value, while the operand for opcode $bf would be a 16-bit address. The other addressing modes for LAX vary as well. I described this already though.
My point was that I don't know how
.db will react if you give it a word (16-bit) value. I suppose I can find out easily enough.