[Oberon] DeLOOPing ATADisks.Mod in ETH Oberon 2.3.7.

Jörg joerg.straube at iaeth.ch
Mon Mar 14 18:10:28 CET 2022


Peter
Generally okay. Here a perhaps a slightly more readable code…

PROCEDURE GetKernelCHS(d: LONGINT;  VAR chs1: CHS);
VAR p, t, i : LONGINT;  chs: CHS;
BEGIN
   p := Kernel.bt;  i := 0; SYSTEM.GET(p, t);
   WHILE t # -1 DO
         IF t = 5 THEN    (* HD params *)
               IF i = d THEN
                   chs.cyls := GetPar(p, 0) + 100H*GetPar(p, 1);
                   chs.hds := GetPar(p, 2);  chs.spt := GetPar(p, 14);
                   IF chs.cyls * chs.hds * chs.spt > 0 THEN chs1 := chs END
               END;
               INC(i)
         END;
         SYSTEM.GET(p+4, t);  INC(p, t); SYSTEM.GET(p, t)
   END
END GetKernelCHS;

Br Jörg

> Am 14.03.2022 um 17:42 schrieb peter at easthope.ca:
> 
> PROCEDURE GetKernelCHS(d: LONGINT;  VAR chs1: CHS);
> VAR p, t, i : LONGINT;  chs: CHS;
> BEGIN
>    p := Kernel.bt;  i := 0;
>    REPEAT
>        SYSTEM.GET(p, t);
>        IF t # -1 THEN 
>            IF t = 5 THEN    (* HD params *)
>                IF i = d THEN
>                    chs.cyls := GetPar(p, 0) + 100H*GetPar(p, 1);
>                    chs.hds := GetPar(p, 2);  chs.spt := GetPar(p, 14);
>                    IF chs.cyls * chs.hds * chs.spt > 0 THEN chs1 := chs END
>                END;
>                INC(i)
>            END;
>            SYSTEM.GET(p+4, t);  INC(p, t)
>        END
>    UNTIL t = -1
> END GetKernelCHS;


More information about the Oberon mailing list