TempleOSTS_140317.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:46:02 +02:00
1 parent 2d2a65d572
commit 7ef616a20e
1416 files changed
+223873 -53917

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
Cd("::/Demo/OldSchool/MultiModAOT");;
Cmp("OD1");
Cmp("OD2");
Cmp("ODMain");
Load("OD1");
Load("OD2");
Load("ODMain");
#include "ObjDemo.HPP"
ObjDemo("Success");
#ifndef BinRep
#include "::/Adam/Utils/BinRep"
#endif
PressAKey;
BinRep("OD2");
PressAKey;
BinRep("ODMain");
PressAKey;
Who("-r");
+12
View File
@@ -0,0 +1,12 @@
// imports all syms from the Adam Task's hash table.
#include "::/Kernel/AOT.HPP"
import U0 Routine3(U8 *st);
U0 Routine1(U8 *st)
{
"Routine1:%s\n",st;
Routine3("What the!!!");
}
+32
View File
@@ -0,0 +1,32 @@
// imports all syms from the Adam Task's hash table.
#include "::/Kernel/AOT.HPP"
asm {
USE64
IMPORT Beep;
_MY_BEEP::
PUSH RBP
MOV RBP,RSP
PUSH FALSE
PUSH 300
CALL Beep
POP RBP
RET
}
_extern _MY_BEEP U0 MyBeep();
U0 Routine2(U8 *st)
{
"Routine2:%s\n",st;
MyBeep();
}
"$$BK,1$$Woo-Hoo!$$BK,0$$\n";
Dir;
"$$BK,1$$Woo-Hoo!$$BK,0$$\n";
Routine2("Cool");
+34
View File
@@ -0,0 +1,34 @@
// imports all syms from the Adam Task's hash table.
#include "::/Kernel/AOT.HPP"
import U0 Routine1(U8 *st);
import U0 Routine2(U8 *st);
_import _MY_BEEP U0 MyBeep();
U0 Routine3(U8 *st)
{
"Routine3:%s\n",st;
}
//Any routine with var parameters
//automatically has vars argc and argv[]
//whether it is main or not.
I64 ObjDemo(...)
{
I64 i;
MyBeep();
if (argc>0) {
for (i=0;i<argc;i++)
"Arg %d:%08X\n",i,argv[i];
Routine1(argv[0]);
if (argc>1) {
Routine2(argv[1]);
if (argc>2)
Routine3(argv[2]);
}
} else
"Pass string parameters for args 1 and 2.\n";
return argc;
}
+11
View File
@@ -0,0 +1,11 @@
//This file ties SYMIC EXPORTS
//to functions or global vars.
extern I64 ObjDemo(...);
//Uncomment these if you wish
//to call them at the command line.
//extern U0 Routine1(U8 *st);
//extern U0 Routine2(U8 *st);
//extern U0 Routine3(U8 *st);
+27
View File
@@ -0,0 +1,27 @@
This demonstrates that linking can be done
at $FG,2$LOAD$FG$ time. This is the TempleOS answer
to $FG,2$OBJ$FG$ files.
Right-Click $FG,2$MakeFile.CPP.Z$FG$ and click $FG,2$INCLUDE$FG$ or
do the following:
1) Do a $LK,"Dir",A="MN:Dir"$() command
2) Right-Click on OD1.PRJ.Z and click $FG,2$AOT COMPILE$FG$.
Right-Click on OD2.PRJ.Z and click $FG,2$AOT COMPILE$FG$.
Right-Click on ODMain.PRJ.Z and click $FG,2$AOT COMPILE$FG$.
3) In any order, do the following and ignore warnings.
Right-Click on OD1.BIN.Z and click $FG,2$LOAD$FG$.
Right-Click on ODMain.BIN.Z and click $FG,2$LOAD$FG$.
Right-Click on OD2.BIN.Z and click $FG,2$LOAD$FG$.
4) Right-Click on ObjDemo.HPP.Z and click $FG,2$INCLUDE$FG$.
5) Type at the command-line:
$ID,2$$FG,2$>ObjDemo("Arg1","Arg2");
$ID,-2$
$FG,2$#include$FG$ the file $LK,"::/Adam/Utils/BinRep.CPP"$ and
call $LK,"BinRep",A="MN:BinRep"$() to analyze the $FG,2$.BIN.Z$FG$ files.