Emulating a CPU in C++ #21 (6502) - ADC Absolute

  Рет қаралды 4,354

Dave Poo

Dave Poo

Күн бұрын

In this video i implement tests for ADC (Add with Carry) to get just the absolute addressing mode working. The rest of the addressing modes are going to be dealt with in the next video. Also, i'm not dealing with decimal mode here, just binary addition.
Links:
Source for this project: github.com/davepoo/6502Emulator
Google Test: github.com/google/googletest
6502 Information: www.obelisk.me.uk/6502/
Timestamps
0:00 Intro
0:42 0 + 0 test
3:57 0 + 0 implemented
7:00 Refactoring the test
14:35 0 + 0 + carry test
15:17 Adding the carry
16:09 Testing unsigned overflow
18:27 Setting the carry flag
20:46 Testing negative result
23:45 Setting the negative flag
24:23 Testing -ve signed overflow
28:50 Setting the overflow flag
33:17 Testing +ve signed overflow
36:58 Basic addition tests
44:44 Closing comments

Пікірлер: 7
@jamesExiledLegends
@jamesExiledLegends 3 жыл бұрын
You can detect carry with carryInput being a 1 or 0 (a&b) | (a&carryInput) | (b&carryInput) that way you dont need bigger number
@DerykRobosson
@DerykRobosson 3 жыл бұрын
0:02 Typo in the test class name at the beginning of the video, "Registger" on line 4. 36:14 Update N comment value to be 1 on line 151.
@twobob
@twobob 3 жыл бұрын
Interesting edge cases
@M4RC90
@M4RC90 3 жыл бұрын
The title says Immediate but you've actually done Absolute here.
@DavePoo
@DavePoo 3 жыл бұрын
Thanks, fixed it.
@Handskemager
@Handskemager 2 жыл бұрын
Would a 16 or 32 bit cpu be more difficult or just more time consuming to make?
@DavePoo
@DavePoo 2 жыл бұрын
I think it's not the number of bits that make it more complex but the number of features the CPU has. A modern CPU has all sorts of crazy instructions and floating point as well. But if you look at something like the Motorola 68000, it's got many of the features of the 6502 except it has a lot more registers (and it can multiply and divide, how advanced!), so the opcode set is much larger and you would need a different approach to the giant switch statement that I used in this emulator.
Emulating a CPU in C++ #22 (6502) - ADC Addressing Modes
28:29
27c3: Reverse Engineering the MOS 6502 CPU (en)
51:57
Christiaan008
Рет қаралды 428 М.
白天使和小丑帮助黑天使。#天使 #超人不会飞 #超人夫妇
00:42
蜘蛛侠这操作也太坏了吧#蜘蛛侠#超人#超凡蜘蛛
00:47
超凡蜘蛛
Рет қаралды 40 МЛН
skibidi toilet 73 (part 2)
04:15
DaFuq!?Boom!
Рет қаралды 24 МЛН
Can you solve this Oxford admissions question?
8:18
MindYourDecisions
Рет қаралды 54 М.
Optimising Code - Computerphile
19:43
Computerphile
Рет қаралды 136 М.
Comparing C to machine language
10:02
Ben Eater
Рет қаралды 4,9 МЛН
lvalues and rvalues in C++
14:13
The Cherno
Рет қаралды 296 М.
Cross Site Request Forgery - Computerphile
9:20
Computerphile
Рет қаралды 751 М.
NES Emulator Part #2: The CPU (6502 Implementation)
1:07:12
javidx9
Рет қаралды 408 М.
A Introduction to Handles (in C++)
42:23
Dave Poo
Рет қаралды 10 М.