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

peter at easthope.ca peter at easthope.ca
Mon Mar 14 17:40:02 CET 2022


>From ETH Oberon 2.3.7,

PROCEDURE GetKernelCHS(d: LONGINT;  VAR chs1: CHS);
VAR p, t, i : LONGINT;  chs: CHS;
BEGIN
	p := Kernel.bt;  i := 0;
	LOOP
		SYSTEM.GET(p, t);
		IF t = -1 THEN EXIT	(* end *)
		ELSIF 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
END GetKernelCHS;

My revision.

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;

Better way?  Criticisms?

Thx,                        ... P.

-- 
mobile: +1 778 951 5147
  VoIP: +1 604 670 0140
   48.7693 N 123.3053 W



More information about the Oberon mailing list