. , , ,

,,,

58079 —

" "

"

"

:

"

58079 (LPT)"

:

"_____"__________________2000.

:

:

. . 71

:

"_____"__________________2000.

..

- 2000


TOC o "1-2" h z .. PAGEREF _Toc482027551 h 3

1. 58079. PAGEREF _Toc482027552 h 3

1.1. 58079. PAGEREF _Toc482027553 h 4

1.2. . PAGEREF _Toc482027554 h 6

1.3. . PAGEREF _Toc482027555 h 6

1.4. 58079. PAGEREF _Toc482027556 h 7

1.5. .. PAGEREF _Toc482027557 h 9

1.6. . PAGEREF _Toc482027558 h 11

2. - . PAGEREF _Toc482027559 h 13

3. .. PAGEREF _Toc482027560 h 15

4. .. PAGEREF _Toc482027561 h 15

5. . PAGEREF _Toc482027562 h 17

... PAGEREF _Toc482027563 h 17

. PAGEREF _Toc482027564 h 18

1. . PAGEREF _Toc482027565 h 19


() . , ( , - , ), , , . () - - . , .

, . 58079, 580. , 580, , IBM-PC, (LPT).

58079.

1. 58079

58079 , () () , () (.1, .1).

, , , , (). . () " - " 8 8 (8 ). , . () 16 8 . . 58079 . 2123.40-2 17467-79.

. 1. () () 58079.

1.1. 58079.

58079 . (.2): , ; ; ; -.

, RET7RET0, . :

RET7RET0 , . .1 .

