home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug099.arc
/
HIRES2.DOC
< prev
next >
Wrap
Text File
|
1979-12-31
|
12KB
|
261 lines
TURBO HIRES2
By Simon Carter
Thi≤ montΦ wσ presen⌠ ß revisioε oµ thσ Do⌠ anΣ Plo⌠ routine≤ ¡ iε áMachinσ ì
Code« á Thσ Plo⌠ routinσ i≤ totall∙ differen⌠ t∩ thσ Pasca∞ onσ á presenteΣ ì
las⌠ á montΦ á¡ á thi≤ átimσ i⌠ i≤ baseΣ oε áthσ á DD┴ ároutinσ áiε áthσ ì
Assemble≥ áfo≥ áAddict≤ sectioε oµ Onlinσ ¡ reviseΣ áfo≥ áPascal'≤ áInlinσ ì
statement« Thσ comment≤ iε curl∙ brace≤ neeΣ no⌠ bσ entered¼ a≤ thesσ arσ ì
onl∙ fo≥ clarity.
DOT procedure
Thσ áDo⌠ procedurσ use≤ thσ samσ parameter≤ a≤ beforσ bu⌠ notσ átha⌠ ái⌠ ì
no≈ onl∙ use≤ onσ variable¼ a≤ ß resul⌠ oµ severa∞ spacσ anΣ timσ ásavinτ ì
operations« á Also¼ áthσ áconvenien⌠ 'inº statemen⌠ ha≤ no⌠ ábeeε áuseΣ át∩ ì
limi⌠ ╪ o≥ ┘ ranges¼ a≤ ß resul⌠ oµ timσ savinτ considerations« A≤ wel∞ ì
a≤ á that¼ á set≤ arσ limiteΣ t∩ 25╢ components¼ áno⌠ áallowinτ árange≤ ì
abovσ 25╡ fo≥ X.
Procedure Dot(X,Y : Integer; F : Operation);
Var
PCG : Byte;
Begin
if ((X>=0) and (X<512) and (Y>=0) and (Y<256)) then
begin
Inline($2A/Y/ { LD HL,(Y) }
$7D/ { LD A,L }
$CB/$3F/ { SRL A }
$CB/$3F/ { SRL A }
$CB/$3F/ { SRL A }
$CB/$3F/ { SRL A }
$CB/$3F/ { SRL A }
$F5/ { PUSH AF }
$7D/ { LD A,L }
$E6/$0F/ { AND 15 }
$F5/ { PUSH AF }
$ED/$4B/X/ { LD BC,(X) }
$79/ { LD A,C }
$E6/7/ { AND 7 }
$F5/ { PUSH AF }
$CB/$18/ { RR B }
$CB/$19/ { RR C }
$CB/$39/ { SRL C }
$CB/$39/ { SRL C }
$7D/ { LD A,L }
$E6/$F0/ { AND 240 }
$6F/ { LD L,A }
$29/ { ADD HL,HL }
$29/ { ADD HL,HL }
$EB/ { EX DE,HL }
$21/$C0/$F3/ { LD HL,$F3C0 }
$ED/$52/ { SBC HL,DE }è 6/0/ { LD B,0 }
9/ { ADD HL,BC }
$7E/ { LD A,(HL) }
$32/PCG/ { LD (PCG),A }
$C1/ { POP BC }
4/ { INC B }
$E/0/ { LD C,0 }
$37/ { SCF }
$CB/$19/ {LOOP RR C }
$10/$FC/ { DJNZ LOOP }
$E1/ { POP HL }
$3E/$0F/ { LD A,15 }
$94/ { SUB H }
$5F/ { LD E,A }
$E1/ { POP HL }
$3E/$87/ { LD A,135 }
$94/ { SUB H }
$D3/$1C/ { OUT (28),A }
$2A/PCG/ { LD HL,(PCG) }
$26/0/ { LD H,0 }
$29/ { ADD HL,HL }
$29/ { ADD HL,HL }
$29/ { ADD HL,HL }
$29/ { ADD HL,HL }
$16/$F0/ { LD D,$F0 }
$19/ { ADD HL,DE }
$3A/F/ { LD A,(F) }
$FE/0/ { CP 0 }
$28/8/ { JR Z,RESET }
$FE/1/ { CP 1 }
$28/$0B/ { JR Z,SET }
$7E/ { LD A,(HL) }
$A9/ { XOR C }
$18/9/ { JR CLEAN }
$79/ {RESET LD A,C }
$2F/ { CPL }
$4F/ { LD C,A }
$7E/ { LD A,(HL) }
$A1/ { AND C }
$18/$02/ { JR CLEAN }
$7E/ {SET LD A,(HL) }
$B1/ { OR C }
$77/ {CLEAN LD (HL),A }
$3E/$80/ { LD A,128 }
$D3/$1C); { OUT (28),A }
end;
End;
PLOT procedure
A≤ witΦ thσ Do⌠ procedure¼ thσ Plo⌠ procedurσ caε bσ calleΣ witΦ thσ ì
samσ parameter≤ a≤ before.è
Procedure Plot(X0,Y0,X1,Y1 : Integer; F : Operation);
Var
D1, D2, S1, S2, A1, A2, N1, D3 : Integer;
Begin
Inline($2A/X1/ { LD HL,(X1) }
$ED/$5B/X0/ { LD DE,(X0) }
$B7/ { OR A }
$ED/$52/ { SBC HL,DE }
$22/D1/ { LD (D1),HL }
$2A/Y1/ { LD HL,(Y1) }
$ED/$5B/Y0/ { LD DE,(Y0) }
$B7/ { OR A }
$ED/$52/ { SBC HL,DE }
$22/D2/ { LD (D2),HL }
$21/0/0/ { LD HL,0 }
$22/S1/ { LD (S1),HL }
$22/A2/ { LD (A2),HL }
$23/ { INC HL }
$22/S2/ { LD (S2),HL }
$22/A1/ { LD (A1),HL }
$2A/D1/ { LD HL,(D1) }
$CB/$7C/ { BIT 7,H }
$28/$11/ { JR Z,TEST2 }
$21/$FFFF/ { LD HL,$FFFF }
$22/A1/ { LD (A1),HL }
$23/ { INC HL }
$ED/$5B/D1/ { LD DE,(D1) }
$B7/ { OR A }
$ED/$52/ { SBC HL,DE }
$22/D1/ { LD (D1),HL }
$2A/D2/ {TEST2 LD HL,(D2) }
$CB/$7C/ { BIT 7,H }
$28/$13/ { JR Z,TEST3 }
$21/0/0/ { LD HL,0 }
$ED/$5B/D2/ { LD DE,(D2) }
$B7/ { OR A }
$ED/$52/ { SBC HL,DE }
$22/D2/ { LD (D2),HL }
$21/$FFFF/ { LD HL,$FFFF }
$22/S2/ { LD (S2),HL }
$2A/D2/ {TEST3 LD HL,(D2) }
$ED/$5B/D1/ { LD DE,(D1) }
$B7/ { OR A }
$ED/$52/ { SBC HL,DE }
$28/$29/ { JR Z,START }
$38/$27/ { JR C,START }è
$2A/D1/ { LD HL,(D1) }
$22/N1/ { LD (N1),HL }
$2A/D2/ { LD HL,(D2) }
$22/D1/ { LD (D1),HL }
$2A/N1/ { LD HL,(N1) }
$22/D2/ { LD (D2),HL }
$2A/A1/ { LD HL,(A1) }
$22/S1/ { LD (S1),HL }
$2A/S2/ { LD HL,(S2) }
$22/A2/ { LD (A2),HL }
$21/0/0/ { LD HL,0 }
$22/A1/ { LD (A1),HL }
$22/S2/ { LD (S2),HL }
$2A/D1/ {START LD HL,(D1) }
$CB/$3C/ { SRL H }
$CB/$1D/ { RR L }
$22/D3/ { LD (D3),HL }
$21/1/0/ { LD HL,1 }
$22/N1); { LD (N1),HL }
Dot(X0,Y0,F);
While N1 <= D1 do
begin
Inline($2A/X0/ { LD HL,(X0) }
$ED/$5B/A1/ { LD DE,(A1) }
$19/ { ADD HL,DE }
$22/X0/ { LD (X0),HL }
$2A/Y0/ { LD HL,(Y0) }
$ED/$5B/A2/ { LD DE,(A2) }
$19/ { ADD HL,DE }
$22/Y0/ { LD (Y0),HL }
$2A/D3/ { LD HL,(D3) }
$ED/$5B/D2/ { LD DE,(D2) }
$19/ { ADD HL,DE }
$22/D3/ { LD (D3),HL }
$2A/N1/ { LD HL,(N1) }
$23/ { INC HL }
$22/N1/ { LD (N1),HL }
$2A/D3/ { LD HL,(D3) }
$ED/$5B/D1/ { LD DE,(D1) }
$B7/ { OR A }
$ED/$52/ { SBC HL,DE }
$38/$19/ { JR C,ENDDDA }
$22/D3/ { LD (D3),HL }
è $2A/X0/ { LD HL,(X0) }
$ED/$5B/S1/ { LD DE,(S1) }
$19/ { ADD HL,DE }
$22/X0/ { LD (X0),HL }
$2A/Y0/ { LD HL,(Y0) }
$ED/$5B/S2/ { LD DE,(S2) }
$19/ { ADD HL,DE }
$22/Y0); { LD (Y0),HL }
{ENDDDA }
Dot(X0,Y0,F);
end;
End;
Next month, Point, Text, Circle & Arc routines so stay tuned!
No time to type them in?
Send $5, a stamped, self - addressed envelope and 5.25" disk to
Simon Carter,
14 Canterbury Rd,
Heathmont, 3135.
anΣ á╔ áwil∞ fil∞ you≥ disδ witΦ Hires▓ routine≤ anΣ anythinτ áelsσ átha⌠ ì
come≤ t∩ mind....