E8 PUSHJ $0,Log:E8 %%hide SUB floor,floor,1 %%hide %% &E8 &SUB &floor,floor,1 &\ul{\sl E8. Go down a floor.}\cr SR floorBit,floorBit,1 TRIP DelayI,61 Wait 61 units. OR $1,callcar,calldown AND $2,$1,floorBit Is callcar or calldown on? BNZ $2,1F CMP $2,floor,2 BZ $2,2F If not, is $\.{floor}=2$? AND $2,callup,floorBit If not is callup on this floor on? BZ $2,E8 If not, repeat step E8. 2H OR $1,$1,callup NEG $2,64,floor SL $1,$1,$2 BNZ $1,E8 Are there calls for lower floors? 1H TRIP DelayI,23 Deceleration takes 23 units. JMP E2 It is time to stop the elevator. %%off