Autor Beitrag
Arno-Wien
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

xp

BeitragVerfasst: Di 03.01.06 19:55 
Aufgrund der Beispiele, die ich von euch bekommen habe, habe ich folgendes übersetzt:

Alle Variablen sind extended

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
procedure rechnung_compiler;
begin
  ywert:=zwei*xwert*ywert-y_konst;
  xwert:=xqu-yqu-x_konst;
  xqu:=xwert*xwert;
  yqu:=ywert*ywert;
  summe:=xqu+yqu;
end;

procedure rechnung_assembler;
asm
      fld y_konst
      fld ywert
      fld xwert
      fld zwei
      fmulp
      fmulp
      fmulp
      fsub
      fstp ywert

      fld x_konst
      fld yqu
      fld xqu
      fsubp
      fsubp
      fstp xwert

      fld xwert
      fmulp 
      fstp xqu

      fld ywert
      fld ywert
      fmulp
      fstp yqu

      fld xqu
      fld yqu
      faddp
      fstp summe
end;


Ergibt eine Invalid floating point operation.

Bitte um Hilfe
Ich weiss, dass man das viel eleganter übersetzen könnte, aber es ist der erste Versuch.

Arno
Allesquarks
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 510

Win XP Prof
Delphi 7 E
BeitragVerfasst: Di 03.01.06 22:12 
Fehler tritt wo auf (bei dir zuhause oder in Zeile x)!!!!!!!

Auf Anhieb würde ich sagen ein mulp zuviel. Du multiplizierst vier Zahlen und benutzt dann ein leeres Register.
By the way. Solche Zahlen kann man auch auf dem Stack halten, da die meiseten deiner Befehle nicht nur mit dem Tos funktionieren.
Für die Grundoperationen gibt es auch noch die Operationen mit umgekehrter Operandenreihenfolge mulrp subrp etc.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 04.01.06 11:09 
Ich würd so direkt mal auf Zeile 18\19 tippen *g* FPStack Underrun at FSUB...
Müsste übrigens, wenn Du es schon so machst FSUBP heißen.

Zeile 29 ist gleich die nächste, die crasht ;-)

Ansonsten kann ich Dir auch nur Strg+Alt+C \ Strg+Alt+F empfehlen ;-)

(Übrigens: Fehler ohne Delphi gefunden ;-))

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.