Skip to content

Instantly share code, notes, and snippets.

@nsmaciej
Last active August 29, 2015 14:10
Show Gist options
  • Save nsmaciej/2045eb59a9aee2e7310d to your computer and use it in GitHub Desktop.
Save nsmaciej/2045eb59a9aee2e7310d to your computer and use it in GitHub Desktop.
PDP-8 Simple program V1

Scrolling MQ

A simple program for PDP-8/e. It should work on other PDP-8s, but the Extended Arthmetic Element is required as it uses the MQ register. It creates a scrolling effect on the MQ (Multiplier Quotient) by left shfiting it, after a given time.

How to run

  • Set switches to 0000 and press LOAD ADDR
  • Toggle in the 2nd column of the below "binary", pressing DEP (Deposit) after each one
  • Set switches to 0002 and press LOAD ADDR
  • Set indication selector to MQ
  • Set switches to 7777, but do not press LOAD ADDR
  • Press CLEAR, followed by CONT

How to enter values

The "binary" file is in octal notation. Each number specifies the position of 3 consecutive switches, like so:

Number Switches
0 000
1 001
2 010
3 011
4 100
6 101
6 110
7 111

Remarks

The value of the SR (Switch Register) determines how long it takes for the MQ light to move. The smaller the value the less time it will take

CAC, 0 / Curent AC
NCAC, 0 / Negated current AC
CLA CLL IAC / Set AC = 1
MQL / MQ is now 1
LOOP, DCA CAC / Despoit but don't clear AC
TAD CAC
CMA IAC / Negate AC
DCA NCAC / Deposit before OSR
OSR / Get switches
TAD NCAC / SR - AC
CLA SNA SZL / Skip if AC != 0 and CLA
JMP FIN
TAD CAC / Put back AC
IAC / Next AC
JMP LOOP / Try again
FIN, CLL / If we are here L != 0 (but AC == 0.. so great)
MQL MQA / Swap MQ and AC
RAL / Left shift MQ
SZL / Skip if didn't overflow, L == 0
CLA CLL IAC / Reset MQ to 1
MQL MQA / Put back MQ, AC still 0
JMP LOOP
0000 0000
0001 0000
0002 7301
0003 7421
0004 3000
0005 1000
0006 7041
0007 3001
0010 7404
0011 1001
0012 7650
0013 5017
0014 1000
0015 7001
0016 5004
0017 7300
0020 7521
0021 7004
0022 7430
0023 7301
0024 7521
0025 5004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment