code:
;XA LOCAL
GRAB 300
LINK 800
REPL ODD
; FIX PLACEHOLDERS
MARK FIXLP
TEST EOF
TJMP FIND
TEST F < 9999
TJMP FIXLP
SEEK -1
COPY -10 F
JUMP FIXLP
MARK ODD
MAKE
@REP 12
COPY M F
@END
COPY 0 M
SEEK -1
MARK MAKELASTODD
SEEK -1
TEST F = -10
SEEK -1
FJMP MAKELASTODD
COPY -9 F
JUMP DIAL
MARK FIND
SEEK -1
TEST F = -10
ADDI X 1 X
SEEK -1
FJMP FIND
SEEK 9999
SUBI 0 X F
COPY 0 X
SEEK -9999
@REP 12
COPY F M
@END
MARK DIAL
VOID M
SEEK -9999
@REP 11
MODI F 10 #DIAL
@END
MULI #DIAL 11 T
FJMP RELEASE
SEEK -9999
MODE
@REP 11
MODI F 10 M
@END
MODE
;HANGUP
COPY -1 #DIAL
MARK RELEASE
COPY 0 M
SEEK F
MARK NEXTNUMBER
SEEK -1
TEST F < 0
SEEK -1
FJMP NEXTNUMBER
ADDI F 2 T
SEEK -1
SUBI T X T
FJMP ROLLOVER
COPY T F
TEST T = 1
TJMP ODDROLLOVER
COPY 0 X
JUMP DIAL
MARK ROLLOVER
COPY 1 X
COPY -10 F
SEEK -1
JUMP NEXTNUMBER
MARK ODDROLLOVER
COPY 1 X
SEEK -1
COPY -9 F
SEEK -1
JUMP NEXTNUMBER