p H-Z80




p H-Z80 - 3


Z-80 / 23/27 / / 318 / p LPT1

5.

5

LPT p pin 10 pin 11 pin 12 pin 13 pin 15
318 B A E G F
23/27 pin 5 pin 2 pin 12 pin 16 pin 15
Z-80 D1 D0 D4 D6 D5

p

. `in.exe phone.inf`

`phone.inf` p `123-4567`

H H H H

H

H p pp H

------------------------------------

Const

Len = 50;

Recode: Array[0..31] of Char=

{ 000 001 010 011 100 101 110 111 }

{00}( '?','?','?','5', '?','?','?','6',

{01} '7','?','3','9', '?','0','2','8',

{10} ' ','?','=','?', '?','?','n','?',

{11} '1','?','?','4', '?','?','?','?');

Var

Buf: Array[0..Len] of Char;

I: Word;

{ ResFile: File;}

TxtFile: Text;

Error: Boolean;

Phone: String;

{I+}

Begin

Write('Ready! ...');

Asm

{

mov di,Offset Buf

mov ax,ds

mov es,ax

mov cx,60000

cli

@@loop:

mov dx,379h

@@0:

in al,dx

stosb

loop @@loop

sti

}

mov di,Offset Buf

mov ax,ds

mov es,ax

mov bx,Len+1

cli

@@loop:

mov cx,$900

mov dx,$379

@@loop0:

in al,dx

cmp al,$87

loopz @@loop0

in al,dx

in al,dx

in al,dx

in al,dx

in al,dx

in al,dx

in al,dx

in al,dx

shr al,3

xor ah,ah

mov si,ax

mov al,byte ptr Recode[si]

stosb

mov cx,$900

@@loop1:

in al,dx

cmp al,$87

loopnz @@loop1

or cx,cx

jz @@end

dec bx

jnz @@loop

@@end:

sti

mov Error,False

or cx,cx

jnz @@ok

mov Error,True

@@ok:

End;

If Error Then

Writeln('not detected!')

Else

Begin

Writeln('done.');

{ Assign(ResFile,ParamStr(1));

Rewrite(ResFile,1);

BlockWrite(ResFile,Buf,Len+1);

Close(ResFile);}

I:=0;

Phone:='???-????';

While I

pp TP 7.0. H ,

pp, p pp ;-) pp p

p p p H` .