Skip to content

Instantly share code, notes, and snippets.

@murachue
Created August 12, 2023 17:07
Show Gist options
  • Save murachue/c3bbdfe3aabb9fed922844a43fe59065 to your computer and use it in GitHub Desktop.
Save murachue/c3bbdfe3aabb9fed922844a43fe59065 to your computer and use it in GitHub Desktop.
PDP-7 light-pen cursor move test program
" light-pen cursor move test program
" $ doctorwkt/pdp7-unix/tools/as7 -f rim -o a.rim dpy.s
" $ open-simh/simh/BIN/.../pdp7
" sim> se g2out disa
" sim> se dpy ena
" sim> load a.rim 100
" sim> g 100
" press LMB (light-pen) around cursor and move slowly... fun!
idla=0700606
idve=0700501
idhe=0701001
idsi=0700601
idsp=0700701
idrs=0700504
idrd=0700614
idra=0700512
idrc=0700712
idcf=0700704
"modes
param=0000000
point=0020000
slave=0040000
chara=0060000
vectr=0100000
vecnt=0120000
incre=0140000
subrt=0160000
"param
lpena=0014000
lpdis=0010000
stopp=0002000
stopi=0003000
scal1=0000100
scal2=0000120
scal4=0000140
scal8=0000160
inte0=0000010
inte1=0000011
inte2=0000012
inte3=0000013
inte4=0000014
inte5=0000015
inte6=0000016
inte7=0000017
"point
phorz=0000000
pvert=0200000
pinte=0002000
"slave
"...
"chara: no special.
"vector
vesca=0400000
vinte=0200000
"increment
iesca=0400000
iinte=0200000
"i1...
"subroutine
sdepo=0200000
sjump=0400000
scall=0600000
..=0000100
entry:
lac x
tad px
dac vra
dac vla
dac vda
dac vua
lac y
tad py
dac vra+1
dac vla+1
dac vda+1
dac vua+1
idcf
law dpyops
idla
1:
idsp
jmp 2f
" open-simh V4.1-0 cf47a20f does not support idrc (yet), fall back to DAC based.
idra
dac idac
jms test
vr
x
1
jms test
vl
x
-1
jms test
vd
y
1
jms test
vu
y
-1
idrs
2:
idsi
jmp 1b
jmp entry
testbase: 0
testvar: 0
testdelta: 0
testcnt: 0
test: 0
lac i test
dac testbase
isz test
lac i test
dac testvar
isz test
lac i test
dac testdelta
isz test
lac testbase
add o4
cma
add idac
sma
jmp testend
lac idac
cma
add testbase
sma
jmp testend
dac testcnt
cla
1:
tad testdelta
isz testcnt
jmp 1b
tad i testvar
dac i testvar
testend:
jmp i test
o4: 4
x: 512
y: 512
dpyops:
lpena scal4 inte7 point
vra:
phorz 0000 point
pvert 0000 vectr
vr:
0000001 0000000
0000001 0000000 vinte
0000001 0000000 vinte
0000001 0000000 vinte vesca
point
vla:
phorz 0000 point
pvert 0000 vectr
vl:
0000201 0000000
0000201 0000000 vinte
0000201 0000000 vinte
0000201 0000000 vinte vesca
point
vda:
phorz 0000 point
pvert 0000 vectr
vd:
0000000 0000400
0000000 0000400 vinte
0000000 0000400 vinte
0000000 0000400 vinte vesca
point
vua:
phorz 0000 point
pvert 0000 vectr
vu:
0000000 0100400
0000000 0100400 vinte
0000000 0100400 vinte
0000000 0100400 vinte vesca
stopp param
px: phorz point
py: pvert vectr
idac: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment