6809 DAA questions...

Hardware Hacking, Programming and Game Solutions/Cheats
Post Reply
jedie
Posts: 630
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

6809 DAA questions...

Post by jedie » Tue Jul 15, 2014 2:17 pm

I found (maybe the last) but in my Emulator: The DAA Instruction has set wrong CC Flags: https://github.com/jedie/DragonPy/commi ... 55164d7a46

I found this by adding unittests with the sbc09 ROM. That's because the BASIC Interpreter doesn't use DAA :P

But it don't know it DAA is really without bugs.

e.g.: I found documentation that say V will be cleared, but other documentation says V is undefined.

I have made a test if CC flags are set in the right way.

I do something like:

Code: Select all

LDA #$01
ADDA #$xx
DAA
and that's in a loop, where xx will be +1 from 0 to $ff

Output is:

Code: Select all

$1 + $00 = $01 > DAA > $01 | CC:........
$1 + $01 = $02 > DAA > $02 | CC:........
$1 + $02 = $03 > DAA > $03 | CC:........
$1 + $03 = $04 > DAA > $04 | CC:........
$1 + $04 = $05 > DAA > $05 | CC:........
$1 + $05 = $06 > DAA > $06 | CC:........
$1 + $06 = $07 > DAA > $07 | CC:........
$1 + $07 = $08 > DAA > $08 | CC:........
$1 + $08 = $09 > DAA > $09 | CC:........
$1 + $09 = $0a > DAA > $10 | CC:........
$1 + $0a = $0b > DAA > $11 | CC:........
$1 + $0b = $0c > DAA > $12 | CC:........
$1 + $0c = $0d > DAA > $13 | CC:........
$1 + $0d = $0e > DAA > $14 | CC:........
$1 + $0e = $0f > DAA > $15 | CC:........
$1 + $0f = $10 > DAA > $16 | CC:..H.....
$1 + $10 = $11 > DAA > $11 | CC:........
$1 + $11 = $12 > DAA > $12 | CC:........
$1 + $12 = $13 > DAA > $13 | CC:........
$1 + $13 = $14 > DAA > $14 | CC:........
$1 + $14 = $15 > DAA > $15 | CC:........
$1 + $15 = $16 > DAA > $16 | CC:........
$1 + $16 = $17 > DAA > $17 | CC:........
$1 + $17 = $18 > DAA > $18 | CC:........
$1 + $18 = $19 > DAA > $19 | CC:........
$1 + $19 = $1a > DAA > $20 | CC:........
$1 + $1a = $1b > DAA > $21 | CC:........
$1 + $1b = $1c > DAA > $22 | CC:........
$1 + $1c = $1d > DAA > $23 | CC:........
$1 + $1d = $1e > DAA > $24 | CC:........
$1 + $1e = $1f > DAA > $25 | CC:........
$1 + $1f = $20 > DAA > $26 | CC:..H.....
$1 + $20 = $21 > DAA > $21 | CC:........
$1 + $21 = $22 > DAA > $22 | CC:........
$1 + $22 = $23 > DAA > $23 | CC:........
$1 + $23 = $24 > DAA > $24 | CC:........
$1 + $24 = $25 > DAA > $25 | CC:........
$1 + $25 = $26 > DAA > $26 | CC:........
$1 + $26 = $27 > DAA > $27 | CC:........
$1 + $27 = $28 > DAA > $28 | CC:........
$1 + $28 = $29 > DAA > $29 | CC:........
$1 + $29 = $2a > DAA > $30 | CC:........
$1 + $2a = $2b > DAA > $31 | CC:........
$1 + $2b = $2c > DAA > $32 | CC:........
$1 + $2c = $2d > DAA > $33 | CC:........
$1 + $2d = $2e > DAA > $34 | CC:........
$1 + $2e = $2f > DAA > $35 | CC:........
$1 + $2f = $30 > DAA > $36 | CC:..H.....
$1 + $30 = $31 > DAA > $31 | CC:........
$1 + $31 = $32 > DAA > $32 | CC:........
$1 + $32 = $33 > DAA > $33 | CC:........
$1 + $33 = $34 > DAA > $34 | CC:........
$1 + $34 = $35 > DAA > $35 | CC:........
$1 + $35 = $36 > DAA > $36 | CC:........
$1 + $36 = $37 > DAA > $37 | CC:........
$1 + $37 = $38 > DAA > $38 | CC:........
$1 + $38 = $39 > DAA > $39 | CC:........
$1 + $39 = $3a > DAA > $40 | CC:........
$1 + $3a = $3b > DAA > $41 | CC:........
$1 + $3b = $3c > DAA > $42 | CC:........
$1 + $3c = $3d > DAA > $43 | CC:........
$1 + $3d = $3e > DAA > $44 | CC:........
$1 + $3e = $3f > DAA > $45 | CC:........
$1 + $3f = $40 > DAA > $46 | CC:..H.....
$1 + $40 = $41 > DAA > $41 | CC:........
$1 + $41 = $42 > DAA > $42 | CC:........
$1 + $42 = $43 > DAA > $43 | CC:........
$1 + $43 = $44 > DAA > $44 | CC:........
$1 + $44 = $45 > DAA > $45 | CC:........
$1 + $45 = $46 > DAA > $46 | CC:........
$1 + $46 = $47 > DAA > $47 | CC:........
$1 + $47 = $48 > DAA > $48 | CC:........
$1 + $48 = $49 > DAA > $49 | CC:........
$1 + $49 = $4a > DAA > $50 | CC:........
$1 + $4a = $4b > DAA > $51 | CC:........
$1 + $4b = $4c > DAA > $52 | CC:........
$1 + $4c = $4d > DAA > $53 | CC:........
$1 + $4d = $4e > DAA > $54 | CC:........
$1 + $4e = $4f > DAA > $55 | CC:........
$1 + $4f = $50 > DAA > $56 | CC:..H.....
$1 + $50 = $51 > DAA > $51 | CC:........
$1 + $51 = $52 > DAA > $52 | CC:........
$1 + $52 = $53 > DAA > $53 | CC:........
$1 + $53 = $54 > DAA > $54 | CC:........
$1 + $54 = $55 > DAA > $55 | CC:........
$1 + $55 = $56 > DAA > $56 | CC:........
$1 + $56 = $57 > DAA > $57 | CC:........
$1 + $57 = $58 > DAA > $58 | CC:........
$1 + $58 = $59 > DAA > $59 | CC:........
$1 + $59 = $5a > DAA > $60 | CC:........
$1 + $5a = $5b > DAA > $61 | CC:........
$1 + $5b = $5c > DAA > $62 | CC:........
$1 + $5c = $5d > DAA > $63 | CC:........
$1 + $5d = $5e > DAA > $64 | CC:........
$1 + $5e = $5f > DAA > $65 | CC:........
$1 + $5f = $60 > DAA > $66 | CC:..H.....
$1 + $60 = $61 > DAA > $61 | CC:........
$1 + $61 = $62 > DAA > $62 | CC:........
$1 + $62 = $63 > DAA > $63 | CC:........
$1 + $63 = $64 > DAA > $64 | CC:........
$1 + $64 = $65 > DAA > $65 | CC:........
$1 + $65 = $66 > DAA > $66 | CC:........
$1 + $66 = $67 > DAA > $67 | CC:........
$1 + $67 = $68 > DAA > $68 | CC:........
$1 + $68 = $69 > DAA > $69 | CC:........
$1 + $69 = $6a > DAA > $70 | CC:........
$1 + $6a = $6b > DAA > $71 | CC:........
$1 + $6b = $6c > DAA > $72 | CC:........
$1 + $6c = $6d > DAA > $73 | CC:........
$1 + $6d = $6e > DAA > $74 | CC:........
$1 + $6e = $6f > DAA > $75 | CC:........
$1 + $6f = $70 > DAA > $76 | CC:..H.....
$1 + $70 = $71 > DAA > $71 | CC:........
$1 + $71 = $72 > DAA > $72 | CC:........
$1 + $72 = $73 > DAA > $73 | CC:........
$1 + $73 = $74 > DAA > $74 | CC:........
$1 + $74 = $75 > DAA > $75 | CC:........
$1 + $75 = $76 > DAA > $76 | CC:........
$1 + $76 = $77 > DAA > $77 | CC:........
$1 + $77 = $78 > DAA > $78 | CC:........
$1 + $78 = $79 > DAA > $79 | CC:........
$1 + $79 = $7a > DAA > $80 | CC:....N...
$1 + $7a = $7b > DAA > $81 | CC:....N...
$1 + $7b = $7c > DAA > $82 | CC:....N...
$1 + $7c = $7d > DAA > $83 | CC:....N...
$1 + $7d = $7e > DAA > $84 | CC:....N...
$1 + $7e = $7f > DAA > $85 | CC:....N...
$1 + $7f = $80 > DAA > $86 | CC:..H.N.V.
$1 + $80 = $81 > DAA > $81 | CC:....N...
$1 + $81 = $82 > DAA > $82 | CC:....N...
$1 + $82 = $83 > DAA > $83 | CC:....N...
$1 + $83 = $84 > DAA > $84 | CC:....N...
$1 + $84 = $85 > DAA > $85 | CC:....N...
$1 + $85 = $86 > DAA > $86 | CC:....N...
$1 + $86 = $87 > DAA > $87 | CC:....N...
$1 + $87 = $88 > DAA > $88 | CC:....N...
$1 + $88 = $89 > DAA > $89 | CC:....N...
$1 + $89 = $8a > DAA > $90 | CC:....N...
$1 + $8a = $8b > DAA > $91 | CC:....N...
$1 + $8b = $8c > DAA > $92 | CC:....N...
$1 + $8c = $8d > DAA > $93 | CC:....N...
$1 + $8d = $8e > DAA > $94 | CC:....N...
$1 + $8e = $8f > DAA > $95 | CC:....N...
$1 + $8f = $90 > DAA > $96 | CC:..H.N...
$1 + $90 = $91 > DAA > $91 | CC:....N...
$1 + $91 = $92 > DAA > $92 | CC:....N...
$1 + $92 = $93 > DAA > $93 | CC:....N...
$1 + $93 = $94 > DAA > $94 | CC:....N...
$1 + $94 = $95 > DAA > $95 | CC:....N...
$1 + $95 = $96 > DAA > $96 | CC:....N...
$1 + $96 = $97 > DAA > $97 | CC:....N...
$1 + $97 = $98 > DAA > $98 | CC:....N...
$1 + $98 = $99 > DAA > $99 | CC:....N...
$1 + $99 = $9a > DAA > $00 | CC:.....Z.C
$1 + $9a = $9b > DAA > $01 | CC:.......C
$1 + $9b = $9c > DAA > $02 | CC:.......C
$1 + $9c = $9d > DAA > $03 | CC:.......C
$1 + $9d = $9e > DAA > $04 | CC:.......C
$1 + $9e = $9f > DAA > $05 | CC:.......C
$1 + $9f = $a0 > DAA > $06 | CC:..H....C
$1 + $a0 = $a1 > DAA > $01 | CC:.......C
$1 + $a1 = $a2 > DAA > $02 | CC:.......C
$1 + $a2 = $a3 > DAA > $03 | CC:.......C
$1 + $a3 = $a4 > DAA > $04 | CC:.......C
$1 + $a4 = $a5 > DAA > $05 | CC:.......C
$1 + $a5 = $a6 > DAA > $06 | CC:.......C
$1 + $a6 = $a7 > DAA > $07 | CC:.......C
$1 + $a7 = $a8 > DAA > $08 | CC:.......C
$1 + $a8 = $a9 > DAA > $09 | CC:.......C
$1 + $a9 = $aa > DAA > $10 | CC:.......C
$1 + $aa = $ab > DAA > $11 | CC:.......C
$1 + $ab = $ac > DAA > $12 | CC:.......C
$1 + $ac = $ad > DAA > $13 | CC:.......C
$1 + $ad = $ae > DAA > $14 | CC:.......C
$1 + $ae = $af > DAA > $15 | CC:.......C
$1 + $af = $b0 > DAA > $16 | CC:..H....C
$1 + $b0 = $b1 > DAA > $11 | CC:.......C
$1 + $b1 = $b2 > DAA > $12 | CC:.......C
$1 + $b2 = $b3 > DAA > $13 | CC:.......C
$1 + $b3 = $b4 > DAA > $14 | CC:.......C
$1 + $b4 = $b5 > DAA > $15 | CC:.......C
$1 + $b5 = $b6 > DAA > $16 | CC:.......C
$1 + $b6 = $b7 > DAA > $17 | CC:.......C
$1 + $b7 = $b8 > DAA > $18 | CC:.......C
$1 + $b8 = $b9 > DAA > $19 | CC:.......C
$1 + $b9 = $ba > DAA > $20 | CC:.......C
$1 + $ba = $bb > DAA > $21 | CC:.......C
$1 + $bb = $bc > DAA > $22 | CC:.......C
$1 + $bc = $bd > DAA > $23 | CC:.......C
$1 + $bd = $be > DAA > $24 | CC:.......C
$1 + $be = $bf > DAA > $25 | CC:.......C
$1 + $bf = $c0 > DAA > $26 | CC:..H....C
$1 + $c0 = $c1 > DAA > $21 | CC:.......C
$1 + $c1 = $c2 > DAA > $22 | CC:.......C
$1 + $c2 = $c3 > DAA > $23 | CC:.......C
$1 + $c3 = $c4 > DAA > $24 | CC:.......C
$1 + $c4 = $c5 > DAA > $25 | CC:.......C
$1 + $c5 = $c6 > DAA > $26 | CC:.......C
$1 + $c6 = $c7 > DAA > $27 | CC:.......C
$1 + $c7 = $c8 > DAA > $28 | CC:.......C
$1 + $c8 = $c9 > DAA > $29 | CC:.......C
$1 + $c9 = $ca > DAA > $30 | CC:.......C
$1 + $ca = $cb > DAA > $31 | CC:.......C
$1 + $cb = $cc > DAA > $32 | CC:.......C
$1 + $cc = $cd > DAA > $33 | CC:.......C
$1 + $cd = $ce > DAA > $34 | CC:.......C
$1 + $ce = $cf > DAA > $35 | CC:.......C
$1 + $cf = $d0 > DAA > $36 | CC:..H....C
$1 + $d0 = $d1 > DAA > $31 | CC:.......C
$1 + $d1 = $d2 > DAA > $32 | CC:.......C
$1 + $d2 = $d3 > DAA > $33 | CC:.......C
$1 + $d3 = $d4 > DAA > $34 | CC:.......C
$1 + $d4 = $d5 > DAA > $35 | CC:.......C
$1 + $d5 = $d6 > DAA > $36 | CC:.......C
$1 + $d6 = $d7 > DAA > $37 | CC:.......C
$1 + $d7 = $d8 > DAA > $38 | CC:.......C
$1 + $d8 = $d9 > DAA > $39 | CC:.......C
$1 + $d9 = $da > DAA > $40 | CC:.......C
$1 + $da = $db > DAA > $41 | CC:.......C
$1 + $db = $dc > DAA > $42 | CC:.......C
$1 + $dc = $dd > DAA > $43 | CC:.......C
$1 + $dd = $de > DAA > $44 | CC:.......C
$1 + $de = $df > DAA > $45 | CC:.......C
$1 + $df = $e0 > DAA > $46 | CC:..H....C
$1 + $e0 = $e1 > DAA > $41 | CC:.......C
$1 + $e1 = $e2 > DAA > $42 | CC:.......C
$1 + $e2 = $e3 > DAA > $43 | CC:.......C
$1 + $e3 = $e4 > DAA > $44 | CC:.......C
$1 + $e4 = $e5 > DAA > $45 | CC:.......C
$1 + $e5 = $e6 > DAA > $46 | CC:.......C
$1 + $e6 = $e7 > DAA > $47 | CC:.......C
$1 + $e7 = $e8 > DAA > $48 | CC:.......C
$1 + $e8 = $e9 > DAA > $49 | CC:.......C
$1 + $e9 = $ea > DAA > $50 | CC:.......C
$1 + $ea = $eb > DAA > $51 | CC:.......C
$1 + $eb = $ec > DAA > $52 | CC:.......C
$1 + $ec = $ed > DAA > $53 | CC:.......C
$1 + $ed = $ee > DAA > $54 | CC:.......C
$1 + $ee = $ef > DAA > $55 | CC:.......C
$1 + $ef = $f0 > DAA > $56 | CC:..H....C
$1 + $f0 = $f1 > DAA > $51 | CC:.......C
$1 + $f1 = $f2 > DAA > $52 | CC:.......C
$1 + $f2 = $f3 > DAA > $53 | CC:.......C
$1 + $f3 = $f4 > DAA > $54 | CC:.......C
$1 + $f4 = $f5 > DAA > $55 | CC:.......C
$1 + $f5 = $f6 > DAA > $56 | CC:.......C
$1 + $f6 = $f7 > DAA > $57 | CC:.......C
$1 + $f7 = $f8 > DAA > $58 | CC:.......C
$1 + $f8 = $f9 > DAA > $59 | CC:.......C
$1 + $f9 = $fa > DAA > $60 | CC:.......C
$1 + $fa = $fb > DAA > $61 | CC:.......C
$1 + $fb = $fc > DAA > $62 | CC:.......C
$1 + $fc = $fd > DAA > $63 | CC:.......C
$1 + $fd = $fe > DAA > $64 | CC:.......C
$1 + $fe = $ff > DAA > $65 | CC:.......C
Looks this right? Or should i test with other values?
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809

Post Reply