Showing posts with label Motorola 68000. Show all posts
Showing posts with label Motorola 68000. Show all posts

Monday, October 23, 2023

The Motorola 68000: Introduction.

Another day, another step forward.The most important thing is not to stop. Anyway, it's better to think about something fun, so I am going to have an overall description of the Motorola 68000.

Then, I will dive in to the different aspects of the CPU. My emulator will start from a very small and simple virtual machine made of CPU, ROM and RAM.

I would like to start writing a small test virtual machine made of a basic 68k, and expand it little by little.

Can you describe the 68000?

The Motorola 68000 (shortened to 68k) is a 16/32-bit microprocessor that marked a revolution in micro processor design in the 1980s and beyond. Here's a detailed overview of its features and capabilities:

  • CISC: The 68k is a CISC (Complex Instruction Set Computing) processor, with a rich and varied instruction set that allows for complex operations, ideal for the operating systems of the time that were not optimized for RISC (Reduced Instruction Set Computing) processors.

  • 32-bit Architecture: Although it communicated externally on a 16-bit data bus, it was internally a 32-bit processor. This means it could utilize 32-bit operations and numbers, allowing for the computation of large amounts of data and much larger addresses, though the narrower data bus required more cycles to complete operations.

  • General-Purpose Registers: The 68k featured eight data registers (D0-D7) and seven address registers (A0-A6) for general-purpose operations, all 32-bit. The A7 register was used as the stack pointer.

  • Pipeline Fetch-Execute: It had a simple two-stage pipeline, one for fetching and one for executing the instruction. This was a relatively simple design, but it still allowed a degree of overlap between fetch and execute operations, improving overall performance.
  • Flat Addressing Space: The 68k could address up to 16 MB of memory in a flat address space, meaning that the program and data resided in the same address space (unlike segmented architectures like that used by the Intel 8086).

  • Support for Virtual Memory: Although the base 68000 did not have hardware support for virtual memory, later versions in the 68k series added this support, which was essential for modern operating systems.
  • High-Level Instructions: The instruction set included a variety of high-level operations, including mathematical operations, array management, and bit manipulation, as well as powerful flow control instructions.

  • Flexible Addressing Modes: The 68k supported several addressing modes, allowing programmers to access memory in various ways, thus optimizing memory and code usage.

The 68k handled a wide range of hardware interrupts and exceptions, supporting preemptive multitasking and improving system robustness, essential for operating systems like those used in Macintosh and Amiga computers.

Overall, the Motorola 68000 was known for its balance between power and flexibility. It was relatively easy to program, thanks to its high-level instruction set and its various addressing modes, making it popular among programmers of the time. It laid the groundwork for future generations of processors, influencing system and application design for decades.

What worries me is the development of the CISC tecnology for the instruction parser. It can turn into a nightmare because the emulation of the CPU must be fast.

Anyway, all these information will be useful for the implementation of the emulator, but I need some more information on the CPU.

Thursday, October 19, 2023

Taking advantage of everything that can help me.

The biggest advantage of having a partner like an AI assistant is that you can work whenever you want without being sent to hell. This is great because while you're working on one or more chats you can stop and continue at your convenience, like I'm doing right now.

 A new day is starting, I've done the exercises and now I'm resting on the sofa. What a great time to talk to "Jarvis" and move forward with my project. I'll have to come up with a code name. Anyone have suggestions?

However, let's move on, I have to get much more information on the Macintosh 128K and its architecture. 

Good morning, thanks for this initial information. Now let's proceed in order. I would like a more detailed description of the hardware divided into areas.

The answer is a bit long, so I will split it into more parts.

Of course, let's proceed with a more detailed description of the Macintosh 128k hardware, dividing the analysis into the various key components of the system:

1. CPU (Central Processing Unit):

Model: Motorola 68000

Clock frequency: 7.8336 MHz

The Motorola 68000 CPU was quite advanced for its time, capable of handling up to 16 megabytes of memory addressing (although the Macintosh 128k only used a fraction of that). It had a 32-bit data structure internally with 16- and 24-bit external data and address buses respectively.

excellent, this CPU handles 32bit data, it could be advantageous because the target architecture of the emulator is 32 bit. In the meantime, I'll start taking notes.

But let's try to delve deeper, I still need more information. So, at the end of the previous answer, I will make sure that ChatGPT will "keep in mind" the list of the components.

Ok, keep in mind this list which I will call "structure".

Absolutely, I will keep the "outline" as a reference for our future discussions and for any assistance or details you may need as you work on your emulation project. If you have specific questions or if there is a particular area you would like to focus on or explore further, please let me know and we can proceed accordingly.

ChatGPT will remember it for me, but of course I will collect the informationI need inside a document.

Now I can continue studying the CPU.

Saturday, October 14, 2023

A Macintosh replica to rise the bar.

Today is a new day. I have a new goal, something that will keep my mind busy, and this time I will try to use the help of artificial intelligence. Hopefully, I will be able to overcome some limitations and speed up the making of this project. But, what kind of project is this? You probably already saw a picture that suggests something. Have you seen a Macintosh old computer? Yes, you have! I have the ambitious goal to build my own Macintosh 128K replica.

I decided to build the first Macintosh because of several features that in some aspects can make my task easier, such as video emulation, since the graphic has only one bit per plane, it will require less memory and simpler hardware to generate the black and white video signal.

In the past I have dedicated myself to emulating 8-bit CPUs, so with this project, I will have the opportunity to work on a 16/32bit CPU, the Motorola 68000. If I have to keep my head busy the project must be a new adventure, after all, the beauty is not arriving but the journey.

I talked about building a replica, but what kind? Going back to the past, the replica of the Apple 1 that I made is very reminiscent of the legend handed down through stories and films about the birth of Apple.


The work was a lot of fun, and it was very demanding both physically and mentally, in fact, I made the wooden case of the computer and the monitor by hand without the use of CNC. To create the exterior I followed an old school approach and I must say that the result was fascinating. 



As regards the internal hardware I decided to follow a more flexible approach even if less faithful to the original. Instead of building a replica of the original PCB and using real chips, I decided to implement a software emulator that runs in an embedded system.

It might seem empty, but thanks to the flexibility of microcontrollers we have the possibility to embed almost all the hardware of a computer in only one chip. 


What about the Macintosh? I already have something in my mind. I will write an emulator for an STM32-powered embedded system for sure, but for the rest it will be a surprise and we will discover it together!