Peter Easthope wrote:
In http://www.oberon.ethz.ch/display.html I studied the description of SwitchTrident9xxx but still do not understand. What exactly is the purpose of this procedure? What is accomplished in each of the three statements? PROCEDURE SwitchTrident9xxx(bank: LONGINT); BEGIN
curBank := bank; SYSTEM.PORTOUT(3D8H, CHR(bank)); SYSTEM.PORTOUT(3D9H, CHR(bank)) END SwitchTrident9xxx;
It is near impossible to analyse 'bottom up'. If your 'given result' is 7 and known to be the sum of 2 natural numbers, then there are several posibilities. Working in the other direction: given 3 plus 4 has a single answer. So working in the one 'direction' give you a one-to-many descision at each descision point; and in the opposite direction you usually have a single reason at each 'point'. As you know: curBank := bank; assigns the LONGINT sized value, 'bank', to the non local variable 'curBank'. More than this you can't be sure of. (was it 1+6 or 5+2 ?) SYSTEM.PORTOUT(3D8H, CHR(bank)); I guess would mean: write the 8 least significant bits { using the CHR type/size conversion} of bank to the device/register that has address 3D8H. The hardware is such that the 3D8H and 3D9H hardware devices have 8 bit inputs (which the CPU will output to), but the procedure's argument is of size LONGINT (? 64 bits I guess), for reasons which you can't know from the information available here. SYSTEM.PORTOUT's 2nd argument apparently must be type CHR. Hence the type conversion, to not have a syntax error. As said the way to analyse is to 'know the "destination" first, and then work towards it', rather than observing the ant walking and trying to guess where he plans to go !! So if you start from eg: set the BankSelectRegister to Bank; set the SpeedSelectRegister to Minimum; read the StatusRegister .... etc, then it's easier (than trying reverse engineering) to translate this to: SYSTEM.PORTOUT(BankSelectRegister, CHR(bank)); SYSTEM.PORTOUT(SpeedSelectRegister, Minimum); SYSTEM.PORTIN(StatusRegister, StatusByte); -- Chris Glur.
cglur@onwe.co.za wrote:
PROCEDURE SwitchTrident9xxx(bank: LONGINT); BEGIN
curBank := bank; SYSTEM.PORTOUT(3D8H, CHR(bank)); SYSTEM.PORTOUT(3D9H, CHR(bank)) END SwitchTrident9xxx;
Just to explain it a bit more. Some SVGA card in past, and I think EVERY ONE nowadays can select a memory bank to write, and another for read (it was imporant when all we have to play withou hasle was 640K from real mode). So the two PORTOUT using the same "bank name" may mean to set the same memory bank for read AND write. However, as I never programmed the Trident chips ("just" ATI Mach32, Cirrus 54xx and S3-Virge), i must say i'm just guessing.
SYSTEM.PORTOUT(BankSelectRegister, CHR(bank)); SYSTEM.PORTOUT(SpeedSelectRegister, Minimum); SYSTEM.PORTIN(StatusRegister, StatusByte);
-- []s, (Pink@Manaus.Amazon.Brazil.America.Earth.SolarSystem.OrionArm.MilkyWay.Universe) Liberdade não é um esforço individual. A sua só existe se vc garantir a dos outros! Vapour : The Software's natural state.
participants (2)
-
cglur@onwe.co.za -
Lisias Toledo