Browse Source

Initial commit

master
tinfoilcat 3 years ago
commit
f97e59ca7d
  1. 13
      README.md
  2. 20
      blink

13
README.md

@ -0,0 +1,13 @@
A collection of 1802 machine code programs
------------------------------------------
Just some raw machine code for the RCA 1802/COSMAC, ready to toggle in
or enter in some other way. Comments are added for clarity on every line.
Format:
-------
Address (hexadecimal)
Instruction (hexadecimal)
Mnemonic (as found in the 1802 manual and other places)
Comment

20
blink

@ -0,0 +1,20 @@
; blink (from the membership card manual by Lee Hart)
; 1802 machine code
; This program makes use of some basic building blocks like
; jumps, conditional jumps, decrements, and immediate loading.
; Memory address, command in hexadecimal, mnemonic, comment
0 F8 LDI Load immediate...
1 A2 162 ...the value 162
2 B2 PHI R2 Put it in the upper part of register 2
3 22 DEC R2 Decrement register 2 by one
4 92 GHI R2 Load the upper part of register 2
5 3A BNZ Branch if that is not zero...
6 03 3 ...to address 3
7 CD LSQ Long skip (skip two next) if Q=1
8 7B SEQ Set Q to 1
9 38 SKP Skip next
A 7A REQ Set Q to 0
B 30 BR Branch...
C 00 0 ...to address 0
Loading…
Cancel
Save