home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
microcrn
/
issue_40.arc
/
SCANNER.ARC
/
SCRNSTUF.UPD
< prev
next >
Wrap
Text File
|
1988-01-11
|
1KB
|
47 lines
(* Code from Pascal column in Micro Cornucopia Issue #40 *)
PROCEDURE StartPrinter(npoints:CARDINAL);
CONST
(* Change these constants and add or delete DOSCALLs to match your printer *)
ESC = 33C;
L = 'L';
VAR
I, J : CARDINAL;
BEGIN
DOSCALL(5H,ESC); (* output graphics prefix *)
DOSCALL(5H, L);
DOSCALL(5H, npoints MOD 256); (* Low order byte of npoints *)
DOSCALL(5H, npoints DIV 256); (* high order of npoints *)
FOR I := 1 TO npoints DO
DOSCALL(5H,0);
END;
FOR J := 0 TO 1 DO
FOR I := 0 TO 10000 DO END; (* Short Delay to allow printhead to start *)
END;
END StartPrinter;
PROCEDURE Scan (VAR R : Buffer);
VAR
A : ADDRESS;
BEGIN
StartPrinter(1); (* print one column, forces head to home *)
StartPrinter(Xsize);
A := ADR(R); (* address of where Modula needs the data *)
SETREG(AX,2);
SETREG(BX,A.OFFSET);
SETREG(DX,A.SEGMENT);
SETREG(CX,Xsize);
CODE(PUSHBP);
SWI(60H);
CODE(POPBP);
WHILE Scanning^ DO END; (* This is a quick and dirty method. More
elegant would be to have the resident scan
software act as a M2 coroutine. *)
StepPrinter;
END Scan;