Jamaica 10 ch11 Illegal Op-codes
From C64 Diskmag Wiki
illegal op-codes tjost ---------------------------------------- we are now going to reveal the deepest secrets of 6510 coding. this is not a chapter for beginners, but i hope that someone can find a use for it. if you find this chapter interesting, but not satisfying then you should contact me (my addy should be in the addy chapters) for more information about illegal op-codes or just any code-related talk. and now lets roll..... code addressing name b c -------------------------- 02 implied hlt 1 - 03 (zeropage,x) slo 2 8 04 zeropage nop 2 3 07 zeropage slo 2 5 0b #immediate ana 2 2 0c absolute nop 3 4 0f absolute slo 3 6 12 implied hlt 1 - 13 (zeropage),y slo 2 8 14 zeropage,x nop 2 4 17 zeropage,x slo 2 6 1a implied nop 1 2 1b absolute,y slo 3 7 1c absolute,x nop 3 4* 1f absolute,x slo 3 7 22 implied hlt 1 - 23 (zeropage,x) rla 2 8 27 zeropage rla 2 5 2b #immediate anb 2 2 2f absolute rla 3 6 32 implied hlt 1 - 33 (zeropage),y rla 2 8 34 zeropage,x nop 2 4 37 zeropage,x rla 2 6 3a implied nop 1 2 3b absolute,y rla 3 7 3c absolute,x nop 3 4* 3f absolute,x rla 3 7 42 implied hlt 1 - 43 (zeropage,x) sre 2 8 44 zeropage nop 2 3 47 zeropage sre 2 5 4b #immediate ram 2 2 4f absolute sre 3 6 52 implied hlt 1 - 53 (zeropage),y sre 2 8 54 zeropage,x nop 2 4 57 zeropage,x sre 2 6 5a implied nop 1 2 5b absolute,y sre 3 6 5c absolute,x nop 3 4* 5f absoulte,x sre 3 7 62 implied hlt 1 - 63 (zeropage,x) rra 2 8 64 zeropage nop 2 3 67 zeropage rra 2 5 6b #immediate rbm 2 2 6f absoulte rra 3 6 72 implied hlt 1 - 73 (zeropage),y rra 2 8 74 zeropage,x nop 2 4 77 zeropage,x rra 2 6 7a implied nop 1 2 7b absolute,y rra 3 7 7c absolute,x nop 3 4* 7f absolute,x rra 3 7 80 #immediate nop 2 2 82 #immediate nop 2 2 83 (zeropage,x) aax 2 6 87 zeropage aax 2 3 89 #immediate nop 2 2 8b #immediate axm 2 2 8f absolute aax 3 4 92 implied hlt 1 - 93 (zeropage),y tea 2 6 97 zeropage,y aax 2 4 9b absolute,y axs 3 5 9c absolute,x tey 3 5 9e absolute,y tex 3 5 9f absolute,y tea 3 5 a3 (zeropage,x) lax 2 6 a7 zeropage lax 2 3 ab #immediate lax 2 2 af absolute lax 3 4 b2 implied hlt 1 - b3 (zeropage),y lax 2 5* b7 zeropage,y lax 2 4 bb absolute,y las 3 4* bf absolute,y lax 3 4* c2 #immediate nop 2 2 c3 (zeropage,x) dcp 2 8 c7 zeropage dcp 2 5 cb #immediate xma 2 2 cf absolute dcp 3 6 d2 implied hlt 1 - d3 (zeropage),y dcp 2 8 d4 zeropage,x nop 2 4 d7 zeropage,x dcp 2 6 da implied nop 1 2 db absolute,y dcp 3 7 dc absolute,x nop 3 4* df absolute,x dcp 3 7 e2 #immediate nop 2 2 e3 (zeropage,x) isb 2 8 e7 zeropage isb 2 5 eb #immediate sbc 2 2 ef absolute isb 3 6 f2 implied hlt 1 - f3 (zeropage),y isb 2 8 f4 zeropage,x nop 2 4 f7 zeropage,x isb 2 6 fa implied nop 1 2 fb absolute,y isb 3 7 fc absolute,x nop 3 4* ff absolute,x isb 3 7 and here's the description of what the instruction does. name flags description ------------------------ aax m = a and x ana nzc asl #(a and m), and m anb nzc rol #(a and m), and m axm nz a = (x and m) and (a or #$ee) axs m = a and x and #>m+$100 dcp nzc dec m, cmp m hlt - total halt isb nvzc inc m, sbc m las nz lda (sp and m), tax, txs lax nz lda m, tax ram nzc and m, lsr a rbm nzc and n, ror a rla nzc rol m, and m rra nvzc ror m, adc m slo nzc asl m, ora m sre nzc lsr m, eor m tea m = a and x and #>m+$100 tex m = x and #>m+$100 tey m = y and #>m+$100 xma nzc x = (a and x) - m notes: a = accumulator x = x-register y = y-register sp = stackpointer m = byte in memory addressing is the addressing mode for that op-code. name is the instructions mnemonic name. b is the amount of bytes that the instruction occupies in memory. c is the amount of cycles the instruction will take to execute where * means add one cycle if page boundary crossed. flags is what flags the instruction will affect while executing. description briefly shows what each instruction does. well, that's it for this short introduction into the hidden worlds of the 6510.... signed : TJOST / JAM