New answers tagged

0

As others have said, there is no easy way. The proper solution is to not use cl65, since it's workflow is pre-defined and I do not believe very extensible. The basic workflow for cc65 is cc65 runs to compile C source code in to as65 compatible assembly code. as65 is run to convert the assembly code in to object code. Finally, ld65, the linker, is called to ...


0

Use --mapfile to create a map file and collect all sources. Not very useful IMHO. you spread the source code and/or you spread the binary code but I have never seen included runtime sources, why? Just install the compiler!


1

There is no simple way, as they are separate compiled (assembly) sources. There is no common code generation stage that could easy produce a joined source. CL65 only acts as a unified command line interface. CC65's build process doesn't take any shortcut during code generation, compilation and linking but really handles everything as it should. Code ...


7

I recently posted a disassembly of the Apple II version, which is substantially similar to the C64 and BBC Micro implementations. One of the things I focused on was the way meshes were stored and rendered. For each "hull definition" there are three tables: Vertices: 9-bit X/Y/Z coordinates, 5-bit level-of-detail value, 1-4 faces Edges: two vertex indices, ...


4

Immediate mode constant allow the use of modifiers to select high/low byte of an address. From the Merlin manual: 6.4 Immediate Data For those opcodes such as LDA, CMP, etc., which accept immediate data (numbers as opposed to the contents of addresses) the immediate mode is signaled by preceding the expression with a "#". An example is LDX #...


6

In assembler, a label is just a number representing an address. On the 6502, addresses are 16 bits, but the accumulator can only contain 8 bits at a time. What you need is to extract the high and low halves of the address as distinct immediate operands, so that you can store them in the zero-page pointer location. I'm not familiar with this particular ...


2

Apparently, the correct syntax is as follows: START LDA #<DATA STA STRLO LDA #>DATA STA STRHI The #< and #> seem to indicate the the assembler that we are going for the LSB and MSB of the address for the DATA, not the DATA itself. I'll leave the question open in case someone wants to elucidate on the why/...


20

No, you can't substitute; the 6502A was used precisely because it is faster for some things, even when not run at a higher clock rate. Apple IIe Technical Note #2: Hardware Protocol for Doing DMA (starting on page 2 of that PDF) explains this. On page 4 of 9 of the note it says: In the Apple IIe a 6502A, a 2 MHz part is used instead of the 1 MHz 6502 ...


9

The most common way to do a general multiplication is the "shift and add" method, where for each bit set in the multiplier you add the multiplicand to the high portion of the result and then shift the result right. Thus, the lowest order bit of the multiplier, if set, contributes 1× the multiplicand to the result after the result has been fully shifted right,...


13

Multiplying (and dividing) by powers of 2 has always been trivial and fast even for 8-bit processors like Z80 or 6502, with shifting instructions (commonly arithmetic shift left aka ASL). But those processors didn't have a MUL instruction so when it came to non-power of 2 multiplication, it always involved shifting, testing bit and adding shifted result if ...


15

For Spectrum BASIC, the routine for Small Integers (16 bit) can be seen on page 179 of the Complete ZX Spectrum ROM Disassembly, where it loops over the sixteen bits of one operand, shifting them into the carry bit, adding successively doubling values to the result value each time the test passes, and testing for overflow if the result doesn't fit in a small ...


Top 50 recent answers are included