New answers tagged

4

Although it's often convenient to think of each instruction as starting with an opcode fetch, it's more accurate to think of each instruction's execution as starting on the cycle after its opcode is fetched, and extending through the fetch of the following opcode. If one considers an instruction like ADC #12, there's no way the processor can even begin to ...


12

Look further down in the print-out. The A register shows as updated after the first byte fetch of that next instruction. Starting with the bytes 67 02 20 10, which seem to be what you had: cycle ab db rw Fetch pc a x y s p 0 0000 67 1 unknown 0000 aa 00 00 fd nv‑BdIZc 0 0000 67 1 unknown 0000 aa 00 ...


3

The answer with anything of that age is "to save silicon". That pushed address was never intended for programmer use. I coded 6502 professionally for years, using every possible trick to push the limits of the metal, and that issue never really came up for me. It sounds like you're trying to do a JMP to a variable address by pushing the address ...


20

Why does the 6502 JSR instruction only increment the return address by 2 bytes? Simply because the PC is already pushed before the second address byte is read. That way the CPU does need only to buffer the lower target address byte and read later on the higher one direct into the PC. The workings are described in great detail in the original 1976 MCS 6500 ...


1

The assumption in the question is incorrect. The common wisdom about C being a bad choice for the 6502, is wrong. The choice of source language, does not gate the quality of generated code for the 6502. In fact, code quality on the 6502 (or any other platform for that matter) is gated by the quality of lowering intermediate-representation code to MOS ...


3

but I don't know how to convert the set of hex digits the user inputs into memory into the format required for the FAC I have a strong feeling that this is not about hex, but binary integers, 16 bit or more. I know about FRMNUM ($DD67) and PRNTFAC ($ED2E), but I can't find the subroutine that Applesoft uses to take a decimal number and convert it to the ...


Top 50 recent answers are included