b3ta.com qotw
You are not logged in. Login or Signup
Home » Question of the Week » Amazing Projects » Post 1443992 | Search
This is a question Amazing Projects

We here at B3ta love it when a plan comes together. Tell us about incredible projects and stuff you've built by your own hand. Go on, gloat away.

Thanks to A Vagabond for the suggestion

(, Thu 17 Nov 2011, 13:12)
Pages: Popular, 5, 4, 3, 2, 1

« Go Back | See The Full Thread

Well, unless you're writing a JIT compiler
most CPU emulators end up in a big switch block at their core, even in C.

See what I mean?.

Although I did once write a 6502 emulator in 68k assembler that emulated an opcode, and then used a 65536 entry jump table so that I could pull the next opcode and 1 byte operand in one read instruction and jump directly to the code for the next operation (if the operation was 1 byte, I ignored the operand. For 2 byte operands it meant an extra read, but the trade off meant that it was really fast). 256kb was a large chunk to waste on a jump table, but, hey, Amiga 1200s came with 2Mb by then! :)
(, Wed 23 Nov 2011, 18:33, 2 replies)
That's
pretty much how it looked, only in VB syntax.

I look back on the things I used to be able to do when I was a supposed amateur at this stuff, and think "How the hell would I start that today?" - quite often the answer is "I wouldn't even know where to start".

I used CB radios to send programs to friends over the air (effectively creating a kind of wireless network). I wrote games in pure Z80 ASM for the fun of it etc...
(, Wed 23 Nov 2011, 18:37, closed)
I wrote an HC11 Microcontroller emulator for a project at uni.
In VB of all things and it was also pretty much one big switch statement.

I also wrote an assembler for it!
(, Wed 23 Nov 2011, 18:37, closed)

bugger me!

I wrote an in-line assembler plugin for VB6 (using the Win32 API 'copymemory' a LOT!). I wouldn't know where to start now.

It's funny you should mention microcontroller emus - I've recently been thinking of writing an Arduino emu for Linux to save me uploading code to it every time I want to check something out.
(, Wed 23 Nov 2011, 18:40, closed)
Ahhh yes.. assembler creation
in my previous job, years ago, we wrote software for an embedded board running on an HD64180 (a kind of super Z80).

We were using an old commercial DOS Z80 macro assembler from the early 80s, that kind of sort of worked OK under Windows XP, as long as you didn't sneeze.

It had really stupid problems, like cryptic error messages, and the number of imported symbols you could use depended on how many environment variables were defined in windows (!!).

Since it used its own wacky syntax, we couldn't easily port our code base to a different Z80 assembler, so I wrote my own syntax compatible Z80 macro assembler and linker from scratch in my spare time.

Happy days.
(, Wed 23 Nov 2011, 18:43, closed)
Ahhh
I long for the days when I was a *proper* programmer instead of the dot net crap I do now (although in fairness - Visual Studio is one slick IDE and C# is quite nice as it goes, it's just about the only thing I can stomach using Windows for these days).
(, Wed 23 Nov 2011, 18:44, closed)
I'm still in embedded software engineering
doing low level stuff for digibox (satellite, freeview, IPTV etc.) chipsets.

I much prefer embedded stuff.
(, Wed 23 Nov 2011, 18:47, closed)

« Go Back | See The Full Thread

Pages: Popular, 5, 4, 3, 2, 1