Commit cf861eb

Nick committed on
Couple changes to units to begin migration to 64 bit
commit cf861ebc4a41242534c01426c5bbf801a4ea74cb parent 85a3947
2 changed files +9−21
ModifiedCpu/machine.pas +8−20
@@ -8,6 +8,7 @@
8 unit machine; 8 unit machine;
9 9
10 {$MODE Delphi} 10 {$MODE Delphi}
11 {$ASMMODE INTEL}
11 12
12 interface 13 interface
13 14
@@ -71,8 +72,8 @@ const
71 {+ Important!! the two memory functions must 72 {+ Important!! the two memory functions must
72 be declared CDECL!!! +} 73 be declared CDECL!!! +}
73 74
74 function speekb(address: word): byte; cdecl; 75 function speekb(address: word): byte;
75 procedure spokeb(address: word; Data: byte); cdecl; 76 procedure spokeb(address: word; Data: byte);
76 77
77 function wordpeek(Addr: word): word; 78 function wordpeek(Addr: word): word;
78 procedure wordpoke(addr: word; val: word); 79 procedure wordpoke(addr: word; val: word);
@@ -279,7 +280,7 @@ begin
279 Result := res; 280 Result := res;
280 end; 281 end;
281 282
282 procedure spokeb(address: word; Data: byte); cdecl; // neu 283 procedure spokeb(address: word; Data: byte); // neu
283 var 284 var
284 cr: byte; 285 cr: byte;
285 ji, pi: longint; 286 ji, pi: longint;
@@ -662,23 +663,10 @@ begin
662 end; 663 end;
663 664
664 665
665 procedure push_pc; assembler; 666 procedure push_pc;
666 asm 667 begin
667 MOV AX,pc.w 668 dec(sp_.W,2);
668 DEC sp_.w 669 wordpoke(sp_.W,pc.w);
669 XCHG AH,AL
670 PUSH EAX
671 PUSH dword ptr sp_.w
672 CALL spokeb
673 LEA ESP,[ESP+8]
674 MOV AX,pc.w
675 PUSH EAX
676 DEC sp_.w
677 PUSH dword ptr sp_.w
678 CALL spokeb
679 LEA ESP,[ESP+8]
680 end; 670 end;
681 (* dec(sp_.W,2);wordpoke(sp_.W,pc.w);*)
682
683 671
684 end. 672 end.
Modifiedcodegen.pas +1−1
@@ -39,7 +39,7 @@ var
39 OrderCnt: Integer; 39 OrderCnt: Integer;
40 begin 40 begin
41 Res := TStringList.Create; 41 Res := TStringList.Create;
42 OrderCnt := maxvalue([High(OrderMatrix[0]), High(OrderMatrix[1]), 42 OrderCnt := MaxIntValue([High(OrderMatrix[0]), High(OrderMatrix[1]),
43 High(OrderMatrix[2]), High(OrderMatrix[3])]); 43 High(OrderMatrix[2]), High(OrderMatrix[3])]);
44 44
45 Res.Add('order_cnt: db ' + IntToStr(OrderCnt*2)); 45 Res.Add('order_cnt: db ' + IntToStr(OrderCnt*2));