SH , ( ) ( SH .

- , ( .1) ; ( .0) RET0RET7 ( ).

INT , .1: ; .

- . - , 231. SR, BD, ( .

4- (). ( . S3S0 4- 00002 11112, ; , S3S0 4- ( .0). , , 8- 4- .

, , . . 16 32 4- . . . DSPA3DSPA0 DSPB3DSPB0, DSPA3 D7 , DSPB0 D0.

, 58079 D7 D0.

- . :

- -, , ;

INS=1) (

1.2.

- (.1)

1.

1

1

0

0

0

1

0

0

1

0

1

0

0

0

1

0

1

: .

1.3.

(.2), , INS=1 . " " (.3) (.4).

2.

D7

D6

D5

D4

D3

D2

D1

D0

0

0

0

4

3

2

1

0

-

0

0

1

4

3

2

1

0

0

1

0

4

2

1

0

0

1

1

4

3

2

1

0

1

0

1

3

2

1

0

1

1

0

4

3

2

1

0

INT

1

1

1

: .

3.

2

1

0

0

0

0

( )

0

0

1

0

1

0

N-

0

1

1

N-

1

0

0

1

0

1

1

1

0

,

1

1

1

,

4.

 

4

3

 

 

0

0

8-8 ,

 

0

1

16-8 , ( SR)

 

1

0

8-8 ,

 

1

1

16-8 , ( SR)

1.4. 58079

58079 RET7RET0. () . . , SH INT . 1, () . , D5 . . .

() N- . . . , S3S0.

() N- " INT " . , N- . , D6 . INT .1 ( ).

() , , SH SH- . , . , (RET7RET0) .

() . , , "" . . , . INT .1 ( ) . .0 INT , " ", (D4) .0 " INT- " (=1).

() RET7RET0 , , . , . SH . , . , , RET7RET0.

" () " RET7RET0. - 9- .. . . , , , . .

16(8)-8 . . , , . . . , - , . , .

, , 16- , .. 8- 5,12 10,24 16- 100 .

D3D0, . . D5, . D4 , . D7, , , . () D6, , . N- D6 , , .

1.5.

, , , , ( , ..). () . , , .

, , . , . , . : ( ), (, ), , .

"" , .. , , . , , , , . .

, , , . 58079 .

, , - . , , . / . , , , .

58079 : (88 ), FIFO 13, 5 4; ; , . " ".

. D0D3 , D3=1 , , , . D4=1 D5=1. D4 D5 .

INT . , . , .

1.6. .

: , , (), ( , , ). . (. ) , .

5.

25

425

200300

( 10 ), , , ,

,

- 0,75,5

50100

2070

- 2,545

2070

- 0,11,3

, , ,

,

20300

4,57,0

2050

70150

,

, ( 2550 ), ,

190220

120170

2540

,

( ) , , . , 40 .

58079 . , . .

, .

58079 16 . " " , ( ). , .

DSPB0DSPB3 ( , D0D3 ) DSPA0DSPA3 ( , D4D7). , DSP . "". 00, . CLR DSP .0. (, ) / " ". .

, . , , . , ( ), . . - , "" . , , +8 (=07) , , , . , +4, +8, +0h (=03).

2. - .

IBM- - "Centronics" ( LPT), . (), , , , -.

IBM PC- . Centronix, 36 ( -). :

- , 3BCh - 3BEh;

- , 378h - 37Ah ( ) 278h - 27Ah ( ).

- ( ); BIOS, 0:408h(LPT1) LPT4. , 378h.

────────────────────────────────────────────────────────────────

378h - , -

堠 -

,

379h 堠 :

7 6 5 4 3 2 1 0

┌──┬──┬──┬──┬──┬─┬─┬─┐

│ │ │ │ │ │X│X│X│ :

└┬─┴┬─┴┬─┴┬─┴┬─┴─┴─┴─┘ ─────

│ │ │ │ └─────────> 3: 0=

│ │ │ └────────────> 4: 0=

│ │ └───────────────> 5: 1= " "

│ └──────────────────> 6: 0=

└─────────────────────> 7: 0= ,

37Ah / :

7 6 5 4 3 2 1 0

┌─┬─┬─┬──┬──┬──┬──┬──┐

│X│X│X│ │ │ │ │ │ :

└─┴─┴─┴┬─┴┬─┴┬─┴┬─┴┬─┘ ─────

│ │ │ │ └───> 0:

│ │ │ └──────> 1: 1=

│ │ │ ( MS-DOS

│ │ │ )

│ │ └─────────> 2: 1=

│ └────────────> 3: 1= (

│ )

└───────────────> 4: 1=

.

3.

, ( , , ). , ( ), (16 ) , . , , . (), ( , ).

:

6.

SB1SB13

"0""9", "A", "B", ""

()

SB14

""

SB15

""

SB16

""

, , .

, .

:

7.

DAT0DAT7

+

+

INS/D

/

+

--

IORC

+

--

IOWC

+

--

RESET

+

--

PCLK

+

--

IRQ

--

--

4.

:

       

       

       

       

       

       

Turbo Pascal 7.0 MS-DOS 6.22 .

- . . . (378h), (INS/D, IORC, IOWC, RESET, PCLK, IRQ) (37Ah), (379h).

8. .

LPT

37Ah

378h

X

X

X

INS/D

IORC

IOWC

RESET

PCLK

DAT7

DAT6

DAT5

DAT4

DAT3

DAT2

DAT1

DAT0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

X

X

X

1

1

0

0

1

0

0

0

1

1

0

0

1

( 07)

X

X

X

1

1

0

0

1

0

1

0

0

0

0

0

0

( )

X

X

X

1

1

0

0

1

0

1

0

0

0

0

0

1

( )

X

X

X

0

0

1

0

1

?

?

?

?

?

?

?

?

INT

X

X

X

1

1

0

0

1

1

1

1

1

0

0

0

0

()

X

X

X

1

1

X

X

X

()

X

X

X

1

1

0

0

1

1

1

0

1

0

0

1

1

X

X

X

1

1

0

0

1

1

1

0

1

0

0

1

0

X

X

X

0

1

0

0

1

?

?

?

?

?

?

?

?

X

X

X

1

0

1

0

1

?

?

?

?

?

?

?

?

. ; ? .

, .

A

B

C

D

E

F

G

H

Nh

1

0

1

1

0

0

0

0

0

60

2

1

1

0

1

1

0

1

0

DA

3

1

1

1

1

0

0

1

0

F2

4

0

1

1

0

0

1

1

0

66

5

1

0

1

1

0

1

1

0

B6

6

1

0

1

1

1

1

1

0

BE

7

1

1

1

0

0

0

0

0

E0

8

1

1

1

1

1

1

1

0

FE

9

1

1

1

1

0

1

1

0

F6

0

1

1

1

1

1

1

0

0

FC

A

1

1

1

0

1

1

1

0

EE

b

0

0

1

1

1

1

1

0

3E

E

1

0

0

1

1

1

1

0

9E

r

1

0

0

0

1

1

0

0

8C

,

.

b0

b1

b2

b3

b4

b5

b6

b7

Nh

"0", "8"

1

0

0

0

0

0

0

0

80

"1","9"

0

1

0

0

0

0

0

0

40

"2",""

0

0

1

0

0

0

0

0

20

"3",""

0

0

0

1

0

0

0

0

10

"4",""

0

0

0

0

1

0

0

0

8

"5",""

0

0

0

0

0

1

0

0

4

"6",""

0

0

0

0

0

0

1

0

2

"7",""

0

0

0

0

0

0

0

1

1

1.

5. .

580 - 58079. ( ) .

( ) , .

2-23 , .

10 , , , , .

58079 IBM PC. , . , , , , . , .

, , , ( ) , . 58079, , .

.

1. -, . 8086/8088. , ., . . , .: , 1987.

2. . . .., , 1980.

3. , .


1. .

{

58079

: ..}

program KR580;

uses crt,dos;

const Recode: array[1..16] of byte = ($01,$02,$04,$08,$10,$20,$40,$80,$03,$05,

$09,$0B,$12,$22,$42,$82);

{}

Code: array[1..16] of integer = (1,2,3,3,3,4,4,5,6,6,0,0,0,0,0,0);

var i,k:integer;

Display:array[1..16] of integer;

tmp:byte;

OK : boolean;

label NEW,AGAIN;

procedure OutByte(portN,bte:byte);{ }

begin

case portN of

$378: asm

mov al,bte

out $378,al

end;

$37A: asm

mov al,bte

out $37A,al

end;

end(*case*);

Delay(10);

end;

function InByte(portN:byte):byte;{ }

begin

case portN of

$378: asm

in al,$378

end;

$379: asm

in al,$379

end;

$37A: asm

in al,$37A

end;

end(*case*);

asm

mov InByte,al

end;

Delay(10);

end;

procedure Init; { }

begin

OutByte($37A,$03); {a }

OutByte($37A,$19); { }

OutByte($378,$19); { }

end;

procedure Wait; { }

begin

repeat until InByte($379) <> 0;

end;

procedure OutToDisplay(Symbol:integer); { }

{ }

const Recode:array[1..15] of byte = ($60,$da,$f2,$66,$b6,$be,$e0,$fe,$f6,$fc,$ee,$3e,$9c,$9e,$8c);

begin

OutByte($37A,$09);

OutByte($378,Recode[Symbol]);

end;

function StatusWord:boolean;{ }

var SW:byte;

begin

StatusWord := false;

OutByte($37A,$15);

SW := InByte($378);

if SW <> 0 then StatusWord := TRUE;

end;

procedure ResetINT; { INT}

begin

OutByte($37A,$19);

OutByte($378,$F0);

end;

procedure ResetDSPL;{ }

begin

OutByte($37A,$19);

OutByte($378,$D2);

end;

procedure Bell;{ }

begin

Sound(1200);

Delay(1000);

NoSound;

end;

function GetChar:byte; { }

begin

If not StatusWord then

begin

OutByte($37A,$19);

OutByte($378,$40);

OutByte($37A,$05);

GetChar := Inbyte($378);

if GetChar = 0 then

begin

OutByte($37A,$19);

OutByte($378,$41);

OutByte($37A,$05);

GetChar := Inbyte($378)+2;

end

else

begin

Bell;Bell;

WriteLN(' !!!');

end;

ResetINT;

end;

begin

AGAIN:

Init;

k := 0;

repeat

begin

Wait;

tmp := GetChar;

i := 0;

repeat

inc(i);

until Recode[i] = tmp;

inc(k);

case i of

1..13: begin

Display[k] := i;

OutToDisplay(i);

end; {}

14: k:=16; {}

15: goto AGAIN;{}

16: Bell; {}

end(*case*);

end;

until k=16;

for i:=0 to 16 do

if Display[i] <> Code[i] then OK := true; { }

if OK then Exec('proc.exe,''); { , }

goto AGAIN;

end.

" " " " : "

 

 

 

! , , , .
. , :