.TITLE DUMP octal dump .IDENT /03.02/ .MCALL .CSIGEN,.READW,.PRINT,.CLOSE,.EXIT ; ; DUMP prints the contents of a file as a sequenze of octal ASCII numbers ; each block of the file is output as follows, beginning with block 0: ; BLOCK blkno ; 000000: word00 word01 word02 word03 word04 word05 word06 word06 ; 000020: word10 word11 word12 word13 word14 word15 word16 word17 ; . ; . ; . ; 000760: wrd370 wrd371 wrd372 wrd373 wrd374 wrd375 wrd376 wrd377 ; ; 10-JUL-2004 H. Rosenfeld ; .ENABL REG .GLOBL OCTAL .CSECT START: .CSIGEN #DHANDL,#DEFEXT BCC READ .PRINT #CSIERR .EXIT READ: .READW #IOBLK,#3,#BUFFER,#400,BLKNO BCC BLOCK .CLOSE #0 .EXIT BLOCK: MOV BLKNO,R0 MOV #BLKSTR+6,R1 JSR PC,OCTAL .PRINT #BLKSTR CLR R2 LINE: MOV R2,R0 MOV #LINBUF,R1 JSR PC,OCTAL ADD #6,R1 MOVB #72,(R1)+ MOVB #40,(R1)+ WORD: MOV BUFFER(R2),R0 JSR PC,OCTAL ADD #6,R1 MOVB #40,(R1)+ INC R2 INC R2 MOV R2,R0 BIC #177760,R0 BNE WORD CLRB (R1) .PRINT #LINBUF MOV R2,R0 BIC #177000,R0 BNE LINE INC BLKNO BR READ .PSECT DATA DEFEXT: .RAD50 /SAV/ .RAD50 /TXTTXTTXT/ CSIERR: .ASCIZ /COULD NOT OPEN FILE/ BLKSTR: .ASCII /BLOCK / .BLKW 4 LINBUF: .BLKW 42 BUFFER: .BLKW 400 BLKNO: .BLKW 1 IOBLK: .BLKW 10 DHANDL: .END START