Git Product home page Git Product logo

chiposlo's Introduction

Compact Hexadecimal Interpretive Programming and Operating System with Logical Operators (CHIPOSLO)

This is a version of the monitor program and operating system CHIPOS for Michael J. Bauer's 1979 DREAM 6800 computer, with added support for four CHIP-8 instructions that appeared in other CHIP-8 interpreters.

It is designed to run from a 1K EPROM (like the 2708) mapped to memory addresses C000C3FF.

Replacing CHIPOS with CHIPOSLO will allow you to run more of the original CHIP-8 programs for the COSMAC VIP computer on your DREAM, or even more modern CHIP-8 programs written in the decades since.

If you don't own a DREAM 6800 computer, see my emulator project DRÖM or MAME.

Features

  • 1024 bytes, fits on a 2708 EPROM (like CHIPOS)
  • Adds four new logical/arithmetic instructions to your DREAM 6800's CHIP-8 interpreter
  • Lets you run more programs and games from the vast, historical CHIP-8 software library
  • Almost completely compatible* with CHIPOS!

Background

CHIPOS was a monitor program and operating system for the 1979 microcomputer DREAM 6800, written by Michael J. Bauer. It came with an interpreter for the CHIP-8 language, which was originally created by RCA's Joe Weisbecker for the COSMAC VIP computer in 1977.

Weisbecker's original CHIP-8 interpreter for the VIP supported four undocumented arithmetic/logic instructions:

  • 8XY3: VX = VX XOR VY
  • 8XY6: VX = VY >> 1
  • 8XY7: VX = VY - VX
  • 8XYE: VX = VY << 1

(You can read more about why these instructions worked in Laurence Scotford's disassembly of the VIP's CHIP-8 interpreter.)

These instructions were discovered around 1978 and detailed in the COSMAC VIP's newsletter, VIPER issue #2. Bauer was not aware of them, and the interpreter that came with his CHIPOS did not include them.

Most CHIP-8 interpreters since, including CHIP-48 and SUPER-CHIP from 1990/1991, support these extra instructions (although they often introduced other incompatibilities with the original VIP implementation). Now they're finally available on the DREAM as well!

Build instructions

Assemble using AS:

as -cpu 6800 CHIPOSLO.asm
p2bin -l 0 CHIPOSLO.p

The code is a modified version of the CHIPOS code available for download on Michael J. Bauer's DREAM 6800 website. Michael J. Bauer has graciously related to me in private correspondence that the code is in the public domain.

The commit history in this repository details the changes I've made (the initial commit contains the original CHIPOS code).

foo

Compatibility notes

All the software details in the CHIPOS software manual still apply, and the subroutines in the "CHIPOS SUBROUTINES (& Calling Sequences)" manual are still located at the same addresses, so any programs that call them should hopefully still work.

However, some of the scratchpad parameter addresses listed at the bottom of the latter manual have moved to compress some code. These are:

  • 00400045 are reserved as scratch (used to construct a temporary logic subroutine)
  • DDPAT has moved from 0008 to 0050 (in order to let 0A pull double duty as temporary VX storage and the opcode for CLV as a no-op)
  • RNDX has moved from 002C to 0047 (in order to let RNDX+1 pull double duty as the opcode for ASLA)

This might affect programs that do any of the following:

  • Use any memory in the range 0047 through 0055
  • Initializes RNDX as optional input to the RANDOM subroutine at C132
  • Call LETDSP and expect the resulting hex digit to be output at 0008 rather than 0047

I am not aware of any affected programs, but if you know of any, please create an issue. I want CHIPOSLO to be as compatible as possible.

chiposlo's People

Contributors

tobiasvl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tonypdmtr

chiposlo's Issues

Opcode Ex9E not working as expected

First of all: Thank you for your work on an improved CHIPOS version!

While testing it agains my DREAM6800 emulation, I came across an issue that is resulting from the modifications:

The Ex9E opcode is not working in the current CHIPOSLO version. The Problem originates in the reorganization of the skip opcode handling.

The relevant code:

SKFKEY: JSR     KEYINP      ; INTERROGATE KEYBOARD  <--- This sets the key in KEYCOD and A, A not same as PIR+1 anymore!!!
        TST     BADRED      ; KEY DOWN?
        BEQ     SKFK1
        LDAB    #$A1        ; WHAT INSTRN?
        CMPB    PIR+1       ; SKF VX#KEY   <--- This still works as it doesn't rely on A being content of PIR+1
        BEQ     SKIP2
        RTS                 ; NO KEY GO FETCH
SKFK1:  CMPA    #$9E.       ;  <--- But this now compares the pressed key against $9E, not the second opcode byte
        BEQ     SKFEQ
SKFNE:  CMPA    VX
        BNE     SKIP2
        RTS
LETVK:  ADDA    VX
        BRA     PUTVX
RANDV:  BSR     RANDOM      ; GET RANDOM BYTE
        ANDA    PIR+1
        BRA     PUTVX

The original code in comparison does explicitly use PIR+1:

SKFK1:  LDAB  	#$9E
        CMPB  	PIR+1       ; WHAT INSTRN?
        BEQ     SKFEQ
        BRA     SKFNE

I might try to fix it myself and would put out a PR if I do, but I'm not sure if and when I would manage to do so.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.