Skip to content

Instantly share code, notes, and snippets.

@vintagechips
Created July 22, 2018 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vintagechips/3a110934a7c592280c50a50ac89bd46c to your computer and use it in GitHub Desktop.
Save vintagechips/3a110934a7c592280c50a50ac89bd46c to your computer and use it in GitHub Desktop.
SBC6303+SBC-I/O 6821 port test program
* SBCIO21 - 6821 PORT TEST PROGRAM
* TARGET: LILBUG ON SBC6303
* ASSEMBLER: ARCPIT X6801.EXE
*
* 6821 RESISTERS
PORTA EQU $8050 A,PORT/DIRECTION
CRA EQU $8051 A,CONTROL
PORTB EQU $8052 B,PORT/DIRECTION
CRB EQU $8053 B,CONTROL
*
* LILBUG INTERNAL ROUTINE
DELAY EQU $F8D8 54MS DELAY
MAIN EQU $F952
*
* INITIALIZE
ORG $0080
CLR CRB SELECT DIRECTION
LDAA #$FF OUTPUT CODE
STAA PORTB SET OUTPUT
LDAA #$04 PORT CODE
STAA CRB SELECT PORT
*
* START
LDAA #10
LOOP1 COM PORTB REVERSE PORT
LDAB #10
LOOP2 JSR DELAY
DECB
BNE LOOP2
DECA
BNE LOOP1
JMP MAIN
*
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment