Nybbles 尼布尔斯

作者: 安迪·赫茨菲尔德 日期: 1981年2月 人物: 安迪·赫茨菲尔德、史蒂夫·沃兹尼亚克、伯勒尔·史密斯、布莱恩·霍华德 主题: 硬件设计、原型、软件设计、早期程序、技术 概括: 关于苹果第一代Macintosh的开发以及制造它的人的轶事: 我在 Macintosh 项目上的第一份工作

My first job on the Mac project was to help two other people, Burrell and Brian, make sure the special part that controls the hard drive was working correctly. They had just connected the disk controller to the Mac prototype, but they didn’t know if it was working without writing a complex program to test it.

我在 Mac 项目上的第一份工作是帮助另外两个人 Burrell 和 Brian 确保控制硬盘驱动器的特殊部分正常工作。
他们刚刚将磁盘控制器连接到 Mac 原型机,但如果不编写复杂的程序来测试它,他们不知道它是否正常工作。

When I got there, two people were trying to fix a small piece of computer code that they had written together. They had made a simple loop to talk to a disk drive and were using a special tool to watch the code work. But these two people weren’t very good at writing code, so when I got there, I was able to help them right away. Even though I had never written code for this type of computer before.

当我到达那里时,两个人正在尝试修复他们一起编写的一小段计算机代码。他们制作了一个简单的循环来与磁盘驱动器通信,并使用一种特殊的工具来观察代码的工作情况。
但是这两个人不太擅长写代码,所以当我到达那里时,我能够立即帮助他们。尽管我以前从未为这种类型的计算机编写过代码。

Steve Wozniak created a special piece of hardware called the disk controller for the Apple II computer. It was his best work. Woz’s controller card has five chips and is faster and cheaper than similar cards that cost four times as much. Woz did something different with his controller. He made the computer do most of the work instead of the hardware. This allowed Woz to make the controller better and faster than usual methods.

Steve Wozniak 为 Apple II 计算机创建了一种称为磁盘控制器的特殊硬件。这是他最好的作品。
Woz 的控制器卡有五个芯片,比价格四倍的类似卡更快、更便宜。
沃兹用他的控制器做了一些不同的事情。他让计算机代替硬件完成大部分工作。
这使得 Woz 能够比通常的方法更好更快地制作控制器。

A long time ago, most floppy disks used a special way to record information called FM encoding. This method made sure the data was not lost by adding an extra bit to each piece of information. But Steve Wozniak thought this was too complicated and wanted to get more data on the disk. So, he came up with a new way to record information, which he called “nybblizing”. This way, instead of getting four pieces of information from every eight transitions, he was able to get five. Later, Steve figured out an even better way to record information. He used a way that allowed him to store six pieces of information from every eight transitions. This made the disk even more efficient and allowed more storage space. The new way was later called the “16 sector” format, while the older way was called the “13 sector” format.

很久以前,大多数软盘都使用一种称为FM编码的特殊方式来记录信息。这种方法通过向每条信息添加额外的位来确保数据不会丢失。
但 Steve Wozniak 认为这太复杂了,想要在磁盘上获取更多数据。于是,他想出了一种记录信息的新方法,他称之为“nybblizing”。这样,他就不再是每八次转变就得到四条信息,而是得到了五条。
后来,史蒂夫想出了一种更好的记录信息的方法。他使用了一种方法,可以让他每八次转变存储六条信息。这使得磁盘更加高效并提供更多的存储空间。新方式后来被称为“16扇区”格式,而旧方式被称为“13扇区”格式。

The computer stored 8 small pieces of data, called transitions, at a time on the disk controller’s special memory. Each of these transitions took 4 millionths of a second, so each small piece of data needed to be given to the computer every 32 millionths of a second. Woz eventually found a way to understand the data while getting the small pieces, so the computer could work as fast as possible. However, Woz couldn’t figure out how to arrange the data in the correct order when it was written onto the disk, because the computer’s processor wasn’t fast enough and the timing had to be very precise.

计算机在磁盘控制器的特殊内存中一次存储 8 个小数据块(称为转换)。
每个转换都需要百万分之 4 秒,因此每小块数据需要每百万分之 32 秒传送给计算机。
沃兹最终找到了一种在获取小数据的同时理解数据的方法,这样计算机就可以尽可能快地运行。
然而,沃兹无法弄清楚当数据写入磁盘时如何以正确的顺序排列数据,因为计算机的处理器速度不够快,而且计时必须非常精确。

The microprocessor in the Macintosh was much faster than the one in the Apple II. For example, if you were working with 32-bit values, it was about 10 times faster. This made it easy to write a program that copied files from one disk to another, without having to work too hard. I enjoyed being able to achieve great results without getting frustrated. But first, I had to solve a big problem.

