BitTalk:30001473

Fra DDHFwiki
Spring til navigation Spring til søgning

Denne hulstrimmel ser ud til at indeholde dele af Data Generals Extended BASIC. Det som var grundlaget for COMAL.

Formatet er ASCII_EVEN med nuller foran og bagved, hvilket jeg formoder er fordi læseren har læst et stykke strimmel uden huller.

Hvis man stripper bit 7 (og nullerne) får man:

     .TITLE SBRTB
     .ENT SBRTB CLSRV
     .EXTD .FIX .FLOT
     .NREL


     ; SUBROUTINE COMMUNICATIONS TABLE

SBRTB:   1          ; S/R NUMBER FOR ADGE1
        .ADGE1
       130000     ; ONE EACH WAY
        2
        .DAC1
        120000     ; BOTH PARAM TO S/R
        3
        .DIGI1
        130000     ; ONE EACH WAY
        4
        .DIGO1
        120000     ; BOTH TO S/R
        5
        .CLST1
        100000
        6
        .CLOC1
        140000
        7
        .TAST
        140000
        10
        .DIG3
        100000
        -1
     ; READ A/D CHANNEL

.ADGE1: STA 3,.SV3   ; SAVE RETURN ADDRESS
        LDA 3,0,3    ; FETCH ADDRESS OF THE FIRST PARAM.
        LDA 0,0,3    ; HIGHER ORDER BITS
        LDA 1,1,3    ; LOWER ORDER BITS
        JSR @.FIX
        LDA 0,C8
        SUB 1,0
        DOA 0,ADCV   ; SET CHANNEL
        LDA 1,CHAN   ; LOAD OLD CHANNEL
        SUB# 0,1,SZR ; COMPARE
        JSR WAIT     ; WAIT, DIFFERENT CHANNEL
        NIOP ADCV    ; START CONVERSION
        STA 0,CHAN   ; STORE NEW CHANNEL
        SUB 0,0
        MOV 0,0
        MOV 0,0
        MOV 0,0
        DIA 1,ADCV   ; GET INPUT
        MOVZL 1,1,SZC
        COM 0,0
        JSR @.FLOT
        LDA 3,.SV3
        LDA 2,1,3    ; ADDRESS OF SECOND PARAMETER
        STA 0,0,2
        STA 1,1,2
        JMP 2,3      ; RETURN

C8:     10
.SV3:   0
.SP4:   0
CHAN:  0

WAIT:LDA 1,CONST
     INC 1,1,SZR
     JMP .-1
     JMP 0,3       ; RETURN
CONST:-20

   ; ANALOG OUTPUT

.DAC1: STA 3,.SV3  ; SAVE RETURN ADDRESS
       LDA 3,0,3   ; FETCH ADDRESS OF THE 1ST PARAM.
       LDA 0,0,3
       LDA 1,1,3
       JSR @.FIX
       LDA 0,C4000
       ADD 0,1
       COM 1,1
       DOA 1,23    ; OUTPUT X
       LDA 3,.SV3
       LDA 3,1,3   ; FETCH ADDRESS OF THE 2ND PARAM.
       LDA 0,0,3
       LDA 1,1,3
       JSR @.FIX
       LDA 0,C4000
       ADD 0,1
       COM 1,1
       DOB 1,23    ; OUTPUT Y
       LDA 3,.SV3
       JMP 2,3     ; RETURN
C4000:4000

       ; ROUTINE TO READ A DIGITAL INPUT BIT
.DIGI1: STA 3,.SV3
        LDA 3,0,3
        LDA 0,0,3  ; FETCH BIT NUMBER
        LDA 1,1,3
        JSR @.FIX
        INC 1,1
        NEG 1,1
        DIB 2,ADCV ; READ INPUT REGISTER
