Posted on Leave a comment

6502 processor IDE

Mos6502

This is a page about my freeware 6502 processor IDE program which is an editor / emulator / debugger / assembler / disassembler for the 6502 processor all in one portable Windows executable. I was never a big fan of the MOS 6502 processor, it was far to simple compared to the Z80 processor that I used. But the MOS 6502 processor was the biggest competitor of the Z80 in home computers in the 80ties and a lot of great computers used this processor. A few years ago I build my first Apple 1 clone and I got interested in the MOS 6502 again, this time I took some time to learn to program it. But as with so many old processors, it is hard to find the programming tools, there are some, but most of them cover only one configuration or are not portable and not suited for Windows. I had already written an Apple 1 emulator and had the emulator code. So I decided to add another IDE to the ones I had already written. (It get easier every time). In this IDE I support the Apple 1 computer, the Elector Junior (KIM 1) board and a simple 64K rom/ram machine with only LED outputs. Have fun. Regards, Hein Pragt.

I also have a Facebook Group on Retro Computing and Electronics, feel free to join!

6502 editor / assembler / emulator / debugger

Mc6502 Ide

To be able to program for the 6502 processor you need an assembler or compiler. I personally still like to write in assembler but I could no longer find tools for Windows 10. There were still some programs to download but most of them worked at DOS level, had serious bugs or did not fit my needs. After some searching I decided that it was time for a new project, building a complete integrated 6502 development environment. I found a pretty good assembler and the base code of my Z80 IDE and I had some old code in my code library. The result is 6502 workbench, a portable x64 Windows program that includes an editor, assembler, disassembler, emulator, single step debugger, Intel hex read / write function a VT100 terminal window, a seven segment display with 8 LEDs and keyboard support.

Installation

Download the zip file and unzip it at the place where you want to install it on your hard drive. Then create a shortcut to the program to the desktop and the program is ready for use. It is a so-called portable program which means that it does not use external sources or libraries and does not use the registry. After removing the directory from this program, it has also disappeared completely from your system.

First time use

To practice there are a few example files in the example directory, which you can load after which it will be in the shown in the middle edit window. Now you can convert this into machine code by means of the assemble button, this will appear on the left of the screen and be put into the virtual memory of the emulator. The last (or first) .org statement will also be put in the program counter and by simply pressing the run button you can execute the program and follow it on the screen. The speed will be just like the original processor, you can set the speed in the top of the screen. You can now stop running and modify the program, reassemble it and run it again. You can chose to see a realtime update of all registers (update checkbox) and you can set a breakpoint on code or memory access, a value of zero means its off. You can choose to stop at a breakpoint or start the realtime disassembler so you can trace your program. You can also set this trace on manually when you choose to single step trough the code. You can inspect the memory in the hex window. Default the 6521 PIA is emulated and the WozMon rom is loaded in Apple 1 mode. This terminal is a VT100 type. You can also select the Junior computer in which case the 6532 PIA is emulated and the Junior rom is loaded. Both rom files are external so you can modify them.

You can save the modified code as an asm file again but also save it as a hex file so that you can load the binary code in a circuit or ep(rom) for a real 6502 circuit. You can also read an Intel-Hex file, which will then be loaded into the internal emulator memory. You can also run this code when you put the correct start address in the program counter. You can also disassemble this internal emulator memory code after which the source code will appears in the edit screen in the middle. This can then be changed and written back into the emulator memory by means of assemble button.

I/O map

The 6502 has no I/O space so I implemented am MC6821 and a MC6532 PIA, in Apple 1 mode the 6821 PIA is used and mapped just like the Apple1, connecting the keyboard and the display with a VT100 terminal. In Junior mode the 6532 is emulated and the I/O mapping is just like the Junior computer (or KIM 1) with the seven segment displays and the keys mapped to the PC keyboard. You can also click the keys on the screen image. In simple mode the 8 leds are on memory address $d000 and the keyboard can be read using the same address.

Junior memory map

Junior Map

Version 1.04

I use the 6502_workbench myself and that is one of the way I find and fix bugs. I it now time to release the first version on my website so other can use it and I will continue to use improve the code. Suggestions and bugs reports are always welecome. I proudly present version 1.04 of the 6502 processor developer IDE.

Buy 6502 and 6502 related chips and hardware

I also have a webshop where I sell several 6502 types processors, boards and support chips.

https://www.heinpragt.nl/?s=6502&post_type=product

Download

Here you can download the latest version if this IDE. This download is a zip file containing a portable x64 (and a x32 version) Windows exe programs, an assembler directory and a examples directory.

https://www.heinpragt.nl/?product=6502-processor-ide

  • Version 1.04
    • Fixed some small bugs in the user interface
    • Fixed overflow bug in monitor.
  • Version 1.01
    • Initial release, it might be not completely bug free, I will test on, wait for remarks amd release the next version soon.

Documentation:

U use an external CA65 assembler, you can find documentaion on: https://cc65.github.io/doc/ca65.html

More pages on software development

[catlist name=”Software development”]

Posted on Leave a comment

Zelfbouw Apple 1 replica

Apple 1 replica