Macintosh 中的微处理器比 Apple II 中的微处理器快得多。例如,如果您使用 32 位值,则速度大约快 10 倍。这使得编写一个将文件从一个磁盘复制到另一个磁盘的程序变得很容易,而无需费力工作。
我很高兴能够取得伟大的成果而不感到沮丧。但首先,我必须解决一个大问题。

Woz’s computer needed special instructions that changed every 32 millionths of a second. If we did this even one millionth of a second too early or late, it would cause a problem and make the data bad. To write code for the Macintosh, I needed to know how fast it performed each instruction. The manual gave me a number of clock beats for each instruction, but I wasn’t sure how long it took for the computer to get the instructions from memory. So, I asked Burrell for the information, and I was surprised by his answer.

沃兹的计算机需要每百万分之三千二秒改变一次的特殊指令。如果我们太早或太晚地这样做,即使是百万分之一秒,也会导致问题并使数据变差。
要为 Macintosh 编写代码,我需要知道它执行每条指令的速度有多快。手册为我提供了每条指令的时钟节拍数,但我不确定计算机从内存中获取指令需要多长时间。
因此,我向伯勒尔询问了相关信息,他的回答让我感到惊讶。

“I’m not sure. The Mac computer, just like the Apple II, does things one step at a time, so the same instruction always takes the same amount of time. This makes it easier to write programs that work with the disk. I don’t know how fast it is, so let’s use a special tool to measure it. Why don’t you write a program that interacts with the disk and we’ll use the tool to check how it works?”

“我不确定。Mac 计算机就像 Apple II 一样,一次执行一步,因此相同的指令总是花费相同的时间。这使得编写与磁盘配合使用的程序变得更加容易。我不知道它有多快,所以让我们使用一个特殊的工具来测量它,为什么不编写一个与磁盘交互的程序,我们将使用该工具来检查它是如何工作的?”

I spent two days writing some basic instructions for a computer. Then, I sat down with two other people, Burrell and Brian, to watch these instructions being executed. We used a special tool to see how long each instruction took. Most of the time, the instructions worked as we expected. But sometimes, they didn’t work as planned, and I had to make some changes. After fixing some issues, I was able to finish the instructions for reading and writing to the disk. These instructions can do the job of encoding and decoding data at the same time, which is what Steve Wozniak had been trying to achieve for a long time.

我花了两天时间写了一些计算机的基本指令。然后,我和另外两个人伯勒尔和布莱恩坐在一起,观看这些指令的执行。我们使用一种特殊的工具来查看每条指令需要多长时间。
大多数时候,这些说明都按照我们的预期工作。但有时,它们并没有按计划进行,我不得不做出一些改变。
修复了一些问题后,我能够完成读取和写入磁盘的说明。这些指令可以同时完成数据编码和解码的工作,这也是史蒂夫·沃兹尼亚克长期以来一直试图实现的目标。

I was hoping to feel very happy when I finished making the disk work, but it didn’t feel that special because I couldn’t see it working. Last year, Woz wrote some code that helped read data from the disk much faster. I used this code to make some slideshow disks for the Apple II. These disks could show a new image on the screen in less than a second, which was much faster than before. I thought it would be fun to use the new disk code to play the slideshow disks on my Mac.

当我完成磁盘工作时,我希望感到非常高兴,但感觉并没有那么特别,因为我看不到它工作。
去年,Woz 编写了一些代码,帮助更快地从磁盘读取数据。我使用这段代码为 Apple II 制作了一些幻灯片磁盘。这些磁盘可以在不到一秒的时间内在屏幕上显示新图像,这比以前快得多。
我认为使用新的磁盘代码在我的 Mac 上播放幻灯片磁盘会很有趣。

It was almost 7pm and all my friends were going out to eat. I had an invitation to join them, but I was really close to making a special slideshow work on my computer. I didn’t want to stop until it was done. I was alone in the office when I finally made it work. My computer, a Mac, could read and show pictures from an old Apple II disc really fast. It was the most amazing thing a Mac could do at that time. I had fun showing it to my friends when they came back from dinner.

那时已经是晚上七点多了,我的朋友们都出去吃饭了。我收到了加入他们的邀请,但我真的很接近在我的电脑上制作一个特殊的幻灯片。在完成之前我不想停下来。
当我终于成功时,办公室里只有我一个人。我的电脑 Mac 可以非常快速地读取和显示旧 Apple II 光盘上的图片。
这是当时 Mac 能做的最令人惊奇的事情。当我的朋友们吃完晚饭回来时,我很高兴把它展示给他们看。
目录