6:21 isn't the stack pointer only an 8 Bit register?
@iAmStinkieКүн бұрын
L cuz
@MonitorSmithКүн бұрын
Great :) I remember doing it as a Msc. comp-sci student - we were emulating the Motorola 6800 using C and assembler. Deep nerdery but fun and very satisfying being able to run stuff on the finished emulator.
@nicobzz16 күн бұрын
i guess it would be very more efficient if you used an array of pointer to function rather than case statement, because each time an instruction is run it requieres to check at average half of the case statements.
@iukhymova84578 күн бұрын
Thank you, good person 🙏
@bbrother9216 күн бұрын
Now make games for this emulator
@stevedickson474418 күн бұрын
We had a university assignment in 1984 to write an 8080 intel chip that could run machine code. We wrote it in VAX-Basic, because there were operators for bit-wise AND and bit-wise OR functions.
@stevedickson474418 күн бұрын
We had a university assignment in 1984 to write an 8080 intel chip that could run machine code. We wrote it in VAX-Basic, because there were operators for bit-wise AND and bit-wise OR functions.
@lukasjetu977621 күн бұрын
noob, i can emulate it in real life /j
@mrdarbab23 күн бұрын
This was my childhood. I learned machine code real quick. Even bought the big book.
@LeMonke323 күн бұрын
Your last name is poo
@ktreier24 күн бұрын
In 1985 (at age 21) I taught Civil Aviation Authority engineers machine code and assembly language programming and microprocessor architecture and digital system troubleshooting using a 6502 single board computer. Back then we thought it, then the 6809 and Z80 were amazing.
@MaddGameMakerАй бұрын
AT 41:25, your FetchWord() function is already handling endianness. You wouldn't need to swap the bytes; you already loaded the bytes and decoded them into a word in the correct byte order.
@joefuentes2977Ай бұрын
Better to do it with FPGA
@KameronMazudaАй бұрын
Definitely will go though the playlist! Hope to learn a lot!
@szilagyimiklos4757Ай бұрын
Wouldve been nice to use more descriptive variable names, this topic is convoluted enough as it is
@avatar22332 ай бұрын
What?
@elalemanpaisa2 ай бұрын
I thought I heard it had only 3 Registers? PC, Stackpointer and Flagregister are also Registers.
@kumar-jatin-2000Ай бұрын
A, X and Y are 3 general purpose registers.
@ArneChristianRosenfeldt19 күн бұрын
@@kumar-jatin-2000which is still weird because A can’t be used for addressing and XY cannot do logic.
@fire78782 ай бұрын
I am having a hard time to put the whole google test on my project, could you help me with what to do? I was following curiously on your first video and started learning a lot about cpu 6502 but then I got stuck upon starting this episode and i want to keep going but I cant...
@fire78782 ай бұрын
you just started this video with file of code but like i don't know how to follow along without doing so
@pramodkumarkar65732 ай бұрын
Very Nice!!!
@spicy_wizard2 ай бұрын
touch on memory ordering, CPU cache coherence and such
@Xenthera3 ай бұрын
Missed the *or will it? at 17:25 and spent more time than i'm proud of trying to debug why asserting the negative flag as false was failing lol edit: wrote that before finishing the video lol
@oglothenerd3 ай бұрын
Wouldn't it be smarter to execute the instructions before a HLT instruction is encountered? I am not familiar with 6502 ASM/ISA, but I bet it has a HLT instruction.
@oglothenerd3 ай бұрын
If you have a little-endian CPU, shouldn't the instructions also be stored in little-endian format?
@ArneChristianRosenfeldt19 күн бұрын
At least this is the case with 6502 and Intel CPUs . You mean immediates?
@oglothenerd18 күн бұрын
@ArneChristianRosenfeldt No, I meant the instructions themselves. Like, the opcode would come last in memory.
@ArneChristianRosenfeldt15 күн бұрын
@ oh no. Opcode comes first even on 68k . Endian is all about numbers. Little is good for adding. Big is good for routing based on IP address? Like a path to a file? DRAM memory addresses were Big Endian: first select Row and then byte within. Multiplexing.
@oglothenerd15 күн бұрын
@@ArneChristianRosenfeldt I see.
@oglothenerd3 ай бұрын
Thank you Mr. Poo!
@retardogames62844 ай бұрын
Can you teach how to integrate C# in C++?
@luchong114 ай бұрын
This is one of the greatest explanation videos I've ever watched. Concise, clear, and explores multiple real life problems/solutions. Thanks for sharing
@gato100mal64 ай бұрын
alr here is a new project, running a emulating a cpu inside a cpu inside a game running on my cpu on my computer
@oglothenerd4 ай бұрын
Thank you Mr. Poo!
@toutch20504 ай бұрын
I will use some things here in my project, thanks!
@aymaneeljahrani22805 ай бұрын
40:46 Why adding the | after shifting ? Gold mine thanks for sharing this !
@denisgorbunov43555 ай бұрын
This tutorials are treasure! Wish I could have watch all of these when I was at college
@ChandTv-sz6ht5 ай бұрын
just did this on python for CS50-Python project. Thank you!!!
@AndrewErwin735 ай бұрын
one way you might think about the processor status flags is as an 8 digit binary number. Since 0 through 65535 would each represent unique setting.. you could then just use the hex representation 0x0 - 0xFFFF, Then you can just use an integer to represent the flags. and write a function that encodes and decodes the state of the flags.
@Berrada-kh5 ай бұрын
Hello dave, How can I get to this level of expertise in C++ I'm currently studying network engineering, I want to become a c++ master like this, is tere some secret recipe ?
@davidschroeder32726 ай бұрын
Thank you! This was wonderful. I've been studying the weak interactions, and the CKM and PMNS rotation matrices play key roles in understanding how parity and CP violation are generated in the quark and lepton sectors, respectively. I really didn't exactly know what a rotation matrix was. I had a general idea, but this clarifies it completely, without the messy complications of trigonometry. I now see a clear pathway to being able to calculate the outputs of the aforementioned matrices from the actual numerical inputs. Just have to brush up on my trigonometry, which I took in school many decades ago.
@therealjjjay6 ай бұрын
what year of vs are you using?
@twilightaspect6 ай бұрын
I know this video was made 3 years ago but as a CS student going into their Senior year, I was wondering what topics would be good to learn when looking to emulate my first CPU. I took an organization & architecture class already but the implementation of a lot of the material feels foreign. Great video nonetheless!!!
@xsamuelx36036 ай бұрын
:)
@xsamuelx36036 ай бұрын
:)
@bcmf40416 ай бұрын
thank you very much for this course .l want to understand how proteus simulate 6502 cpu picture schematic runs a simple program like to turn on and off 2 leds attached to 2 of its pins
@ColinRichardson6 ай бұрын
13:13 I am glad you said this, because in my head I remember doing some simple assembly years ago, and remembered the the stack was backwards.. But, I just assumed I was wrong..
@oldlonecoder58436 ай бұрын
I am late. Jumping on the train and landed here . Why playing with cycles as a counter?? Why waste efficiency on useless meaning because the cycles are already calculated for each opcode and it is there to be used not as a decrement counter but in fact it is a value to be used in the call to "usleep(addrmod::cycles)" !! Having the real time delay between opcode executions in today's gigahertz CPU. The 6502/10 is exactly 1 mhz! And usleep(unsigned long cycles ) is also exactly cycles x 1/1 000 000 ! So we Can simply apply the above simple call to usleep...
@anhnhat356 ай бұрын
thanks
@ucngominh33546 ай бұрын
hi
@ColinRichardson6 ай бұрын
8:15 does that work nicely with memory management? I remember back back BACK when I was young, we used to do structs with was very careful with where we placed nibbles and bit flags, so that we kept them in chucks on 8 when definding the struct, so if we did `bit, byte, bit` it would take up 3 bytes in memory, but if we did `bit, bit, byte` it would only use 2 bytes. Does `Byte C : 1; Byte Z: 1; ` do the same niceity where it knows you are only using 1 bit of a whole byte, it can squeeze them all into the same byte?
@pinyok7 ай бұрын
I often return to this video, super solid demonstrations and explanations. Love it!
@arminiuscherusci44107 ай бұрын
Can somebody tell me what exactly constexpr does? I know it’s has something to do with the compile time, but that’s it
@ArneChristianRosenfeldt19 күн бұрын
I guess that it throws an error when you have variables in the expression.
@rohithbhandari78367 ай бұрын
I dont really understand why there is CPUcopy ?
@GeorgeGeorgievCA7 ай бұрын
You should probably include a note that 0xFFFC is not where the PC is set at reset but rather where the PC is loaded from. Of course, this would make you first implement "Load PC from memory" fuction, rather that LDA ;)
@ArneChristianRosenfeldt19 күн бұрын
Jump loads the PC from the PC . That other jump loads it from immediate. I don’t see this here.