/*
* idle()
*
* Sit and wait for something to happen ...
*/
/*
* If you have a console display it's amusing to see a slowly rotating
* sequence of lights in the display. If the system is very active the display
* will appear blurred.
*/
INT(LOCAL, rdisply, 037) / idle pattern
INT(LOCAL, wcount, 8) / rotate rdisply every wcount calls
INT(LOCAL, rotleft, 1) / initially rotate to the left
ENTRY(idle)
mov PS,-(sp) / save current SPL, indicate that no
mov $1,_noproc / process is running
dec wcount / if (--wcount <= 0) {
bgt update
mov $8,wcount / wcount = 8
tst rotleft / if (rotleft == 1) {
beq right
left:
rol rdisply / rdisply <<= 1
bpl update / if not shifted out, update
mov $0,rotleft / switch to rotating to the right
mov $16,wcount / do a slight pause before switching
br update / } else {
right:
ror rdisply / rdisply >>= 1
bit $1,rdisply / if not shifted fully right after the next loop, update
beq update /
mov $1,rotleft / switch to rotating to the left
mov $16,wcount / } do a slight pause before switching
update: / }
mov rdisply,r0 / wait displays contents of r0
SPLLOW / set SPL low so we can be interrupted
wait / wait for something to happen
mov (sp)+,PS / restore previous SPL
rts pc / and return
On Oct 8, 2019, at 11:20 AM, Chase Covello <cha...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/f5d1fe10-5e8b-4fd2-b862-3228003b29f7%40googlegroups.com.
rotleft`
/*
* idle()
*
* Sit and wait for something to happen ...
*/
/*
* If you have a console display it's amusing to see a slowly rotating
* sequence of lights in the display. If the system is very active the display
* will appear blurred.
*/
INT(LOCAL, rdisply, 037) / idle pattern
INT(LOCAL, wcount, 8) / rotate rdisply every wcount calls
INT(LOCAL, rotleft, 1) / initially rotate to the left
ENTRY(idle)
mov PS,-(sp) / save current SPL, indicate that no
mov $1,_noproc / process is running
dec wcount / if (--wcount <= 0) {
bgt update
mov $8,wcount / wcount = 8
tst rotleft / if (rotleft == 1) {
bmi right
left:
rol rdisply / rdisply <<= 1
bpl update / if not shifted out,
update
neg rotleft / switch to rotating to the right
mov $16,wcount / do a slight pause before switching
br update / } else {
right:
ror rdisply / rdisply >>= 1
bit $1,rdisply / if not shifted fully right after the next loop, update
beq update /
neg rotleft / switch to rotating to the left
mov $16,wcount / } do a slight pause before switching
update: / }
mov rdisply,r0 / wait displays contents of r0
SPLLOW / set SPL low so we can be interrupted
wait / wait for something to happen
mov (sp)+,PS / restore previous SPL
rts pc / and return