WH BNPF dump of TIM

BNPF notation (Begin-Negative-Positive-Finish) is an old ASCII-based text file format created by Intel to specify memory contents and program PROMs and EPROMs.

BNPF (Begin-Negative-Positive-Finish), also written as BPNF (Begin-Positive-Negative-Finish).
In BNPF encoding, a single byte (8 bits) would be represented by a highly redundant character framing sequence starting with a single uppercase ASCII “B”, eight ASCII characters where a “0” would be represented by a “N” and a “1” would be represented by a “P”, followed by an ending ASCII “F”. These ten-character ASCII sequences were separated by one or more whitespace characters, therefore using at least eleven ASCII characters for each byte stored (9% efficiency). The ASCII “N” and “P” characters differed in four bit positions, providing excellent protection from single punch errors.

Structure of BNPF Format
Brackets: Every data word field begins with the letter B (Begin) and ends with F (Finish/Final).
Bit Values: Characters between B and F represent data bits using P (Positive) for high/1 or N (Negative) for low/0, ordered from most to least significant.
Don’t Care: An X character can be used inside the sequence to represent a wildcard or “don’t care” bit.
Repetition: The syntax B*NF allows a number N to repeat the previous word field multiple times.
Comments: Any text or comments outside of the B…F blocks (provided they do not contain the letters B or F) are ignored by the programmer

85 = 10000101 
    BPNNNNPNPF 

Example of BNPF output

.WB 7000 7100
7000 BPNNNNPNPF BPPPPPNNPF BPNPNPNNPF BNNPNNNPPF
     ^^^^^^^^^^
.WH 7000 7100
;18700085F9A923D055A9168D036EA208BDF7739DF7FFCAD0F786EA0F19
       ^^
0478   7238 4C 86 70    BCCST  JMP START
0479   723B             ;
0480   723B             ;
0481   723B E6 FD       WB     INC SAVX          ; SAVX TO = NCMDS FOR ASCII SUB/R
0482   723D A5 E4       WB1    LDA WRAP          ;IF ADDR HAS WRAPPED AROUND
0483   723F D0 F7              BNE BCCST         ;THEN TERMINATE WRITE OPERATION
0484   7241             ;
0485   7241 A9 04              LDA #4
0486   7243 85 EC              STA ACMD
0487   7245 20 8A 72           JSR CRLF
0488   7248 20 9A 72           JSR WROA          ; OUTPUT HEX ADR
0489   724B             ;
0490   724B 20 77 73    WBNPF  JSR SPACE
0491   724E A2 09              LDX #9
0492   7250 86 FE              STX TMPC          ; LOOP CNT =9
0493   7252 A1 E5              LDA (TMP0-9,X)
0494   7254 85 FF              STA TMPC2         ; BYTE TO TMPC2
0495   7256 A9 42              LDA #'B'
0496   7258 D0 08              BNE WBF2          ; WRITE @
0497   725A             ;
0498   725A A9 50       WBF1   LDA #'P'
0499   725C 06 FF              ASL TMPC2
0500   725E B0 02              BCS WBF2
0501   7260 A9 4E              LDA #'N'
0502   7262             ;
0503   7262 20 C6 72    WBF2   JSR WROC          ; WRITE N OR P
0504   7265 C6 FE              DEC TMPC
0505   7267 D0 F1              BNE WBF1          ; LOOP
0506   7269 A9 46              LDA #'F'
0507   726B 20 C6 72           JSR WROC          ; WRITE F
0508   726E             ;
0509   726E 20 97 73           JSR INCTMP
0510   7271             ;
0511   7271 C6 EC              DEC ACMD          ; TEST FOR MULTIPLE OF FOUR
0512   7273 D0 D6              BNE WBNPF
0513   7275             ;
0514   7275 20 C1 70           JSR DCMP
0515   7278 B0 C3              BCS WB1           ; LOOP WHILE EA GT OR = SA
0516   727A 90 BC              BCC BCCST

0262   70C1 38          DCMP   SEC               ; TMP2-TMP0 DOUBLE SUBTRACT
0263   70C2 A5 F0              LDA TMP2
0264   70C4 E5 EE              SBC TMP0
0265   70C6 85 E5              STA DIFF
0266   70C8 A5 F1              LDA TMP2+1
0267   70CA E5 EF              SBC TMP0+1
0268   70CC A8                 TAY               ; RETURN HIGH ORDER PART IN Y
0269   70CD 05 E5              ORA DIFF          ; OR LO FOR EQU TEST
0270   70CF 60                 RTS