Hallo Leute
Möchte gerne ein Delphi Programm nach VB.Net übersetzen.
Dazu benötige ich eure Hilfe, weil ich kein Delphi kann.
Einige Paralellen sind ja vorhanden.
Wie übersetze ich zb.:
//######################################################################
########
procedure MRQ(Status: Boolean); // Setzt die MRQ Leitung auf HIGH bzw
LOW
begin // ARGUMENTE: Status: "High"/"Low"
if Status = High then//Wenn Status LOW werden soll
begin
hPortStatus := hPortstatus or 4;
asm
mov dx, 378h
mov al, hPortStatus
out dx, al
end;
end
else //Wenn Status HIGH werden soll
begin
if hPortstatus and 4 = 4 then //Nur wenn Ist-Zustand High...
begin
hPortstatus := hPortstatus - 4; //...auf low setzen
asm
mov dx, 378h
mov al, hPortStatus
out dx, al
end;
end;
end;
end;
Mir ist klar, das Inline Assembler nicht mehr funktioniert.
Darum soll es später über die InPout32.dll laufen.
Bin mir mit den END; und END bzw begin nicht sicher :-(
Ist dies korrekt übersetzt??? :
Function MRQ(ByVal Status As Boolean)
'Setzt die MRQ Leitung auf HIGH bzw LOW
If Status = High Then 'Wenn Status LOW werden soll
hPortStatus = hPortstatus or 4;
'asm()
'mov dx, 378h
'mov(al, hPortStatus)
'out(dx, al)
Else 'Wenn Status HIGH werden soll
If hPortStatus And 4 = 4 Then 'Nur wenn Ist-Zustand High...
hPortstatus = hPortstatus - 4; '...auf low
setzen
' asm()
'mov dx, 378h
' mov(al, hPortStatus)
' out(dx, al)
End If
End If
End Function
Habe es ausprobiert. Wurde von mir richtig übersetzt. Danke für eure Nichthilfe.
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.