@@ -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. |