Skip to content

Create a serial port in the Vectrex address space #50

Description

@phillipeaton

A serial port connected to a terminal emulator on a PC is handy for debugging and allows interactive environments like Forth or BASIC to run.

I'd like a serial port to run something similar to my serial port handler that works on a VecFever (code below is in Forth):

HEX

\ VecFever UART serial port interface. VecFever provides buffering (256 bytes each way?)
7FFB EQU v4eTxStatReg \ Read, negative if transmit buffer is in use, positive otherwise
7FFB EQU v4eTxByteReg \ Write
7FFC EQU v4eRxStatReg \ Read, zero if no data received, otherwise != 0
7FFD EQU v4eRxByteReg \ Read, upon reading, 7FFC is automatically cleared
7FFE EQU v4eLEDReg \ LED Register, probably read/write?

CODE KEY? \ -- f return true if char waiting
6 # ( D) PSHS, CLRA, v4eRxStatReg LDB,
NE IF, -1 # LDB, THEN, NEXT ;C

CODE KEY \ -- c get char from serial port
6 # ( D) PSHS, BEGIN, v4eRxStatReg LDB, NE UNTIL,
v4eRxByteReg LDB, CLRA, NEXT ;C

CODE EMIT \ c -- output character to serial port
BEGIN, v4eTxStatReg LDA, MI UNTIL,
v4eTxByteReg STB, 6 # ( D) PULS, NEXT ;C

Describe alternatives you've considered
Other alternatives are available, but a VEXTREME is cheaper than the other alternatives and/or potentially provides a lot more functionally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions