d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Make Me A Better Programmer - From Step 1
Prev153545556Next
Add Reply New Topic New Poll
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Mar 11 2015 08:27pm
Quote (Eep @ Mar 11 2015 08:10pm)
yeah but I don't want to spam the forum with new threads! you know there is just so much traffic here


We have been over this before. This isn't your thread. This is our thread now. Feel proud. You have authored PH's General
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Mar 11 2015 10:14pm
Quote (Minkomonster @ Mar 11 2015 09:27pm)
We have been over this before. This isn't your thread. This is our thread now. Feel proud. You have authored PH's General


true. I *almost* made a "programmers general chat" thread, but then I saw my thread on the page and was like "yeah.....fuck it"
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Mar 29 2015 08:00pm
so what has everyone else been up to


I've slowly been getting more responsibility at work

still mostly fixing bugs though
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Mar 29 2015 08:04pm
Depressed, hating my life, and now i have a cough. Must be sunday.
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Mar 29 2015 08:47pm
Quote (carteblanche @ Mar 29 2015 09:04pm)
Depressed, hating my life, and now i have a cough. Must be sunday.


well if you live in the midwest, this weeks weather is supposed to be nice!
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Mar 29 2015 08:52pm
Quote (Eep @ Mar 29 2015 10:47pm)
well if you live in the midwest, this weeks weather is supposed to be nice!


40-60F is nice, slight rain. something like seattle. sunny is terrible.
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Mar 29 2015 09:04pm
Quote (carteblanche @ Mar 29 2015 09:52pm)
40-60F is nice, slight rain. something like seattle. sunny is terrible.


I just like summer weather.

As someone who is a major weather geek, spring/summer are obviously top choice for storms.


One of these days I plan to go back and finish a degree in meteorology.
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Apr 7 2015 03:48pm
I'm thinking about writing a CPU emulator for like a 8080 or something.

Need to find some software or a old school game to emulate though.

Seems easy enough in theory to emulate old processors like the z80 or 8080. Just read the ROM into a buffer and iterate through the op codes and read/write to memory as the actual processor would then decrement the interrupt timers and advance the PC.

Might write it in assembler as to avoid the C overhead, although if I get into anything to complicated (sounds, output video, etc) then it would be a bit to much for me to handle in assembler. I'd just eat the overhead and try my best to hand optimize it. One think I would be a bit worried about is the overhead of function calls. Each function call pushes the base pointer, and moves the stack pointer to esp causing unneeded overhead for simple functions that don't require using the stack heavily (most cases it takes less time to cleanup the stack via moving the stack pointer back then creating a new stack frame via push %ebp, mov %esp, %ebp, and popping ebp off the stack at the end.) although it is more dangerous as you might accidentally overwrite data such as your EIP.

Things to ponder I guess. It wont matter much for say a 8080 which is a 2mhz mcu but it's better to get good habits formed at the base I guess.
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Apr 7 2015 05:25pm
Quote (AbDuCt @ Apr 7 2015 04:48pm)
I'm thinking about writing a CPU emulator for like a 8080 or something.

Need to find some software or a old school game to emulate though.

Seems easy enough in theory to emulate old processors like the z80 or 8080. Just read the ROM into a buffer and iterate through the op codes and read/write to memory as the actual processor would then decrement the interrupt timers and advance the PC.

Might write it in assembler as to avoid the C overhead, although if I get into anything to complicated (sounds, output video, etc) then it would be a bit to much for me to handle in assembler. I'd just eat the overhead and try my best to hand optimize it. One think I would be a bit worried about is the overhead of function calls. Each function call pushes the base pointer, and moves the stack pointer to esp causing unneeded overhead for simple functions that don't require using the stack heavily (most cases it takes less time to cleanup the stack via moving the stack pointer back then creating a new stack frame via push %ebp, mov %esp, %ebp, and popping ebp off the stack at the end.) although it is more dangerous as you might accidentally overwrite data such as your EIP.

Things to ponder I guess. It wont matter much for say a 8080 which is a 2mhz mcu but it's better to get good habits formed at the base I guess.


that sounds cool.

I heard a (brief) explanation about ASM.JS, and that sounded like the coolest shit ever.
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Apr 7 2015 09:31pm
Quote (Eep @ Apr 7 2015 07:25pm)
that sounds cool.

I heard a (brief) explanation about ASM.JS, and that sounded like the coolest shit ever.


Yea it does sound interesting. Once I find some software I am going to create a disassembler for it first then work on emulating the basic function calls it uses.

Most older processors are widely documented and come with online documents about specific instructions and how many cpu cycles they use so it will be pretty simple for the most part to emulate a large majority of it unitl I get into audio and video processing. Will most likely have to write separate emulators for those and some how make them interact with each other nicely.

Something like the base thread would over see the current ROM op codes being read as well as the interrupt timers and such, then based on what's currently happening it will have to delegate work to other threads emulating audio processing and video processing which will report back to the main thread, or something.

I haven't thought that far ahead yet.
Go Back To Programming & Development Topic List
Prev153545556Next
Add Reply New Topic New Poll