.LOO:   MOVL 2,2
        INC 1,1,SZR
        JMP .LOO
        MOVL 2,2
        SUBZL 1,1  ; AC1=1
        AND 2,1
        SUB 0,0
        JSR  @.FLOT
        LDA 3,.SV3
        LDA 2,1,3  ; FETCH ADDRESS OF THE 2ND PARAM
        STA 0,0,2  ; DATA OUT
        STA 1,1,2
        JMP 2,3    ; RETURN
         ; ROUTINE TO OUTPUT A BIT
  
.DIGO1: STA 3,.SV3
        LDA 3,0,3
        LDA 0,0,3 
        LDA 1,1,3  ; FETCH BIT NUMBER
        JSR @.FIX
        LDA 0,.SP7
        SUB 1,0
        NEG 0,0
        STA 0,.SP4 ; TEMPORARILY
        LDA 3,.SV3
        LDA 3,1,3  ; FETCH ADDRESS
        LDA 0,0,3
        LDA 1,1,3  ; FETCH BIT VALUE
        JSR @.FIX
        LDA 0,.SP4 ; AC0=-BIT NUMB. AC1=BIT VALUE
        SUBZL 2,2  ; AC2=1
.DLOO:  INC 0,0,SNR
        JMP .DIGD
        MOVL 2,2
        MOVL 1,1
        JMP .DLOO  ; SHIFT BOTH MASK + NEW BIT
 .DIGD: LDA 0,.SP6 ; GET PREVIOUS OUTPUT
        COM 2,2
        AND 2,0    ; TURN OFF CHANGED BIT
        ADD 1,0    ; OR IN NEW BIT
        STA 0,.SP6 ; KEEP LATEST OUTPUT
        DOB 0,ADCV
        LDA 3,.SV3
        JMP 2,3    ; RETURN

.SP6:   0
      ; INTERRUPT SERVICE
CLSRV: SKPDN RTC
        JMP @OTHER  ; SOME OTHER INTERRUPT
        NIOS RTC
        ISZ .CLK1
        JMP .EXIT
        ISZ .CLK0
        MOV 0,0     ; NO-OP
.EXIT:  INTEN
        JMP @0

OTHER:0
.CLS: CLSRV

      ; ROUTINE START CLOCK
.CLST1: STA 3,.SV3

        LDA 1,1     ; AC1 <= SYSTEM INTERUPT SERVICE
        LDA 0,.CLS  ; AC0 <= USER INTERRUPT SERVICE
        SUB# 0,1,SNR
        JMP CONT    ; SYSTEM ALREADY CHANGED
        INTDS       ; MAKE PATCH
        STA 0,1     ; LOC 1 <= USER INTERRUPT
        STA 1,OTHER ; USER LOC <= SYSTEM INTERRUPT
        INTEN

CONT:   SUB 0,0
        STA 0,.CLK0
        STA 0,.CLK1
        LDA 2,0,3   ; FETCH PARAM ADDRESS
        LDA 0,0,2
        LDA 1,1,2
        JSR @.FIX
        DOAS 1,RTC  ; START CLOCK
        LDA 3,.SV3
        JMP 1,3     ; RETURN
      ; ROUTINE GET TIME
.CLOC1: STA 3,.SV3
        LDA 0,.CLK0 ; GET HIGHER ORDER COUNT
        LDA 1,.CLK1
        JSR @.FLOT
        LDA 3,.SV3
        LDA 2,0,3   ; PARAMETER ADDRESS
        STA 0,0,2   ; TIME OUT
        STA 1,1,2
        JMP 1,3
.CLK0:  0
.CLK1:  0
.SP7 :  20
        ; GET SWITCHES
.TAST: STA 3,.SV3
       DIA 1,CPU
       SUB 0,0
       JSR @.FLOT
       LDA 3,.SV3
       LDA 2,0,3
       STA 0,0,2
       STA 1,1,2
       JMP 1,3      ; RETURN
       ; DIGITAL OUTPUT 2
.DIG3: STA 3,.SV30
       LDA 3,0,3
       LDA 0,0,3
       LDA 1,1,3
       JSR @.FIX
       COM 1,1
       DOB 1,ADCV
       LDA 3,.SV30
       JMP 1,3      ; RETURN
.SV30: 0
     .END