Dit is een leuk project dat ik enige tijd geleden heb gemaakt en het werkt supergoed. Het is een Apple 1 replica computer. Wanneer u naar het project kijkt lijkt het geen op zichzelf staand bord te zijn, maar eigenlijk is het dat wel. Het project maakt deel uit van de uitstekende RC2014 computer kit, maar dit is de RC6502 Apple 1 Replica. Het is een bord met een 6502 processor en een 6822 PIA net als de originele Apple1. Er is iets meer ram en rom dan in de originele Apple 1, maar de processor en omringende hardware zijn hetzelfde. Wel echt anders is dat het originele Apple 1-bord voor 80 procent uit video hardware bestond, op dit bord is dit vervangen door een enkel Arduino Nano-bord. Het bord kan worden aangesloten op een eenvoudige terminal of u kunt het aansluiten via de USB-poort van Arduino op een pc of laptop en een terminal emulator gebruiken. Wanneer u de Wozmon en Basic in de Rom programmeert heeft u een zeer complete Apple 1 computer replica. Het is goedkoop (rond de 50 euro) en een mooie manier om te zien hoe programmeren was in de vroege tijd van microcomputers. Met een beetje soldeer ervaring is dit een leuk projectje om te maken.

Apple 1 replica

Dit is een Duits bedrijf die de PCB kan leveren: https://www.pcb4diy.de/de/

Dit is het project op Github: https://github.com/tebl/RC6502-Apple-1-Replica De meeste onderdelen kunt u vinden in deze webshop.

Ik heb zelf ook een Apple1 emulator geschreven voor Windows en deze is gebaseerd op dit board. Wanneer u al vast voor voorproefje wilt kunt u deze hier downloaden: https://www.heinpragt-software.com/software_development/apple1_emulator.html

VT100 terminal

Om dit bord te gebruiken heeft u een soort terminal emulatie nodig, het is mogelijk om het bord met een TTL naar Serial USB kabel aan te sluiten op de computer en vervolgens Putty te gebruiken. Maar als U een standalone systeem wilt is het leuk om een echt VT100 (VGA) terminal board aan te sluiten. Ik bouwde mijn terminalboard uit een zelfbouw kit dat ik ook gebruik voor andere projecten, maar het project heeft ook een eigen terminalboard.

Lijst van onderdelen

ReferenceSilkscreenItemCountSocket (optional)
PCBSingle Board Computer rev H)1
U1CPU6502 CPU DIP-40, UM6502 or SY65021DIP40W
U2RAM62256 Static RAM DIP-281DIP28W
U3address decoding74LS138 DIP1DIP16N
U4ROM28C64 or 28C256 DIP-28, EEPROM1DIP28W
U5NAND gates74LS00 DIP1DIP14N
U7Hex inverter74LS04 DIP1DIP14N
U8like GPIOMC6821P PIA DIP-401DIP40W
U9Arduino I/O expanderMCP23S17 DIP-281DIP28N
X1system clock1.000Mhz TTL Oscillator, (DIP 14)1OSC-4W-fullsize
R1,R6-R8,R103k3 (3300) ohm resistor5
R21M ohm resistor1
R347k ohm resistor1
R41k ohm resistor1
R5330 ohm resistor1
R910k ohm resistor1
D1“POWER” light5mm LED diode, green or red color1
J1, JP1VP GND, OSC_ENSingle row, 2p straight header2
J8USB POWER (to SBC from Nano)Single row, 2p right angle connector1
J2Arduino Nano socket15p female pin headers2
J3(to backplane)Single row, 39p right angle connector1 (optional)
J4-J7(optional standoffs in each corner)Not needed, holes included with PCB4
J9J11, A13_WA14_WROM/RAM/PIA_EN, A13/A14Single row, 3p straight header5
C1-C9, C11100nF ceramic capacitor10
C1010uF 16V electrolytic capacitor1
C1210nF ceramic capacitor1
SW1RESETMomentary push button1
Jumpers for settings (CAP headers)up to 8 (depending on configuration)
Nano (J2)Arduino Nano v3.0 with USB cable1

Relevante links

Posted on Leave a comment

DIY Apple 1 replica board

Apple 1 replica

This a project I made some time ago and it works like a charm. It is an Apple 1 replica, when you look at the project it does not seem to be a standalone board, but actually it is.  The project is part of the excellent RC2014 computer kit, but this is the RC6502 Apple 1 Replica. It is a board with a 6502 processor and a 6822 PIA just like the original Apple1. There is a little more ram and rom than the original Apple 1 but the processor and surrounding hardware are the same. What’s different is that the original Apple 1 board was 80 percent video hardware, on this board this is replaced with a single Arduino Nano board. The board can be attached to a simple terminal or you can connect it with the USB port of Arduino to a PC or laptop and use a terminal emulator as input output. When you put the Wozmon and Basic in the Rom you have a very complete Apple 1 computer replica. It is low cost (around 50 euro) and a nice way to see what programming was like in the “old days”.

Apple 1 replica

This is company in Germany where you can order the PCB: https://www.pcb4diy.de/de/

You can find the project on Gethub: https://github.com/tebl/RC6502-Apple-1-Replica

You can find most of the parts in this webshop and sometimes I have a complet kit of the most important parts.

I have also written an Apple1 emulator for Windows and it is based on this board. If you already want a preview, you can download it here: https://www.heinpragt-software.com/software_development/apple1_emulator.html

VT100 terminal

To use this board you will need some kind of terminal emulation, it is possible to connect the board with a TTL to Serial USB cable to the computer and then use f.i. Putty but if you want a standalone system it is nice to connect a real VT100 (VGA) terminal board. I build my terminal board from a kit, but the project also has its own terminal board.

Relevant links