252 questions
Advice
2 votes
1 replies
82 views
Definition of the DEFINE instruction used in the source for Microsoft BASIC
Does anyone know where I can find the definition of the DEFINE keyword/instruction used in the source code of the Microsoft BASIC interpreter released to the public by Microsoft here: https://github....
3 votes
2 answers
154 views
Why does code under a label execute even if I don't branch to it, for an if/else selecting two constants?
I'm learning Assembly through the "Easy 6502 by skilldrick" website. I have one question. I'm in the part about branching. I wrote the following code: LDA #$FA ADC #$01 BCS ...
0 votes
1 answer
90 views
NES MOS6502 Increment PC without reading
I was following nesdev.org/6502_cpu.txt to implement my own NES emulator. It should be able to do read and writes at the right cycle time for the instruction. After taking a look at all the other ...
3 votes
0 answers
114 views
C64 moving sprite issue
I'm writing a Chrome Dino demake on the c64 but the code won't work. Sprite 0 won't move and there are some garbage pixels on top of the screen. A demake is a video game remake that adapts a modern ...
2 votes
1 answer
70 views
Why is my 6502 program crashing when writing to $0200?
Every time I have a program that writes to $0200, the program crashes. I'm trying to write a byte to memory address $0200. I'm using a standard emulator (I've tried VICE for C64 and another generic ...
2 votes
2 answers
96 views
Do older 8 bit systems *try* and write to ROM? Or is emulation the issue?
So I'm working on a Vic20 emulator right now and am at a point where pretty much everything but sound is working; all single-step tests etc are passing. Yay. But I noticed something after adding some ...
7 votes
1 answer
174 views
6502 Emulator Correct Implementation of LSR Instruction
I'm working on an emulator for the MOS6502, but I have been unable to convince myself of the correct implementation of the LSR instruction. In the MOS Microcomputers Programming Manual on page 148 it ...
7 votes
1 answer
311 views
In 6502 assembly, can I test a bit in memory without modifying the accumulator?
In 6502 assembly, I need to set the value of the Z flag according to bit 2 of the value at address $8000. But I need to do so without overwriting the value in the A register. I've come up with this ...
2 votes
1 answer
114 views
NES 6502 assembly: CMP in NMI doesn't work
I have an NES program that does the following in an infinite loop: Checks the controller input of both controllers for the A button If the A button is pressed, it branches to a label that sets a RAM ...
0 votes
1 answer
202 views
Kick Assembler question, manipulating variable in loop
I'm trying to study mnemonics logic, and tried this simple test with C64 asm, made with VSCode and Kick Asm. Basically i'm trying to print from upper left corner sequence chars from 0 to 9 and then ...
2 votes
1 answer
374 views
What is the internal data bus?
I've started reading about the 6502. In this PDF here, what are the internal data bus and internal address bus used for? Are they used to move data between the internal CPU components? or move data ...
1 vote
1 answer
446 views
How do I make a timer in Assembly 6502?
I'm working on a game and it requires to have a 60 second countdown, but I don't know how to make it count down from 60 seconds since memory is updated so fast. Here is what i tried: .proc timer PHP ...
0 votes
1 answer
134 views
Need clarification on the dummy read in absolute X indexed
While messing around with an emulator, I came across the following note (see here): Note on the MOS 6502: The value at the specified address, ignoring the the addressing mode's X offset, is read (and ...
1 vote
4 answers
244 views
2-byte signed comparision
I'm working on comparing 2-byte signed integers and I feel like I'm on the right track, but I must be missing something. I've rewritten the same algorithm from scratch a few different times and all of ...
0 votes
1 answer
115 views
6502 JSR changes on stack required for RTS utility as "function call"
6502 JSR call pushes 2bytes onto the stack, which have to be on "top" of the stack for RTS. Is there a good practice for using JSR for organizing 6502 code into functions that solves the ...