All pastes #28996 Raw Edit

Unnamed

public text v1 · immutable
#28996 ·published 2005-11-17 07:16 UTC
rendered paste body
ASMB,A,B,L

      HED ** Small Light Chaser **
      ORG 10B

* by Tim Riker <Tim@Rikers.org>
* Not the smallest, but
* this version uses a subroutine and
* always leaves a light on

      CLB,CLE,INB  E=0, B=1

ROTL  JSB WBDEL,I    Call write and delay
      RBL,CLE      rotate B left 1, Clear E
      SSB,RSS      Skip if B high bit set
      JMP ROTL     Rotate another bit left
ROTR  JSB WBDEL,I    Call write and delay
      RBR,CLE      rotate B left 1, Clear E
      SLB,RSS      Skip if B low bit set
      JMP ROTR     Rotate another bit right
      JMP ROTL     Rotate to the left again

* try indirect goo
WBDEL OCT 000024
      HLT 77B

* Write B to S and delay
WBD2  NOP          return addr goes here
TEST  OTB 1        Write B to S
      LDA DELAY    Get delay in A
      CMA          2's complement A
LOOP  INA,SZA      Increment A, Skip one if =0
      JMP LOOP     Delay some more
      JMP WBDEL,I  Return (note E will be set)
DELAY OCT 017777   amount to delay