RCSNUSP/COBOL: Difference between revisions
m
Fixed syntax highlighting.
(Modularised code.) |
m (Fixed syntax highlighting.) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 8:
snusp.cob:
<
IDENTIFICATION DIVISION.
PROGRAM-ID. snusp-interpreter.
Line 327:
DISPLAY "The program will terminate."
.
END DECLARATIVES.
Line 333:
OPEN INPUT code-file
PERFORM VARYING line-idx FROM 1 BY 1 UNTIL end-of-code-file
ADD 1 TO num-lines▼
READ code-file INTO code-lines (line-idx)
NOT AT END
▲ ADD 1 TO num-lines
AT END
EXIT PERFORM
END-READ
Line 394:
"memory as a number."
.
END PROGRAM display-help.</
dd-code-area.cpy:
<
03 num-lines PIC 9(4) COMP.
03 code-lines OCCURS 1 TO 1024 TIMES
DEPENDING ON num-lines
INDEXED BY line-idx.
05 code-chars PIC X OCCURS 100 TIMES.</
dd-flag-constants.cpy:
<
01 Help-Flag-Char CONSTANT "h".
01 Read-Num-Flag-Char CONSTANT "r".
01 Write-Num-Flag-Char CONSTANT "w".</
dd-
<
03 code-file-path PIC X(100).
03 read-flag PIC X.
88 read-numbers VALUE "N".
03 write-flag PIC X.
88 write-numbers VALUE "N".</
|