- 27,71, 27,72. : . , , . IBM 27,45,1, 27,45,0. , , (ASCII 95) , (ASCII 32) . , . - . : . - 27,83,0, - 27,83,1. . , , 27,84. - . 4 , - . . 1 2 3 4 5 6 6.2.7 IBM. - IBM. ( IBM), . , - . , " " (Options and Adapters) , . : 10 11 12 13 27,52 27,56 27,57 . 27,66 - 27,66 - 27,88 27,79 : 8 9 27,60 27,62 - 27,68 . - 27,68 . - 27,77 27,80 ./. . 27,82 . - 27,85 ./. . 27,88 / 27,100 27,101 : 27,48 1/8 27,48 1/9 27,48 7/72 27,49 7/72 27,49 9/96 27,49 6/72 27,49 1/9 27,50 - 27,65 27,50 1/6 27,51 (n/216) 27,51 (n/144) 27,53 ./. . - 27,65 (n/72) 27,67 27,74 (n/216) 27,74 (n/144) 27,93 27,104 - 27,105 - : 11 15 14 15 18 18 10 20 . 27,45 ./. 27,58 12 27,69 27,70 27,71 2 27,72 2 27,83 27,84 27,87 ./. 27,91 . 27,95 ./. overscore : 27,54 2 27,55 1 27,61 27,73 27,92 27,94 27,97 27,98 4- 27,99 3- 27,109 2- 27,121 1- : 27,75 480 27,75 560 27,75 1108 27,76 960 27,76 2216 27,89 960 27,89 2216 27,90 1920 27,90 4432 27,91 / 27,110 - : 7 20 . 17 19 24 27,81  3. . , - , . , . , , , . , , ( , , ). , - . , , . - , . ( ). , , . . , . - , , - , , . , . , - . 6.3.1 . , . , - , "". , - , . , 1 . - , , . / . , . - , , - . . LPRINT PRINT#. LPRINT , PRINT# , OPEN "LPT1" AS #1 OPEN "LPT3" AS #2. LPRINT LPT1, PRINT# . / LPRINT PRINT#, . . , , , . - , , . - , , 80- ( ). , . - . 80 , . , , . , , WIDTH "LPT1",n - n . , , , / . , , , , , , / . - . , , 255, WIDTH "LPT1",255. , - / 80 . , . LPRINT - . - , LPRINT "The rain in Spain", , X$ = "The rain in Spain": LPRINT X$. CHR$. - , , LPRINT CHR$(10) . CHR$ - ASCII, - . - . , , ; , - . , - LPRINT , PRINT . : 100 LPRINT S$;" and ";Y$ ' 110 LPRINT X, Y, Z ' 120 LPRINT "The total is "; X ' 130 LPRINT "The ";CHR$(27);CHR$(45);CHR$(1);"real"; CHR$(27);CHR$(45);CHR$(0);" thing." ' PRINT# , LPRINT, - . . , : 100 OPEN "LPT1:" AS #2 110 PRINT #2,S$;" and ";Y$ 120 PRINT #2,X, Y, Z 130 PRINT #2,"The total is "; X 140 PRINT #2,"The ";CHR$(27);CHR$(45);CHR$(1);"real"; CHR$(27);CHR$(45);CHR$(0);" thing." . 0 17H . AL, DX. AH , . [6.1.3] . , , : ;--- LPT1 MOV CX,NUMBER_CHARS ;CX MOV DX,0 ; LPT1 NEXT_CHAR: MOV AH,0 ; MOV AL,[BX] ;BX INT 17H ; TEST AH,8 ; JNZ PRNTR_ERROR ; INC BX ; LOOP NEXT_CHAR ; MS DOS - 5 21H. DL . LPT1 - . ;--- LPT1 MOV AH,5 ; MOV DL,CHAR ; INT 21H ; 40H - 21H. , [5.3.0]. - . #4 BX. LPT1, [6.1.4]. DS:DX , CX - . : ;--- 120 LPT1 MOV AH,40H ; MOV BX,4 ; MOV CX,120 ; LEA DX,PRTR_DATA ;DS:DX INT 21H ; JC PRTR_ERROR ; , AX 5, 6 - . , . . , , - . , LPT1-3 8, 10 12 BIOS ( 0040:0000). , 2 , . 0 - , , . 0. , , , . . , 1 . 6 1. 0 , , - . , 7 - , 0, - 1, . - , - , - . LPT1 BIOS , - BX. - 3, . ;--- MOV AX,40H ;ES BIOS MOV ES,AX ; MOV DX,ES:[8] ; LPT1 DX MOV BX,DATA_START ;BX ;--- NEXTCHAR: MOV AL,[BX] ; AL OUT DX,AL ; INC DX ;DX INC DX ; MOV AL,13 ; OUT DX,AL ; DEC AL ; OUT DX,AL ; ;--- DEC DX ;DX NOT_YET: IN AL,DX ; TEST AL,8 ;? JNZ PRTR_ERROR ; TEST AL,80H ; ? JZ NOT_YET ; , INC BX ; DEC DX ;DX JMP NEXTCHAR ; 4 , . , , - . , - ; , ( 6 1) . - , , . , . - , [7.1.8]. , , . , . - / AT . - , [2.1.7]. 8253 , , , . , - , . ( 7) , . 6.3.2 . , , . , - . - IBM, 27,77,0 - . , , . 1/6 . , , . , . - . , - , . -, . , - , . - . 80 ( , - ), , . 6, - , . - 480 ASCII 0. . - , . , , , - . , 12 , 61 , 11 . 80- 8 . - , 6 , 48 - . 11 , 4 4 , . 4 6 , 5, 11. - 10 . , , 1 ASCII 0, - , , . . 6-2 . . , , (., ). , , , . . . , BUFFERPTR - , , . 100 S$ = "This text will be printed with right justification using the printer alternately in text modes and graphics modes." 110 STRINGPTR = 1 ' S$ 120 COLUMNS = 1 ' 130 SPACES = 0 ' 140 ''' 150 C$ = MID$(S$,STRINGPTR,1) ' 160 IF C$ <> " " THEN 190 ' , 170 LASTSPACE = COLUMNS ' 180 SPACES = SPACES + 1 ' 190 COLUMNS = COLUMNS+1 ' 200 STRINGPTR = STRINGPTR + 1 ' 210 IF COLUMNS = 81 THEN 230 ' 220 GOTO 150 ' 230 IF C$ <> " " THEN 270 ' , 240 COLUMNS = 79 ' 79 250 SPACES = SPACES - 1 ' 260 GOTO 340 ' 270 C$ = MID$(S$,STRINGPTR+1,1) ' 280 IF C$ <> " " THEN 300 ' , 290 GOTO 340 ' 300 COLUMNS = COLUMNS - LASTSPACE ' 310 STRINGPTR = STRINGPTR - COLUMNS + 1 ' 320 COLUMNS = LASTSPACE - 1 ' 330 SPACES = SPACES - 1 ' 340 ''' 350 EXTRASPACES = 80 - COLUMNS ' 360 TOTALSPACES = EXTRASPACES + SPACES ' 370 TOTALDOTS = 6*TOTALSPACES ' 380 DOTSPERSPC = TOTALDOTS/SPACES ' 390 EXTRADOTS = TOTALDOTS MOD SPACES ' 400 ''' 410 OPEN "LPT1:" AS #1 ' 420 PRINTPTR = 1 ' 430 C$ = MID$(S$,PRINTPTR,1) ' 440 PRINTPTR = PRINTPTR + 1 ' 450 IF C$ = " " THEN 500 ' , 460 PRINT #1, C$ ' 470 IF PRINTPTR = COLUMNS + 1 THEN 590 ' 480 GOTO 430 ' 490 ''' 500 PRINT #1, CHR$(27) + "K"; ' 510 NUMBERDOTS = DOTSPERSPC ' ASCII 0 520 IF EXTRADOTS = 0 THEN 550 ' , 530 NUMBERDOTS = DOTSPERSPC + 1 ' 540 EXTRADOTS = EXTRADOTS - 1 ' 550 PRINT #1, CHR$(NUMBERDOTS); ' 560 PRINT #1, CHR$(0); ' 570 FOR N = 1 TO NUMBERDOTS: PRINT #1, CHR$(0): NEXT 580 GOTO 430 ' , . 590 PRINT #1, CHR$(13) ' . , . , - , , - , . , - . 6.3.3 . , , - . IBM , 27,78,1, - 27,78,0. , , ( ). , . , . , , , . - , - , , . - . , IBM - , - . . (. [6.3.4]). , ASCII, - , . - . , . . , . FONTWIDTH - . 100 ''' 110 DIM FONTWIDTH(127) ' 120 OPEN "FONTS" FOR INPUT AS #1 ' 130 FOR N = 32 TO 127 ' 32-127 140 INPUT #1, FONTWIDTH(N) ' 150 NEXT ' 160 ''' 170 CHARPTR = 0 ' 180 LINE$ = "" ' 190 LINELENGTH = 0 ' 200 WHILE LINELENGTH <480 ' 210 C$ = PEEK(BUFFERPTR+CHARPTR) ' 220 LINELENGTH = LINELENGTH + FONTWIDTH(ASC(C$)) 230 LINE$ = LINE$+C$ ' 240 CHARPTR = CHARPTR+1 ' 250 WEND ' 260 ''' 270 IF C$ = "" THEN 310 ' , 280 FOR N = LEN(LINE$) TO 1 STEP -1 ' 290 IF MID$(LINE$,N,1) = " " THEN 310 ' ? 300 NEXT ' , 310 LINELENGTH = N - 1 ' , - 320 ''' 330 LPRINT CHR$(27);CHR$(78);CHR$(1); ' 340 FOR N = 1 TO LINELENGTH ' 350 LPRINT PEEK(BUFFERPTR+N-1); ' 360 NEXT ' . - . , XLAT. AL, DS:DX , XLAT. AL: ;--- LEA SI,DATA_BUFFER ; LEA BX,WIDTH_TABLE ; MOV AL,[SI] ; XLAT WIDTH_TABLE ; AL 6.3.4 . - IBM, - . , . , - , - , . . , - , - . , , ASCII 205, 00100100 480 . , 6/480 1/80 . 27,75. , , . , 6 , 2 5 (4 + 32 = 36). - : 27, 75, 6, 0, 36, 36, 36, 36, 36, 36. - ; , . , . - , , 12 , 4 . - , 12 . 8 , , . (ASCII 10) . , - 8, 4 . - , , - 0, . 27, 65, 4, 27, 50, - 27, 65, 8, 27, 50. . , , . , (ASCII 32). , - ,