|
@@ -26,6 +26,15 @@ var
|
|
|
binend: byte; external name '_etext';
|
|
|
bssstart: byte; external name '_sbss';
|
|
|
bssend: byte; external name '_ebss';
|
|
|
+ a4_at_entry : dword;
|
|
|
+ a5_at_entry : dword;
|
|
|
+ a6_at_entry : dword;
|
|
|
+ a7_at_entry : dword;
|
|
|
+ nb_ChannelIds : word;
|
|
|
+ pChannelIds : pdword;
|
|
|
+ pData : pointer;
|
|
|
+ CmdLine_len : word; public name '__CmdLine_len';
|
|
|
+ pCmdLine : pchar; public name '__pCmdLine';
|
|
|
|
|
|
procedure PascalMain; external name 'PASCALMAIN';
|
|
|
procedure PascalStart; forward;
|
|
@@ -41,6 +50,30 @@ asm
|
|
|
dc.l $46504300 { Job name, just FPC for now }
|
|
|
|
|
|
@start:
|
|
|
+ { According to QDOS:SMS reference manual }
|
|
|
+ { Section 3.2 v 4.4 (10/06/2018) }
|
|
|
+ move.l a4,d0
|
|
|
+ move.l d0,a4_at_entry
|
|
|
+ move.l a5,d0
|
|
|
+ move.l d0,a5_at_entry
|
|
|
+ move.l a6,d0
|
|
|
+ move.l d0,a6_at_entry
|
|
|
+ move.l a7,d0
|
|
|
+ move.l d0,a7_at_entry
|
|
|
+
|
|
|
+ move.w (a7),d0
|
|
|
+ move.w d0,nb_ChannelIds
|
|
|
+ add.l #2,d0
|
|
|
+ move.l d0,pChannelIds
|
|
|
+ move.l a6,d0
|
|
|
+ add.l a4,d0
|
|
|
+ move.l d0,pData
|
|
|
+ move.l a6,d0
|
|
|
+ add.l a5,d0
|
|
|
+ move.l d0,a0
|
|
|
+ move.w (a0),CmdLine_Len
|
|
|
+ add.l #2,d0
|
|
|
+ move.l d0,pCmdLine
|
|
|
{ relocation code }
|
|
|
|
|
|
{ get our actual position in RAM }
|