简单的 8085 计算机
Simple 8085 Computer

原始链接: https://www.hackster.io/mit41301/simple-8085-computer-9fe156

文本纪念英特尔8085微处理器和Tiny BASIC的50周年,提及Sojourner的8085。它提出一个仅用六块IC构建的最小8085计算机:80C85 CPU、8KB ROM、8KB RAM,加上简单逻辑。规格包括4.9152 MHz时钟、2400波特UART和一个8位输入/输出端口。动机包括学习8085的扩展指令集和编写自修改代码。Tiny BASIC可放入ROM,并能生成Mandelbrot集合。使用8080指令的汇编Mandelbrot程序耗时43.34秒,使用8085扩展ARHL/RDEL指令可降至40秒。一个自修改LED示例在进位置位时通过异或指令字节在RAL和RAR之间切换,改变旋转方向。资源包括硬件设计、物料清单、监视器、示例和A85汇编器。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 简单的8085计算机(hackster.io) 16分 由 AlexeyBrin 3小时前 | 隐藏 | 过去 | 收藏 | 1条评论 帮助 mrlonglong 39分钟前 [-] 想知道把它重新设计成使用Intel 8088或NEC克隆芯片会有多难? 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

The Sojourner rover was a vehicle that reached Mars on July 4, 1997 as part of the Mars Pathfinder mission. Sojourner was operational on Mars for 92 sols (95 Earth days), and was the first wheeled vehicle to operate on an astronomical object other than the Earth or Moon. The landing site was in the Ares Vallis channel in the Chryse Planitia region of the Oxia Palus quadrangle. Sojourner's central processing unit (CPU) was an Intel 80C85 with a 2 MHz clock, addressing 64 kilobytes (Kb) of memory, and running a cyclic executive.

Intel launched 8085 microprocessor on March 1976. By this year 2026, 8085 microprocessor completed 50 years. Palo Alto Tiny BASIC was also launched on the same year 1976. Tiny BASIC also completed 50 years.

We can combine 8085 along with Tiny BASIC to make a useful simple computer.

There are many open-source designs available for 8085 processor. Many designs use more components and difficult to procure the components and large board area which is difficult to build which result in more cost.

From hardware design perspective most of the design uses dedicated IC for serial communication. Similarly, most of the designs use Programmable Array Logic(PAL) device for address decoding and control signal generation.

Just using the processor along with 8kB ROM and 8kB RAM we can build a very simple yet powerful computer. In additon we need a octal latch and decoder logic IC. For I/O port we may need a tristate bidirectional driver.

So, just using six ICs we can build a simple computer. Out of six ICs, three of them are simple logic ICs.

SPECIFICATION:
  • CPU - 80C85 processor (8 bit)
  • ROM - 8kB (2764 or 2864 or FLASH)
  • RAM - 8kB (6264 or DS1225)
  • Clock - 4.9152 MHz
  • UART - 2400 baud serial
  • I/O Port - One Input and One Output (8 bit)

Reason to built this 8-bit computer in 2026 is because of the following three reasons

  • 50th Anniversary of 8085 and Tiny BASIC
  • Study of Extended Instruction Set of 8085
  • Write Self modifying program using 8085

Tiny BASIC:

Tiny BASIC is a very simple programming language which resides inside the system ROM and occupies few kilo bytes of memory. Since 8085 is the upgraded version of 8080 processor, the Tiny BASIC written for 8080 runs on 8085 as well.

Mondelbrot Set using Tiny BASIC:

We can easily generate Mondelbrot Set using Tiny BASIC. The following image shows the output

There is a another version of the code which just replaced the ASCII characters with Hexadecimal digits.

Both the programs took almost same time with hardly 10 seconds difference.

Extended Instruction Set of 8085:

There are some powerful instructions which are missing from official datasheet and documents. Those instructions works on the 8085 processor seamlessly.

Mandelbrot Set using 8085 assembly language:

The original assembly language code for generating Mandelbrot Set using 8080 instruction set was written with the help of ChapGPT. The execution time is 43.34 seconds.

Replacing 12 instructions with just ARHL and RDEL instructions of 8085 Extended Instructions, the execution time brought down to 40 seconds.

Almost all the parameters can be modified to suit user's requirement.

NOTE: Not all the assemblers supports the Extended Instruction Set of 8085. I have used the asmx 2.0 macro cross-assembler which supports the Exdended Instruction Set. We can enable by using CPU 8085U for Extended Instruction Set.

Self-modifying code (SMC or SMoC):

There are many instructions in 8085 which are having opposite effect by just fliping a single bit or few bits of instruction code.

Few examples are (RLC, RRC), (RAL, RAR), (STC, CMC), (RIM, SIM), (OUT, IN), POP, PUSH, INR, DCR,

One combination I tried was RAL and RAR.

  • RAL - 0x17 - 0001 0111
  • RAR - 0x1F - 0001 1111

Just changing D3 bit, the direction of the rotation changes. By sensing the Carry Flag, the Instruction changes from RAL to RAR by XOR ing with 0x08 (0000 1000)

CPU 8085
; TITLE "Self modifying LED program for MCS-85"

ORG 2000H ; RAM starts HERE
START LXI H, 4000h ; load HL pair with RAM end location
SPHL ; init Stack Pointer

INIT XRA A ; clear ACCumulator
STC ; set CARRY bit

AGAIN RAL ; rotate RAL or RAR
PUSH PSW ; store the ACC content in stack
CALL DELAY ; call time delay
POP PSW ; restore the ACC content back
OUT 61H ; send it to output port 61H
CC XOR8
JMP AGAIN ; do the shift again
XOR8 LDA AGAIN ; load the current rotate instruction
XRI 08H ; this will CHANGE the DIRECTION
STA AGAIN ; STORE THE MODIFIED INSTRUCTION
XRA A ; clear the ACC
STC ; set CARRY flag
RET ; return

; --- 16-bit Delay Routine ---
; Input: HL pair holds the 16-bit count (up to FFFFH)
DELAY:
LXI H, -1 ; [10 T-states] Load HL with 65,535
LOOP_16:
DCX H ; [6 T-states] Decrement HL pair
MOV A, L ; [4 T-states] Move Low byte to A
ORA H ; [4 T-states] OR with High byte (Sets Zero flag)
JNZ LOOP_16 ; [10/7 T-states] Jump if result not zero
RET ; [10 T-states]
END ; Added due to assembler error

The above program tested with the OUTPUT port with single LED "ON". The direction of LED changes every time the Carry Flag is set. At any time there will be only ONE instruction will be present in the program. Either RAL or RAR but not BOTH.

This may not be possible with modern processor or quantum computers!

There are many interesting Games and Programs along with more documents available from HERE. We can find the Hardware design file, BOM, Monitor program, Example programs from the above link.

To modify, edit or write assembly language code, you need to have the free A85 assembler.

联系我们 contact @ memedata.com