mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 04:02:25 +00:00
Compare commits
60 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65baeb77a9 | ||
|
|
9fce469f23 | ||
|
|
84516b2ac6 | ||
|
|
a517a42357 | ||
|
|
50b5a1438e | ||
|
|
fa9e73f7af | ||
|
|
a9465ccfc6 | ||
|
|
dac6504f12 | ||
|
|
2f1ce08aff | ||
|
|
28c327be28 | ||
|
|
94683df1d8 | ||
|
|
f0e92c7434 | ||
|
|
71488ffe85 | ||
|
|
378de43274 | ||
|
|
1fbbb68dc7 | ||
|
|
9846292b85 | ||
|
|
bb7a731197 | ||
|
|
7dafb02d1e | ||
|
|
5e52f8c231 | ||
|
|
e298d10d99 | ||
|
|
3460b9f78a | ||
|
|
089ca94207 | ||
|
|
b12029e3ed | ||
|
|
cd06cd32b1 | ||
|
|
7691293a5b | ||
|
|
d005317424 | ||
|
|
a25b44ae21 | ||
|
|
e64d4c4d44 | ||
|
|
ac82959092 | ||
|
|
cb098d448d | ||
|
|
9e9bbe7581 | ||
|
|
9084ca288b | ||
|
|
233761e7fa | ||
|
|
e936f7d7b0 | ||
|
|
c4f3792047 | ||
|
|
812b3a56d6 | ||
|
|
764e018de2 | ||
|
|
b22fc3fd3f | ||
|
|
2178fa7b18 | ||
|
|
e36e862c8c | ||
|
|
afe5a2d824 | ||
|
|
7d14452a51 | ||
|
|
8d2d479664 | ||
| 9292b2a7d5 | |||
|
|
e189882af8 | ||
|
|
48741af5ac | ||
|
|
7fb61a066b | ||
|
|
7ea99e20a0 | ||
|
|
a7fe55d434 | ||
|
|
85dff7734d | ||
|
|
e376e59f58 | ||
|
|
75c155f8ec | ||
|
|
dfaf2d3622 | ||
|
|
5a93546143 | ||
|
|
ff42920226 | ||
|
|
c4213e333a | ||
|
|
b8d08c007a | ||
|
|
bd35c73c1f | ||
|
|
7ca08f1ef1 | ||
|
|
9e3995d0ee |
220 changed files with 2638 additions and 743 deletions
4
.gitattributes
vendored
4
.gitattributes
vendored
|
|
@ -34,3 +34,7 @@
|
||||||
*.Mod diff=pascal
|
*.Mod diff=pascal
|
||||||
*.c diff=cpp
|
*.c diff=cpp
|
||||||
*.h diff=cpp
|
*.h diff=cpp
|
||||||
|
|
||||||
|
# Set the language to Oberon
|
||||||
|
*.Mod linguist-language=Oberon
|
||||||
|
*.mod linguist-language=Oberon
|
||||||
|
|
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -11,6 +11,7 @@
|
||||||
/*.sym
|
/*.sym
|
||||||
/*.asm
|
/*.asm
|
||||||
/*.mod
|
/*.mod
|
||||||
|
/Errors.Txt
|
||||||
/Errors.txt
|
/Errors.txt
|
||||||
/olang
|
/olang
|
||||||
/src/test/**/*.exe
|
/src/test/**/*.exe
|
||||||
|
|
@ -20,9 +21,11 @@
|
||||||
/src/test/**/*.obj
|
/src/test/**/*.obj
|
||||||
/src/test/**/*.sym
|
/src/test/**/*.sym
|
||||||
**/*.stackdump
|
**/*.stackdump
|
||||||
|
!/src/test/confidence/**/expected
|
||||||
/src/test/confidence/**/input
|
/src/test/confidence/**/input
|
||||||
/src/test/confidence/**/result
|
/src/test/confidence/**/result
|
||||||
/src/test/confidence/**/result-*
|
/src/test/confidence/**/result-*
|
||||||
|
/src/test/confidence/**/*[^.]*
|
||||||
/src/test/confidence/**/*.asm
|
/src/test/confidence/**/*.asm
|
||||||
/src/test/confidence/**/*.s
|
/src/test/confidence/**/*.s
|
||||||
/src/test/confidence/**/*.map
|
/src/test/confidence/**/*.map
|
||||||
|
|
@ -39,3 +42,5 @@
|
||||||
/triage/BasicTypeSize.md
|
/triage/BasicTypeSize.md
|
||||||
/triage/Roadmap.md
|
/triage/Roadmap.md
|
||||||
triage/system/*
|
triage/system/*
|
||||||
|
tags
|
||||||
|
voc
|
||||||
|
|
|
||||||
30
ReadMe.md
30
ReadMe.md
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
# Ѵishap Oberon
|
# Ѵishap Oberon
|
||||||
|
|
||||||
[Ѵishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3)
|
[Ѵishap Oberon](https://vishap.oberon.am/) is a free and open source (GPLv3)
|
||||||
implementation of the Oberon-2 language and libraries for use on
|
implementation of the Oberon-2 language and libraries for use on
|
||||||
conventional operating systems such as Linux, BSD, Android, Mac and Windows.
|
conventional operating systems such as Linux, BSD, Android, Mac and Windows.
|
||||||
|
|
||||||
Vishap's Oberon Compiler (voc) uses a C backend (gcc, clang or msc) to compile
|
Vishap's Oberon Compiler (voc) uses a C backend (gcc, clang, tcc or msc) to compile
|
||||||
Oberon programs under Unix, Mac or Windows. Vishap Oberon includes
|
Oberon programs under Unix, Mac or Windows. Vishap Oberon includes
|
||||||
libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as
|
libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as
|
||||||
default libraries complying with the Oakwood Guidelines for Oberon-2 compilers.
|
default libraries complying with the Oakwood Guidelines for Oberon-2 compilers.
|
||||||
|
|
@ -31,9 +31,11 @@ It is easy to install the Oberon compiler and libraries
|
||||||
with the following simple steps:
|
with the following simple steps:
|
||||||
|
|
||||||
1. Install pre-requisites such as git, gcc, static C libraries, diff utils.
|
1. Install pre-requisites such as git, gcc, static C libraries, diff utils.
|
||||||
2. Clone the repository and run 'make full'.
|
2. Clone the repository: `git clone https://github.com/vishaps/voc`.
|
||||||
3. Optionally install to a system directory such as /opt or /usr/local/share with 'make install'.
|
3. Optionally `export CC=clang` or `export CC=tcc`.
|
||||||
4. Set your PATH variable to include the compiler binary.
|
4. run `make full`.
|
||||||
|
5. Optionally install to a system directory such as /opt or /usr/local/share with `make install` (might be with sudo).
|
||||||
|
6. Set your PATH variable to include the compiler binary.
|
||||||
|
|
||||||
These are detailed below:
|
These are detailed below:
|
||||||
|
|
||||||
|
|
@ -179,9 +181,9 @@ Most of the runtime in libVishapOberon is distributed under GPLv3 with runtime e
|
||||||
|
|
||||||
## Platform support and porting
|
## Platform support and porting
|
||||||
|
|
||||||
Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm and ppc.
|
Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x86_64, 32 bit arm and aarch64.
|
||||||
|
|
||||||
It compiles under gcc, clang and Microsoft Visual C.
|
It compiles under gcc, clang, tcc and Microsoft Visual C.
|
||||||
|
|
||||||
Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin).
|
Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin).
|
||||||
|
|
||||||
|
|
@ -276,13 +278,13 @@ Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015
|
||||||
###### Oberon
|
###### Oberon
|
||||||
- [The History of Modula-2 and Oberon](http://people.inf.ethz.ch/wirth/Articles/Modula-Oberon-June.pdf)
|
- [The History of Modula-2 and Oberon](http://people.inf.ethz.ch/wirth/Articles/Modula-Oberon-June.pdf)
|
||||||
- [The Programming Language Oberon](https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon.Report.pdf)
|
- [The Programming Language Oberon](https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon.Report.pdf)
|
||||||
- [Project Oberon: The Design of an Operating System and Compiler ](http://www.ethoberon.ethz.ch/WirthPubl/ProjectOberon.pdf)
|
- [Project Oberon: The Design of an Operating System and Compiler ](https://people.inf.ethz.ch/wirth/ProjectOberon1992.pdf)
|
||||||
- [Oberon - the Overlooked Jewel](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90.7173&rep=rep1&type=pdf)
|
- [Oberon - the Overlooked Jewel](http://pascal.hansotten.com/uploads/oberonpi/Oberon%20article.pdf)
|
||||||
|
|
||||||
###### Oberon 2
|
###### Oberon 2
|
||||||
- [Differences between Oberon and Oberon-2](http://members.home.nl/jmr272/Oberon/Oberon2.Differences.pdf)
|
- [Differences between Oberon and Oberon-2](https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=89e5bd3cf006bde4821599cdc57a37de5dc84bcd)
|
||||||
- [The Programming Language Oberon-2](http://www.ssw.uni-linz.ac.at/Research/Papers/Oberon2.pdf)
|
- [The Programming Language Oberon-2](http://www.ssw.uni-linz.ac.at/Research/Papers/Oberon2.pdf)
|
||||||
- [Programming in Oberon. Steps beyond Pascal and Modula](http://www.ethoberon.ethz.ch/WirthPubl/ProgInOberonWR.pdf)
|
- [Programming in Oberon. Steps beyond Pascal and Modula](https://people.inf.ethz.ch/wirth/ProgInOberonWR.pdf)
|
||||||
- [The Oakwood Guidelines for Oberon-2 Compiler Developers](http://www.math.bas.bg/bantchev/place/oberon/oakwood-guidelines.pdf)
|
- [The Oakwood Guidelines for Oberon-2 Compiler Developers](http://www.math.bas.bg/bantchev/place/oberon/oakwood-guidelines.pdf)
|
||||||
|
|
||||||
###### Oberon 07
|
###### Oberon 07
|
||||||
|
|
@ -292,10 +294,10 @@ Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015
|
||||||
|
|
||||||
###### Links
|
###### Links
|
||||||
- [Niklaus Wirth's personal page at ETH Zurich](https://www.inf.ethz.ch/personal/wirth/)
|
- [Niklaus Wirth's personal page at ETH Zurich](https://www.inf.ethz.ch/personal/wirth/)
|
||||||
- [ETH Zurich's Wirth publications page](http://www.ethoberon.ethz.ch/WirthPubl/)
|
- [Selected articles by Niklaus Wirth](https://people.inf.ethz.ch/wirth/SelectedArticles.pdf)
|
||||||
- [Joseph Templ's ofront on github](https://hithub.com/jtempl/ofront)
|
- [ETH Oberon publications page](https://web.archive.org/web/20191207155011/http://www.ethoberon.ethz.ch/books.html)
|
||||||
|
- [Joseph Templ's ofront on github](https://github.com/jtempl/ofront)
|
||||||
- [Software Templ OG](http://www.software-templ.com)
|
- [Software Templ OG](http://www.software-templ.com)
|
||||||
- [Oberon: Steps beyond Pascal and Modula](http://fruttenboel.verhoeven272.nl/Oberon/)
|
|
||||||
|
|
||||||
|
|
||||||
## History
|
## History
|
||||||
|
|
|
||||||
|
|
@ -151,53 +151,61 @@ SYSTEM_PTR SYSTEM_NEWARR(ADDRESS *typ, ADDRESS elemsz, int elemalgn, int nofdim,
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler
|
typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
// Unix signal handling
|
||||||
|
SystemSignalHandler handler[10] = {0}; // Adjust the array size to include signal 11
|
||||||
|
|
||||||
SystemSignalHandler handler[3] = {0};
|
void segfaultHandler(int signal) {
|
||||||
|
__HALT(-10);
|
||||||
// Provide signal handling for Unix based systems
|
}
|
||||||
|
// Revised signal handler to accommodate additional signals like SIGSEGV
|
||||||
void signalHandler(int s) {
|
void signalHandler(int s) {
|
||||||
if (s >= 2 && s <= 4) handler[s-2](s);
|
if ((s >= 2 && s <= 4) || s == 11) { // Include SIGSEGV (usually signal 11)
|
||||||
// (Ignore other signals)
|
if (handler[s-2]) {
|
||||||
|
handler[s-2](s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Ignore other signals
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemSetHandler(int s, ADDRESS h) {
|
void SystemSetHandler(int s, ADDRESS h) {
|
||||||
if (s >= 2 && s <= 4) {
|
if ((s >= 2 && s <= 4) || s == 11) {
|
||||||
int needtosetsystemhandler = handler[s-2] == 0;
|
int needtosetsystemhandler = handler[s-2] == 0;
|
||||||
handler[s-2] = (SystemSignalHandler)h;
|
handler[s-2] = (SystemSignalHandler)h;
|
||||||
if (needtosetsystemhandler) {signal(s, signalHandler);}
|
if (needtosetsystemhandler) {
|
||||||
|
signal(s, signalHandler);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
void setupAutomaticSegfaultHandler() {
|
||||||
|
SystemSetHandler(11, (ADDRESS)segfaultHandler); // Register handler for SIGSEGV
|
||||||
|
}
|
||||||
|
|
||||||
// Provides Windows callback handlers for signal-like scenarios
|
#else
|
||||||
|
// Windows system remains as is since Windows does not use SIGSEGV in the same way
|
||||||
#include "WindowsWrapper.h"
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
SystemSignalHandler SystemInterruptHandler = 0;
|
SystemSignalHandler SystemInterruptHandler = 0;
|
||||||
SystemSignalHandler SystemQuitHandler = 0;
|
SystemSignalHandler SystemQuitHandler = 0;
|
||||||
BOOL ConsoleCtrlHandlerSet = FALSE;
|
BOOL ConsoleCtrlHandlerSet = FALSE;
|
||||||
|
|
||||||
BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) {
|
BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) {
|
||||||
if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) {
|
if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) {
|
||||||
if (SystemInterruptHandler) {
|
if (SystemInterruptHandler) {
|
||||||
SystemInterruptHandler(2); // SIGINT
|
SystemInterruptHandler(2); // SIGINT
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
} else { // Close, logoff or shutdown
|
} else {
|
||||||
if (SystemQuitHandler) {
|
if (SystemQuitHandler) {
|
||||||
SystemQuitHandler(3); // SIGQUIT
|
SystemQuitHandler(3); // SIGQUIT
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnsureConsoleCtrlHandler() {
|
void EnsureConsoleCtrlHandler() {
|
||||||
if (!ConsoleCtrlHandlerSet) {
|
if (!ConsoleCtrlHandlerSet) {
|
||||||
SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE);
|
SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE);
|
||||||
|
|
@ -216,3 +224,4 @@ typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,9 +116,11 @@ extern void Modules_AssertFail(INT32 x);
|
||||||
|
|
||||||
// Index checking
|
// Index checking
|
||||||
|
|
||||||
static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;}
|
static inline INT64 __XF(INT64 i, UINT64 ub) {
|
||||||
#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0))
|
if (i < 0 || (UINT64)i >= ub) __HALT(-2);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
#define __X(i, ub) (((i) >= 0 && (i) < (ub)) ? (i) : (__HALT(-2),0))
|
||||||
|
|
||||||
// Range checking, and checked SHORT and CHR functions
|
// Range checking, and checked SHORT and CHR functions
|
||||||
|
|
||||||
|
|
@ -265,7 +267,12 @@ extern void Heap_INCREF();
|
||||||
extern void Modules_Init(INT32 argc, ADDRESS argv);
|
extern void Modules_Init(INT32 argc, ADDRESS argv);
|
||||||
extern void Heap_FINALL();
|
extern void Heap_FINALL();
|
||||||
|
|
||||||
|
extern void setupAutomaticSegfaultHandler();
|
||||||
|
#ifndef _WIN32
|
||||||
|
#define __INIT(argc, argv) static void *m; setupAutomaticSegfaultHandler(); Modules_Init(argc, (ADDRESS)&argv);
|
||||||
|
#else
|
||||||
#define __INIT(argc, argv) static void *m; Modules_Init(argc, (ADDRESS)&argv);
|
#define __INIT(argc, argv) static void *m; Modules_Init(argc, (ADDRESS)&argv);
|
||||||
|
#endif
|
||||||
#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum)
|
#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum)
|
||||||
#define __FINI Heap_FINALL(); return 0
|
#define __FINI Heap_FINALL(); return 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -19,6 +19,6 @@ export void *Configuration__init(void)
|
||||||
__DEFMOD;
|
__DEFMOD;
|
||||||
__REGMOD("Configuration", 0);
|
__REGMOD("Configuration", 0);
|
||||||
/* BEGIN */
|
/* BEGIN */
|
||||||
__MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
|
__MOVE("2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
|
||||||
__ENDMOD;
|
__ENDMOD;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Configuration__h
|
#ifndef Configuration__h
|
||||||
#define Configuration__h
|
#define Configuration__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -86,6 +86,7 @@ export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
|
||||||
export void Files_Purge (Files_File f);
|
export void Files_Purge (Files_File f);
|
||||||
export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
||||||
|
export void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
||||||
export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
||||||
export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
||||||
|
|
@ -634,6 +635,11 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
|
||||||
|
{
|
||||||
|
Files_Read(&*r, r__typ, &*x);
|
||||||
|
}
|
||||||
|
|
||||||
void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n)
|
void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n)
|
||||||
{
|
{
|
||||||
INT32 xpos, min, restInBuf, offset;
|
INT32 xpos, min, restInBuf, offset;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Files__h
|
#ifndef Files__h
|
||||||
#define Files__h
|
#define Files__h
|
||||||
|
|
@ -40,6 +40,7 @@ import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
|
||||||
import void Files_Purge (Files_File f);
|
import void Files_Purge (Files_File f);
|
||||||
import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
||||||
|
import void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
||||||
import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
||||||
import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
||||||
|
|
||||||
#ifndef Heap__h
|
#ifndef Heap__h
|
||||||
#define Heap__h
|
#define Heap__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Modules__h
|
#ifndef Modules__h
|
||||||
#define Modules__h
|
#define Modules__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -1626,6 +1626,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
if (x == y) {
|
if (x == y) {
|
||||||
} else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) {
|
} else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) {
|
||||||
} else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) {
|
} else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) {
|
||||||
|
OPB_err(113);
|
||||||
} else if (x->BaseTyp == OPT_chartyp) {
|
} else if (x->BaseTyp == OPT_chartyp) {
|
||||||
if (g == 8) {
|
if (g == 8) {
|
||||||
if (ynode->conval->intval2 > x->n) {
|
if (ynode->conval->intval2 > x->n) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPB__h
|
#ifndef OPB__h
|
||||||
#define OPB__h
|
#define OPB__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -618,31 +618,33 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
|
||||||
{
|
{
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPC_DefineTProcMacros(obj->left, &*empty);
|
OPC_DefineTProcMacros(obj->left, &*empty);
|
||||||
if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) {
|
if ((obj->mode == 13 && obj == OPC_BaseTProc(obj))) {
|
||||||
OPM_WriteString((CHAR*)"#define __", 11);
|
if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) {
|
||||||
OPC_Ident(obj);
|
OPM_WriteString((CHAR*)"#define __", 11);
|
||||||
OPC_DeclareParams(obj->link, 1);
|
OPC_Ident(obj);
|
||||||
OPM_WriteString((CHAR*)" __SEND(", 9);
|
OPC_DeclareParams(obj->link, 1);
|
||||||
if (obj->link->typ->form == 11) {
|
OPM_WriteString((CHAR*)" __SEND(", 9);
|
||||||
OPM_WriteString((CHAR*)"__TYPEOF(", 10);
|
if (obj->link->typ->form == 11) {
|
||||||
OPC_Ident(obj->link);
|
OPM_WriteString((CHAR*)"__TYPEOF(", 10);
|
||||||
|
OPC_Ident(obj->link);
|
||||||
|
OPM_Write(')');
|
||||||
|
} else {
|
||||||
|
OPC_Ident(obj->link);
|
||||||
|
OPM_WriteString((CHAR*)"__typ", 6);
|
||||||
|
}
|
||||||
|
OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16));
|
||||||
|
if (obj->typ == OPT_notyp) {
|
||||||
|
OPM_WriteString((CHAR*)"void", 5);
|
||||||
|
} else {
|
||||||
|
OPC_Ident(obj->typ->strobj);
|
||||||
|
}
|
||||||
|
OPM_WriteString((CHAR*)"(*)", 4);
|
||||||
|
OPC_AnsiParamList(obj->link, 0);
|
||||||
|
OPM_WriteString((CHAR*)", ", 3);
|
||||||
|
OPC_DeclareParams(obj->link, 1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
} else {
|
OPM_WriteLn();
|
||||||
OPC_Ident(obj->link);
|
|
||||||
OPM_WriteString((CHAR*)"__typ", 6);
|
|
||||||
}
|
}
|
||||||
OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16));
|
|
||||||
if (obj->typ == OPT_notyp) {
|
|
||||||
OPM_WriteString((CHAR*)"void", 5);
|
|
||||||
} else {
|
|
||||||
OPC_Ident(obj->typ->strobj);
|
|
||||||
}
|
|
||||||
OPM_WriteString((CHAR*)"(*)", 4);
|
|
||||||
OPC_AnsiParamList(obj->link, 0);
|
|
||||||
OPM_WriteString((CHAR*)", ", 3);
|
|
||||||
OPC_DeclareParams(obj->link, 1);
|
|
||||||
OPM_Write(')');
|
|
||||||
OPM_WriteLn();
|
|
||||||
}
|
}
|
||||||
OPC_DefineTProcMacros(obj->right, &*empty);
|
OPC_DefineTProcMacros(obj->right, &*empty);
|
||||||
}
|
}
|
||||||
|
|
@ -652,7 +654,7 @@ static void OPC_DefineType (OPT_Struct str)
|
||||||
{
|
{
|
||||||
OPT_Object obj = NIL, field = NIL, par = NIL;
|
OPT_Object obj = NIL, field = NIL, par = NIL;
|
||||||
BOOLEAN empty;
|
BOOLEAN empty;
|
||||||
if (OPM_currFile == 1 || str->ref < 255) {
|
if ((OPM_currFile == 1 || str->ref < 255) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) {
|
||||||
obj = str->strobj;
|
obj = str->strobj;
|
||||||
if (obj == NIL || OPC_Undefined(obj)) {
|
if (obj == NIL || OPC_Undefined(obj)) {
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
|
|
@ -719,6 +721,13 @@ static void OPC_DefineType (OPT_Struct str)
|
||||||
if (!empty) {
|
if (!empty) {
|
||||||
OPM_WriteLn();
|
OPM_WriteLn();
|
||||||
}
|
}
|
||||||
|
} else if ((obj->typ->form == 11 && obj->typ->BaseTyp->comp == 4)) {
|
||||||
|
empty = 1;
|
||||||
|
OPC_DeclareTProcs(obj->typ->BaseTyp->link, &empty);
|
||||||
|
OPC_DefineTProcMacros(obj->typ->BaseTyp->link, &empty);
|
||||||
|
if (!empty) {
|
||||||
|
OPM_WriteLn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPC__h
|
#ifndef OPC__h
|
||||||
#define OPC__h
|
#define OPC__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -19,6 +19,8 @@ typedef
|
||||||
CHAR OPM_FileName[32];
|
CHAR OPM_FileName[32];
|
||||||
|
|
||||||
|
|
||||||
|
static CHAR OPM_currentComment[256];
|
||||||
|
static BOOLEAN OPM_hasComment;
|
||||||
static CHAR OPM_SourceFileName[256];
|
static CHAR OPM_SourceFileName[256];
|
||||||
static CHAR OPM_GlobalModel[10];
|
static CHAR OPM_GlobalModel[10];
|
||||||
export CHAR OPM_Model[10];
|
export CHAR OPM_Model[10];
|
||||||
|
|
@ -59,6 +61,7 @@ static void OPM_FindInstallDir (void);
|
||||||
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos);
|
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos);
|
||||||
static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len);
|
static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len);
|
||||||
export void OPM_Get (CHAR *ch);
|
export void OPM_Get (CHAR *ch);
|
||||||
|
export void OPM_GetComment (CHAR *text, ADDRESS text__len);
|
||||||
export void OPM_Init (BOOLEAN *done);
|
export void OPM_Init (BOOLEAN *done);
|
||||||
export void OPM_InitOptions (void);
|
export void OPM_InitOptions (void);
|
||||||
export INT16 OPM_Integer (INT64 n);
|
export INT16 OPM_Integer (INT64 n);
|
||||||
|
|
@ -82,6 +85,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len);
|
||||||
static void OPM_ShowLine (INT64 pos);
|
static void OPM_ShowLine (INT64 pos);
|
||||||
export INT64 OPM_SignedMaximum (INT32 bytecount);
|
export INT64 OPM_SignedMaximum (INT32 bytecount);
|
||||||
export INT64 OPM_SignedMinimum (INT32 bytecount);
|
export INT64 OPM_SignedMinimum (INT32 bytecount);
|
||||||
|
export void OPM_StoreComment (CHAR *text, ADDRESS text__len);
|
||||||
export void OPM_SymRCh (CHAR *ch);
|
export void OPM_SymRCh (CHAR *ch);
|
||||||
export INT32 OPM_SymRInt (void);
|
export INT32 OPM_SymRInt (void);
|
||||||
export INT64 OPM_SymRInt64 (void);
|
export INT64 OPM_SymRInt64 (void);
|
||||||
|
|
@ -157,6 +161,36 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len)
|
||||||
__DEL(modname);
|
__DEL(modname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OPM_StoreComment (CHAR *text, ADDRESS text__len)
|
||||||
|
{
|
||||||
|
INT16 i;
|
||||||
|
__DUP(text, text__len, CHAR);
|
||||||
|
i = 0;
|
||||||
|
while ((i < 255 && text[__X(i, text__len)] != 0x00)) {
|
||||||
|
OPM_currentComment[__X(i, 256)] = text[__X(i, text__len)];
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
OPM_currentComment[__X(i, 256)] = 0x00;
|
||||||
|
OPM_hasComment = 1;
|
||||||
|
__DEL(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPM_GetComment (CHAR *text, ADDRESS text__len)
|
||||||
|
{
|
||||||
|
INT16 i;
|
||||||
|
if (OPM_hasComment) {
|
||||||
|
i = 0;
|
||||||
|
while ((((i < text__len && i < 256)) && OPM_currentComment[__X(i, 256)] != 0x00)) {
|
||||||
|
text[__X(i, text__len)] = OPM_currentComment[__X(i, 256)];
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
text[__X(i, text__len)] = 0x00;
|
||||||
|
OPM_hasComment = 0;
|
||||||
|
} else {
|
||||||
|
text[0] = 0x00;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
INT64 OPM_SignedMaximum (INT32 bytecount)
|
INT64 OPM_SignedMaximum (INT32 bytecount)
|
||||||
{
|
{
|
||||||
INT64 result;
|
INT64 result;
|
||||||
|
|
@ -763,7 +797,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done)
|
||||||
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0);
|
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0);
|
||||||
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag);
|
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag);
|
||||||
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver);
|
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver);
|
||||||
if (tag != 0xf7 || ver != 0x83) {
|
if (tag != 0xf7 || ver != 0x84) {
|
||||||
if (!__IN(4, OPM_Options, 32)) {
|
if (!__IN(4, OPM_Options, 32)) {
|
||||||
OPM_err(-306);
|
OPM_err(-306);
|
||||||
}
|
}
|
||||||
|
|
@ -834,7 +868,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len)
|
||||||
if (OPM_newSFile != NIL) {
|
if (OPM_newSFile != NIL) {
|
||||||
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0);
|
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0);
|
||||||
Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7);
|
Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7);
|
||||||
Files_Write(&OPM_newSF, Files_Rider__typ, 0x83);
|
Files_Write(&OPM_newSF, Files_Rider__typ, 0x84);
|
||||||
} else {
|
} else {
|
||||||
OPM_err(153);
|
OPM_err(153);
|
||||||
}
|
}
|
||||||
|
|
@ -1143,5 +1177,7 @@ export void *OPM__init(void)
|
||||||
OPM_MinReal = -OPM_MaxReal;
|
OPM_MinReal = -OPM_MaxReal;
|
||||||
OPM_MinLReal = -OPM_MaxLReal;
|
OPM_MinLReal = -OPM_MaxLReal;
|
||||||
OPM_FindInstallDir();
|
OPM_FindInstallDir();
|
||||||
|
OPM_hasComment = 0;
|
||||||
|
OPM_currentComment[0] = 0x00;
|
||||||
__ENDMOD;
|
__ENDMOD;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPM__h
|
#ifndef OPM__h
|
||||||
#define OPM__h
|
#define OPM__h
|
||||||
|
|
@ -30,6 +30,7 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val);
|
||||||
import void OPM_FPrintReal (INT32 *fp, REAL val);
|
import void OPM_FPrintReal (INT32 *fp, REAL val);
|
||||||
import void OPM_FPrintSet (INT32 *fp, UINT64 val);
|
import void OPM_FPrintSet (INT32 *fp, UINT64 val);
|
||||||
import void OPM_Get (CHAR *ch);
|
import void OPM_Get (CHAR *ch);
|
||||||
|
import void OPM_GetComment (CHAR *text, ADDRESS text__len);
|
||||||
import void OPM_Init (BOOLEAN *done);
|
import void OPM_Init (BOOLEAN *done);
|
||||||
import void OPM_InitOptions (void);
|
import void OPM_InitOptions (void);
|
||||||
import INT16 OPM_Integer (INT64 n);
|
import INT16 OPM_Integer (INT64 n);
|
||||||
|
|
@ -48,6 +49,7 @@ import BOOLEAN OPM_OpenPar (void);
|
||||||
import void OPM_RegisterNewSym (void);
|
import void OPM_RegisterNewSym (void);
|
||||||
import INT64 OPM_SignedMaximum (INT32 bytecount);
|
import INT64 OPM_SignedMaximum (INT32 bytecount);
|
||||||
import INT64 OPM_SignedMinimum (INT32 bytecount);
|
import INT64 OPM_SignedMinimum (INT32 bytecount);
|
||||||
|
import void OPM_StoreComment (CHAR *text, ADDRESS text__len);
|
||||||
import void OPM_SymRCh (CHAR *ch);
|
import void OPM_SymRCh (CHAR *ch);
|
||||||
import INT32 OPM_SymRInt (void);
|
import INT32 OPM_SymRInt (void);
|
||||||
import INT64 OPM_SymRInt64 (void);
|
import INT64 OPM_SymRInt64 (void);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPP__h
|
#ifndef OPP__h
|
||||||
#define OPP__h
|
#define OPP__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -279,32 +279,74 @@ static void Comment__2 (void);
|
||||||
|
|
||||||
static void Comment__2 (void)
|
static void Comment__2 (void)
|
||||||
{
|
{
|
||||||
|
BOOLEAN isExported;
|
||||||
|
CHAR commentText[256];
|
||||||
|
INT16 i, nestLevel;
|
||||||
|
CHAR prevCh, nextCh;
|
||||||
|
i = 0;
|
||||||
|
while (i <= 255) {
|
||||||
|
commentText[__X(i, 256)] = 0x00;
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
isExported = 0;
|
||||||
|
i = 0;
|
||||||
|
nestLevel = 1;
|
||||||
|
prevCh = 0x00;
|
||||||
OPM_Get(&OPS_ch);
|
OPM_Get(&OPS_ch);
|
||||||
for (;;) {
|
if (OPS_ch == '*') {
|
||||||
for (;;) {
|
isExported = 1;
|
||||||
while (OPS_ch == '(') {
|
OPM_Get(&OPS_ch);
|
||||||
|
if (OPS_ch == ')') {
|
||||||
|
commentText[0] = 0x00;
|
||||||
|
OPM_StoreComment(commentText, 256);
|
||||||
|
OPM_Get(&OPS_ch);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while ((nestLevel > 0 && OPS_ch != 0x00)) {
|
||||||
|
if ((prevCh == '(' && OPS_ch == '*')) {
|
||||||
|
nestLevel += 1;
|
||||||
|
prevCh = 0x00;
|
||||||
|
} else if ((prevCh == '*' && OPS_ch == ')')) {
|
||||||
|
nestLevel -= 1;
|
||||||
|
if (nestLevel == 0) {
|
||||||
OPM_Get(&OPS_ch);
|
OPM_Get(&OPS_ch);
|
||||||
if (OPS_ch == '*') {
|
} else {
|
||||||
Comment__2();
|
prevCh = 0x00;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) {
|
||||||
|
if (i < 255) {
|
||||||
|
commentText[__X(i, 256)] = prevCh;
|
||||||
|
i += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (OPS_ch == '*') {
|
prevCh = OPS_ch;
|
||||||
OPM_Get(&OPS_ch);
|
}
|
||||||
break;
|
if (nestLevel > 0) {
|
||||||
}
|
|
||||||
if (OPS_ch == 0x00) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
OPM_Get(&OPS_ch);
|
OPM_Get(&OPS_ch);
|
||||||
}
|
}
|
||||||
if (OPS_ch == ')') {
|
}
|
||||||
OPM_Get(&OPS_ch);
|
if (OPS_ch == 0x00) {
|
||||||
break;
|
OPS_err(5);
|
||||||
|
}
|
||||||
|
if ((((((isExported && nestLevel == 0)) && prevCh != 0x00)) && prevCh != '*')) {
|
||||||
|
if (i < 255) {
|
||||||
|
commentText[__X(i, 256)] = prevCh;
|
||||||
|
i += 1;
|
||||||
|
} else {
|
||||||
|
OPM_LogWStr((CHAR*)"Truncating final comment character", 35);
|
||||||
|
OPM_LogWLn();
|
||||||
}
|
}
|
||||||
if (OPS_ch == 0x00) {
|
}
|
||||||
OPS_err(5);
|
if (isExported) {
|
||||||
break;
|
if (i >= 256) {
|
||||||
|
OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30);
|
||||||
|
OPM_LogWLn();
|
||||||
|
i = 255;
|
||||||
}
|
}
|
||||||
|
commentText[__X(i, 256)] = 0x00;
|
||||||
|
OPM_StoreComment(commentText, 256);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPS__h
|
#ifndef OPS__h
|
||||||
#define OPS__h
|
#define OPS__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -83,6 +83,7 @@ typedef
|
||||||
OPT_Const conval;
|
OPT_Const conval;
|
||||||
INT32 adr, linkadr;
|
INT32 adr, linkadr;
|
||||||
INT16 x;
|
INT16 x;
|
||||||
|
OPT_ConstExt comment;
|
||||||
} OPT_ObjDesc;
|
} OPT_ObjDesc;
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
@ -173,6 +174,7 @@ static void OPT_OutObj (OPT_Object obj);
|
||||||
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
|
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
|
||||||
static void OPT_OutStr (OPT_Struct typ);
|
static void OPT_OutStr (OPT_Struct typ);
|
||||||
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
|
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
|
||||||
|
static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len);
|
||||||
export OPT_Struct OPT_SetType (INT32 size);
|
export OPT_Struct OPT_SetType (INT32 size);
|
||||||
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir);
|
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir);
|
||||||
export INT32 OPT_SizeAlignment (INT32 size);
|
export INT32 OPT_SizeAlignment (INT32 size);
|
||||||
|
|
@ -388,6 +390,10 @@ OPT_Object OPT_NewObj (void)
|
||||||
{
|
{
|
||||||
OPT_Object obj = NIL;
|
OPT_Object obj = NIL;
|
||||||
__NEW(obj, OPT_ObjDesc);
|
__NEW(obj, OPT_ObjDesc);
|
||||||
|
obj->typ = NIL;
|
||||||
|
obj->conval = NIL;
|
||||||
|
obj->comment = NIL;
|
||||||
|
obj->name[0] = 0x00;
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -554,6 +560,8 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
|
||||||
OPT_Object ob0 = NIL, ob1 = NIL;
|
OPT_Object ob0 = NIL, ob1 = NIL;
|
||||||
BOOLEAN left;
|
BOOLEAN left;
|
||||||
INT8 mnolev;
|
INT8 mnolev;
|
||||||
|
CHAR commentText[256];
|
||||||
|
INT16 j;
|
||||||
ob0 = OPT_topScope;
|
ob0 = OPT_topScope;
|
||||||
ob1 = ob0->right;
|
ob1 = ob0->right;
|
||||||
left = 0;
|
left = 0;
|
||||||
|
|
@ -585,6 +593,16 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
|
||||||
__COPY(name, ob1->name, 256);
|
__COPY(name, ob1->name, 256);
|
||||||
mnolev = OPT_topScope->mnolev;
|
mnolev = OPT_topScope->mnolev;
|
||||||
ob1->mnolev = mnolev;
|
ob1->mnolev = mnolev;
|
||||||
|
OPM_GetComment((void*)commentText, 256);
|
||||||
|
if (commentText[0] != 0x00) {
|
||||||
|
ob1->comment = __NEWARR(NIL, 1, 1, 1, 0, 256);
|
||||||
|
j = 0;
|
||||||
|
while ((j < 255 && commentText[__X(j, 256)] != 0x00)) {
|
||||||
|
(*ob1->comment)[__X(j, 256)] = commentText[__X(j, 256)];
|
||||||
|
j += 1;
|
||||||
|
}
|
||||||
|
(*ob1->comment)[__X(j, 256)] = 0x00;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1103,6 +1121,13 @@ static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par)
|
||||||
tag = OPM_SymRInt();
|
tag = OPM_SymRInt();
|
||||||
last = NIL;
|
last = NIL;
|
||||||
while (tag != 18) {
|
while (tag != 18) {
|
||||||
|
if (tag < 0 || tag > 100) {
|
||||||
|
OPM_LogWStr((CHAR*)"ERROR: Invalid tag value in InSign: ", 37);
|
||||||
|
OPM_LogWNum(tag, 0);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return;
|
||||||
|
}
|
||||||
new = OPT_NewObj();
|
new = OPT_NewObj();
|
||||||
new->mnolev = -mno;
|
new->mnolev = -mno;
|
||||||
if (last == NIL) {
|
if (last == NIL) {
|
||||||
|
|
@ -1381,7 +1406,37 @@ static OPT_Object OPT_InObj (INT8 mno)
|
||||||
OPT_Struct typ = NIL;
|
OPT_Struct typ = NIL;
|
||||||
INT32 tag;
|
INT32 tag;
|
||||||
OPT_ConstExt ext = NIL;
|
OPT_ConstExt ext = NIL;
|
||||||
|
OPS_Name commentText;
|
||||||
|
BOOLEAN hasComment;
|
||||||
|
INT16 j;
|
||||||
|
INT32 len;
|
||||||
tag = OPT_impCtxt.nextTag;
|
tag = OPT_impCtxt.nextTag;
|
||||||
|
hasComment = 0;
|
||||||
|
while (tag == 41) {
|
||||||
|
len = OPM_SymRInt();
|
||||||
|
if (len < 0) {
|
||||||
|
len = 0;
|
||||||
|
}
|
||||||
|
if (len > 255) {
|
||||||
|
len = 255;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while (i < len) {
|
||||||
|
OPM_SymRCh(&commentText[__X(i, 256)]);
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
commentText[__X(i, 256)] = 0x00;
|
||||||
|
hasComment = 1;
|
||||||
|
tag = OPM_SymRInt();
|
||||||
|
}
|
||||||
|
OPT_impCtxt.nextTag = tag;
|
||||||
|
if (tag < 0 || tag > 50) {
|
||||||
|
OPM_LogWStr((CHAR*)"ERROR: Invalid tag in InObj: ", 30);
|
||||||
|
OPM_LogWNum(tag, 0);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return NIL;
|
||||||
|
}
|
||||||
if (tag == 19) {
|
if (tag == 19) {
|
||||||
OPT_InStruct(&typ);
|
OPT_InStruct(&typ);
|
||||||
obj = typ->strobj;
|
obj = typ->strobj;
|
||||||
|
|
@ -1397,7 +1452,7 @@ static OPT_Object OPT_InObj (INT8 mno)
|
||||||
obj->conval = OPT_NewConst();
|
obj->conval = OPT_NewConst();
|
||||||
OPT_InConstant(tag, obj->conval);
|
OPT_InConstant(tag, obj->conval);
|
||||||
obj->typ = OPT_InTyp(tag);
|
obj->typ = OPT_InTyp(tag);
|
||||||
} else if (tag >= 31) {
|
} else if ((tag >= 31 && tag <= 33)) {
|
||||||
obj->conval = OPT_NewConst();
|
obj->conval = OPT_NewConst();
|
||||||
obj->conval->intval = -1;
|
obj->conval->intval = -1;
|
||||||
OPT_InSign(mno, &obj->typ, &obj->link);
|
OPT_InSign(mno, &obj->typ, &obj->link);
|
||||||
|
|
@ -1424,20 +1479,37 @@ static OPT_Object OPT_InObj (INT8 mno)
|
||||||
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32);
|
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32);
|
||||||
OPM_LogWNum(tag, 0);
|
OPM_LogWNum(tag, 0);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return NIL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (tag == 20) {
|
} else if (tag == 20) {
|
||||||
obj->mode = 5;
|
obj->mode = 5;
|
||||||
OPT_InStruct(&obj->typ);
|
OPT_InStruct(&obj->typ);
|
||||||
} else {
|
} else if (tag == 21 || tag == 22) {
|
||||||
obj->mode = 1;
|
obj->mode = 1;
|
||||||
if (tag == 22) {
|
if (tag == 22) {
|
||||||
obj->vis = 2;
|
obj->vis = 2;
|
||||||
}
|
}
|
||||||
OPT_InStruct(&obj->typ);
|
OPT_InStruct(&obj->typ);
|
||||||
|
} else {
|
||||||
|
OPM_LogWStr((CHAR*)"ERROR: Unexpected tag in InObj: ", 33);
|
||||||
|
OPM_LogWNum(tag, 0);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return NIL;
|
||||||
}
|
}
|
||||||
OPT_InName((void*)obj->name, 256);
|
OPT_InName((void*)obj->name, 256);
|
||||||
}
|
}
|
||||||
|
if ((hasComment && obj != NIL)) {
|
||||||
|
obj->comment = __NEWARR(NIL, 1, 1, 1, 0, 256);
|
||||||
|
j = 0;
|
||||||
|
while ((((j < 255 && j < len)) && commentText[__X(j, 256)] != 0x00)) {
|
||||||
|
(*obj->comment)[__X(j, 256)] = commentText[__X(j, 256)];
|
||||||
|
j += 1;
|
||||||
|
}
|
||||||
|
(*obj->comment)[__X(j, 256)] = 0x00;
|
||||||
|
}
|
||||||
OPT_FPrintObj(obj);
|
OPT_FPrintObj(obj);
|
||||||
if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) {
|
if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) {
|
||||||
OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255);
|
OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255);
|
||||||
|
|
@ -1780,13 +1852,40 @@ static void OPT_OutConstant (OPT_Object obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len)
|
||||||
|
{
|
||||||
|
INT16 i;
|
||||||
|
__DUP(text, text__len, CHAR);
|
||||||
|
i = 0;
|
||||||
|
while ((i < 255 && text[__X(i, text__len)] != 0x00)) {
|
||||||
|
OPM_SymWCh(text[__X(i, text__len)]);
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
OPM_SymWCh(0x00);
|
||||||
|
__DEL(text);
|
||||||
|
}
|
||||||
|
|
||||||
static void OPT_OutObj (OPT_Object obj)
|
static void OPT_OutObj (OPT_Object obj)
|
||||||
{
|
{
|
||||||
INT16 i, j;
|
INT16 i, j;
|
||||||
OPT_ConstExt ext = NIL;
|
OPT_ConstExt ext = NIL;
|
||||||
|
INT16 k, l;
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPT_OutObj(obj->left);
|
OPT_OutObj(obj->left);
|
||||||
if (__IN(obj->mode, 0x06ea, 32)) {
|
if (__IN(obj->mode, 0x06ea, 32)) {
|
||||||
|
if (obj->comment != NIL) {
|
||||||
|
OPM_SymWInt(41);
|
||||||
|
k = 0;
|
||||||
|
while ((k < 255 && (*obj->comment)[__X(k, 256)] != 0x00)) {
|
||||||
|
k += 1;
|
||||||
|
}
|
||||||
|
OPM_SymWInt(k);
|
||||||
|
l = 0;
|
||||||
|
while (l < k) {
|
||||||
|
OPM_SymWCh((*obj->comment)[__X(l, 256)]);
|
||||||
|
l += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (obj->history == 4) {
|
if (obj->history == 4) {
|
||||||
OPT_FPrintErr(obj, 250);
|
OPT_FPrintErr(obj, 250);
|
||||||
} else if (obj->vis != 0) {
|
} else if (obj->vis != 0) {
|
||||||
|
|
@ -2026,7 +2125,7 @@ static void EnumPtrs(void (*P)(void*))
|
||||||
}
|
}
|
||||||
|
|
||||||
__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}};
|
__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}};
|
||||||
__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}};
|
__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 308), {0, 4, 8, 12, 284, 288, 304, -32}};
|
||||||
__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}};
|
__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}};
|
||||||
__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}};
|
__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}};
|
||||||
__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76,
|
__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPT__h
|
#ifndef OPT__h
|
||||||
#define OPT__h
|
#define OPT__h
|
||||||
|
|
@ -61,6 +61,7 @@ typedef
|
||||||
OPT_Const conval;
|
OPT_Const conval;
|
||||||
INT32 adr, linkadr;
|
INT32 adr, linkadr;
|
||||||
INT16 x;
|
INT16 x;
|
||||||
|
OPT_ConstExt comment;
|
||||||
} OPT_ObjDesc;
|
} OPT_ObjDesc;
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPV__h
|
#ifndef OPV__h
|
||||||
#define OPV__h
|
#define OPV__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Out__h
|
#ifndef Out__h
|
||||||
#define Out__h
|
#define Out__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Platform__h
|
#ifndef Platform__h
|
||||||
#define Platform__h
|
#define Platform__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Reals__h
|
#ifndef Reals__h
|
||||||
#define Reals__h
|
#define Reals__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Strings__h
|
#ifndef Strings__h
|
||||||
#define Strings__h
|
#define Strings__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Files.h"
|
#include "Files.h"
|
||||||
#include "Modules.h"
|
#include "Modules.h"
|
||||||
#include "Out.h"
|
|
||||||
#include "Reals.h"
|
#include "Reals.h"
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
@ -1810,7 +1809,6 @@ export void *Texts__init(void)
|
||||||
__DEFMOD;
|
__DEFMOD;
|
||||||
__MODULE_IMPORT(Files);
|
__MODULE_IMPORT(Files);
|
||||||
__MODULE_IMPORT(Modules);
|
__MODULE_IMPORT(Modules);
|
||||||
__MODULE_IMPORT(Out);
|
|
||||||
__MODULE_IMPORT(Reals);
|
__MODULE_IMPORT(Reals);
|
||||||
__REGMOD("Texts", EnumPtrs);
|
__REGMOD("Texts", EnumPtrs);
|
||||||
__INITYP(Texts_FontDesc, Texts_FontDesc, 0);
|
__INITYP(Texts_FontDesc, Texts_FontDesc, 0);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Texts__h
|
#ifndef Texts__h
|
||||||
#define Texts__h
|
#define Texts__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -34,6 +34,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len);
|
||||||
export void VT100_HVP (INT16 n, INT16 m);
|
export void VT100_HVP (INT16 n, INT16 m);
|
||||||
export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len);
|
export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len);
|
||||||
export void VT100_RCP (void);
|
export void VT100_RCP (void);
|
||||||
|
export void VT100_Reset (void);
|
||||||
static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end);
|
static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end);
|
||||||
export void VT100_SCP (void);
|
export void VT100_SCP (void);
|
||||||
export void VT100_SD (INT16 n);
|
export void VT100_SD (INT16 n);
|
||||||
|
|
@ -136,6 +137,15 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len)
|
||||||
__DEL(letter);
|
__DEL(letter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VT100_Reset (void)
|
||||||
|
{
|
||||||
|
CHAR cmd[6];
|
||||||
|
__COPY("\033", cmd, 6);
|
||||||
|
Strings_Append((CHAR*)"c", 2, (void*)cmd, 6);
|
||||||
|
Out_String(cmd, 6);
|
||||||
|
Out_Ln();
|
||||||
|
}
|
||||||
|
|
||||||
void VT100_CUU (INT16 n)
|
void VT100_CUU (INT16 n)
|
||||||
{
|
{
|
||||||
VT100_EscSeq(n, (CHAR*)"A", 2);
|
VT100_EscSeq(n, (CHAR*)"A", 2);
|
||||||
|
|
@ -256,6 +266,7 @@ export void *VT100__init(void)
|
||||||
__REGCMD("DECTCEMh", VT100_DECTCEMh);
|
__REGCMD("DECTCEMh", VT100_DECTCEMh);
|
||||||
__REGCMD("DECTCEMl", VT100_DECTCEMl);
|
__REGCMD("DECTCEMl", VT100_DECTCEMl);
|
||||||
__REGCMD("RCP", VT100_RCP);
|
__REGCMD("RCP", VT100_RCP);
|
||||||
|
__REGCMD("Reset", VT100_Reset);
|
||||||
__REGCMD("SCP", VT100_SCP);
|
__REGCMD("SCP", VT100_SCP);
|
||||||
/* BEGIN */
|
/* BEGIN */
|
||||||
__COPY("\033", VT100_CSI, 5);
|
__COPY("\033", VT100_CSI, 5);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef VT100__h
|
#ifndef VT100__h
|
||||||
#define VT100__h
|
#define VT100__h
|
||||||
|
|
@ -25,6 +25,7 @@ import void VT100_EL (INT16 n);
|
||||||
import void VT100_HVP (INT16 n, INT16 m);
|
import void VT100_HVP (INT16 n, INT16 m);
|
||||||
import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len);
|
import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len);
|
||||||
import void VT100_RCP (void);
|
import void VT100_RCP (void);
|
||||||
|
import void VT100_Reset (void);
|
||||||
import void VT100_SCP (void);
|
import void VT100_SCP (void);
|
||||||
import void VT100_SD (INT16 n);
|
import void VT100_SD (INT16 n);
|
||||||
import void VT100_SGR (INT16 n);
|
import void VT100_SGR (INT16 n);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -22,7 +22,7 @@ static extTools_CommandString extTools_CFLAGS;
|
||||||
|
|
||||||
|
|
||||||
export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len);
|
export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len);
|
||||||
static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len);
|
static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len);
|
||||||
export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len);
|
export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len);
|
||||||
static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len);
|
static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len);
|
||||||
|
|
||||||
|
|
@ -70,22 +70,26 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES
|
||||||
__DEL(cmd);
|
__DEL(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len)
|
static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len)
|
||||||
{
|
{
|
||||||
__COPY("gcc -fPIC -g", s, s__len);
|
__DUP(additionalopts, additionalopts__len, CHAR);
|
||||||
|
__COPY("gcc -fPIC -g -Wno-stringop-overflow", s, s__len);
|
||||||
Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len);
|
Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len);
|
||||||
Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len);
|
Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len);
|
||||||
Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len);
|
Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len);
|
||||||
|
Strings_Append(additionalopts, additionalopts__len, (void*)s, s__len);
|
||||||
|
Strings_Append((CHAR*)" ", 2, (void*)s, s__len);
|
||||||
Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096);
|
Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096);
|
||||||
Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len);
|
Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len);
|
||||||
Strings_Append((CHAR*)" ", 2, (void*)s, s__len);
|
Strings_Append((CHAR*)" ", 2, (void*)s, s__len);
|
||||||
|
__DEL(additionalopts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len)
|
void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len)
|
||||||
{
|
{
|
||||||
extTools_CommandString cmd;
|
extTools_CommandString cmd;
|
||||||
__DUP(moduleName, moduleName__len, CHAR);
|
__DUP(moduleName, moduleName__len, CHAR);
|
||||||
extTools_InitialiseCompilerCommand((void*)cmd, 4096);
|
extTools_InitialiseCompilerCommand((void*)cmd, 4096, (CHAR*)"", 1);
|
||||||
Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096);
|
Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096);
|
||||||
Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096);
|
Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096);
|
||||||
Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096);
|
Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096);
|
||||||
|
|
@ -97,10 +101,9 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati
|
||||||
{
|
{
|
||||||
extTools_CommandString cmd;
|
extTools_CommandString cmd;
|
||||||
__DUP(additionalopts, additionalopts__len, CHAR);
|
__DUP(additionalopts, additionalopts__len, CHAR);
|
||||||
extTools_InitialiseCompilerCommand((void*)cmd, 4096);
|
extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len);
|
||||||
Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096);
|
Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096);
|
||||||
Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096);
|
Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096);
|
||||||
Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096);
|
|
||||||
if (statically) {
|
if (statically) {
|
||||||
Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096);
|
Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef extTools__h
|
#ifndef extTools__h
|
||||||
#define extTools__h
|
#define extTools__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -19,6 +19,6 @@ export void *Configuration__init(void)
|
||||||
__DEFMOD;
|
__DEFMOD;
|
||||||
__REGMOD("Configuration", 0);
|
__REGMOD("Configuration", 0);
|
||||||
/* BEGIN */
|
/* BEGIN */
|
||||||
__MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
|
__MOVE("2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
|
||||||
__ENDMOD;
|
__ENDMOD;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Configuration__h
|
#ifndef Configuration__h
|
||||||
#define Configuration__h
|
#define Configuration__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -86,6 +86,7 @@ export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
|
||||||
export void Files_Purge (Files_File f);
|
export void Files_Purge (Files_File f);
|
||||||
export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
||||||
|
export void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
||||||
export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
||||||
export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
||||||
|
|
@ -634,6 +635,11 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
|
||||||
|
{
|
||||||
|
Files_Read(&*r, r__typ, &*x);
|
||||||
|
}
|
||||||
|
|
||||||
void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n)
|
void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n)
|
||||||
{
|
{
|
||||||
INT32 xpos, min, restInBuf, offset;
|
INT32 xpos, min, restInBuf, offset;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Files__h
|
#ifndef Files__h
|
||||||
#define Files__h
|
#define Files__h
|
||||||
|
|
@ -40,6 +40,7 @@ import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
|
||||||
import void Files_Purge (Files_File f);
|
import void Files_Purge (Files_File f);
|
||||||
import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
||||||
|
import void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
||||||
import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
||||||
import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
||||||
|
|
||||||
#ifndef Heap__h
|
#ifndef Heap__h
|
||||||
#define Heap__h
|
#define Heap__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Modules__h
|
#ifndef Modules__h
|
||||||
#define Modules__h
|
#define Modules__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -1626,6 +1626,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
if (x == y) {
|
if (x == y) {
|
||||||
} else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) {
|
} else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) {
|
||||||
} else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) {
|
} else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) {
|
||||||
|
OPB_err(113);
|
||||||
} else if (x->BaseTyp == OPT_chartyp) {
|
} else if (x->BaseTyp == OPT_chartyp) {
|
||||||
if (g == 8) {
|
if (g == 8) {
|
||||||
if (ynode->conval->intval2 > x->n) {
|
if (ynode->conval->intval2 > x->n) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPB__h
|
#ifndef OPB__h
|
||||||
#define OPB__h
|
#define OPB__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -618,31 +618,33 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
|
||||||
{
|
{
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPC_DefineTProcMacros(obj->left, &*empty);
|
OPC_DefineTProcMacros(obj->left, &*empty);
|
||||||
if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) {
|
if ((obj->mode == 13 && obj == OPC_BaseTProc(obj))) {
|
||||||
OPM_WriteString((CHAR*)"#define __", 11);
|
if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) {
|
||||||
OPC_Ident(obj);
|
OPM_WriteString((CHAR*)"#define __", 11);
|
||||||
OPC_DeclareParams(obj->link, 1);
|
OPC_Ident(obj);
|
||||||
OPM_WriteString((CHAR*)" __SEND(", 9);
|
OPC_DeclareParams(obj->link, 1);
|
||||||
if (obj->link->typ->form == 11) {
|
OPM_WriteString((CHAR*)" __SEND(", 9);
|
||||||
OPM_WriteString((CHAR*)"__TYPEOF(", 10);
|
if (obj->link->typ->form == 11) {
|
||||||
OPC_Ident(obj->link);
|
OPM_WriteString((CHAR*)"__TYPEOF(", 10);
|
||||||
|
OPC_Ident(obj->link);
|
||||||
|
OPM_Write(')');
|
||||||
|
} else {
|
||||||
|
OPC_Ident(obj->link);
|
||||||
|
OPM_WriteString((CHAR*)"__typ", 6);
|
||||||
|
}
|
||||||
|
OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16));
|
||||||
|
if (obj->typ == OPT_notyp) {
|
||||||
|
OPM_WriteString((CHAR*)"void", 5);
|
||||||
|
} else {
|
||||||
|
OPC_Ident(obj->typ->strobj);
|
||||||
|
}
|
||||||
|
OPM_WriteString((CHAR*)"(*)", 4);
|
||||||
|
OPC_AnsiParamList(obj->link, 0);
|
||||||
|
OPM_WriteString((CHAR*)", ", 3);
|
||||||
|
OPC_DeclareParams(obj->link, 1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
} else {
|
OPM_WriteLn();
|
||||||
OPC_Ident(obj->link);
|
|
||||||
OPM_WriteString((CHAR*)"__typ", 6);
|
|
||||||
}
|
}
|
||||||
OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16));
|
|
||||||
if (obj->typ == OPT_notyp) {
|
|
||||||
OPM_WriteString((CHAR*)"void", 5);
|
|
||||||
} else {
|
|
||||||
OPC_Ident(obj->typ->strobj);
|
|
||||||
}
|
|
||||||
OPM_WriteString((CHAR*)"(*)", 4);
|
|
||||||
OPC_AnsiParamList(obj->link, 0);
|
|
||||||
OPM_WriteString((CHAR*)", ", 3);
|
|
||||||
OPC_DeclareParams(obj->link, 1);
|
|
||||||
OPM_Write(')');
|
|
||||||
OPM_WriteLn();
|
|
||||||
}
|
}
|
||||||
OPC_DefineTProcMacros(obj->right, &*empty);
|
OPC_DefineTProcMacros(obj->right, &*empty);
|
||||||
}
|
}
|
||||||
|
|
@ -652,7 +654,7 @@ static void OPC_DefineType (OPT_Struct str)
|
||||||
{
|
{
|
||||||
OPT_Object obj = NIL, field = NIL, par = NIL;
|
OPT_Object obj = NIL, field = NIL, par = NIL;
|
||||||
BOOLEAN empty;
|
BOOLEAN empty;
|
||||||
if (OPM_currFile == 1 || str->ref < 255) {
|
if ((OPM_currFile == 1 || str->ref < 255) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) {
|
||||||
obj = str->strobj;
|
obj = str->strobj;
|
||||||
if (obj == NIL || OPC_Undefined(obj)) {
|
if (obj == NIL || OPC_Undefined(obj)) {
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
|
|
@ -719,6 +721,13 @@ static void OPC_DefineType (OPT_Struct str)
|
||||||
if (!empty) {
|
if (!empty) {
|
||||||
OPM_WriteLn();
|
OPM_WriteLn();
|
||||||
}
|
}
|
||||||
|
} else if ((obj->typ->form == 11 && obj->typ->BaseTyp->comp == 4)) {
|
||||||
|
empty = 1;
|
||||||
|
OPC_DeclareTProcs(obj->typ->BaseTyp->link, &empty);
|
||||||
|
OPC_DefineTProcMacros(obj->typ->BaseTyp->link, &empty);
|
||||||
|
if (!empty) {
|
||||||
|
OPM_WriteLn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPC__h
|
#ifndef OPC__h
|
||||||
#define OPC__h
|
#define OPC__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -19,6 +19,8 @@ typedef
|
||||||
CHAR OPM_FileName[32];
|
CHAR OPM_FileName[32];
|
||||||
|
|
||||||
|
|
||||||
|
static CHAR OPM_currentComment[256];
|
||||||
|
static BOOLEAN OPM_hasComment;
|
||||||
static CHAR OPM_SourceFileName[256];
|
static CHAR OPM_SourceFileName[256];
|
||||||
static CHAR OPM_GlobalModel[10];
|
static CHAR OPM_GlobalModel[10];
|
||||||
export CHAR OPM_Model[10];
|
export CHAR OPM_Model[10];
|
||||||
|
|
@ -59,6 +61,7 @@ static void OPM_FindInstallDir (void);
|
||||||
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos);
|
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos);
|
||||||
static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len);
|
static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len);
|
||||||
export void OPM_Get (CHAR *ch);
|
export void OPM_Get (CHAR *ch);
|
||||||
|
export void OPM_GetComment (CHAR *text, ADDRESS text__len);
|
||||||
export void OPM_Init (BOOLEAN *done);
|
export void OPM_Init (BOOLEAN *done);
|
||||||
export void OPM_InitOptions (void);
|
export void OPM_InitOptions (void);
|
||||||
export INT16 OPM_Integer (INT64 n);
|
export INT16 OPM_Integer (INT64 n);
|
||||||
|
|
@ -82,6 +85,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len);
|
||||||
static void OPM_ShowLine (INT64 pos);
|
static void OPM_ShowLine (INT64 pos);
|
||||||
export INT64 OPM_SignedMaximum (INT32 bytecount);
|
export INT64 OPM_SignedMaximum (INT32 bytecount);
|
||||||
export INT64 OPM_SignedMinimum (INT32 bytecount);
|
export INT64 OPM_SignedMinimum (INT32 bytecount);
|
||||||
|
export void OPM_StoreComment (CHAR *text, ADDRESS text__len);
|
||||||
export void OPM_SymRCh (CHAR *ch);
|
export void OPM_SymRCh (CHAR *ch);
|
||||||
export INT32 OPM_SymRInt (void);
|
export INT32 OPM_SymRInt (void);
|
||||||
export INT64 OPM_SymRInt64 (void);
|
export INT64 OPM_SymRInt64 (void);
|
||||||
|
|
@ -157,6 +161,36 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len)
|
||||||
__DEL(modname);
|
__DEL(modname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OPM_StoreComment (CHAR *text, ADDRESS text__len)
|
||||||
|
{
|
||||||
|
INT16 i;
|
||||||
|
__DUP(text, text__len, CHAR);
|
||||||
|
i = 0;
|
||||||
|
while ((i < 255 && text[__X(i, text__len)] != 0x00)) {
|
||||||
|
OPM_currentComment[__X(i, 256)] = text[__X(i, text__len)];
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
OPM_currentComment[__X(i, 256)] = 0x00;
|
||||||
|
OPM_hasComment = 1;
|
||||||
|
__DEL(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPM_GetComment (CHAR *text, ADDRESS text__len)
|
||||||
|
{
|
||||||
|
INT16 i;
|
||||||
|
if (OPM_hasComment) {
|
||||||
|
i = 0;
|
||||||
|
while ((((i < text__len && i < 256)) && OPM_currentComment[__X(i, 256)] != 0x00)) {
|
||||||
|
text[__X(i, text__len)] = OPM_currentComment[__X(i, 256)];
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
text[__X(i, text__len)] = 0x00;
|
||||||
|
OPM_hasComment = 0;
|
||||||
|
} else {
|
||||||
|
text[0] = 0x00;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
INT64 OPM_SignedMaximum (INT32 bytecount)
|
INT64 OPM_SignedMaximum (INT32 bytecount)
|
||||||
{
|
{
|
||||||
INT64 result;
|
INT64 result;
|
||||||
|
|
@ -763,7 +797,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done)
|
||||||
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0);
|
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0);
|
||||||
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag);
|
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag);
|
||||||
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver);
|
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver);
|
||||||
if (tag != 0xf7 || ver != 0x83) {
|
if (tag != 0xf7 || ver != 0x84) {
|
||||||
if (!__IN(4, OPM_Options, 32)) {
|
if (!__IN(4, OPM_Options, 32)) {
|
||||||
OPM_err(-306);
|
OPM_err(-306);
|
||||||
}
|
}
|
||||||
|
|
@ -834,7 +868,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len)
|
||||||
if (OPM_newSFile != NIL) {
|
if (OPM_newSFile != NIL) {
|
||||||
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0);
|
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0);
|
||||||
Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7);
|
Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7);
|
||||||
Files_Write(&OPM_newSF, Files_Rider__typ, 0x83);
|
Files_Write(&OPM_newSF, Files_Rider__typ, 0x84);
|
||||||
} else {
|
} else {
|
||||||
OPM_err(153);
|
OPM_err(153);
|
||||||
}
|
}
|
||||||
|
|
@ -1143,5 +1177,7 @@ export void *OPM__init(void)
|
||||||
OPM_MinReal = -OPM_MaxReal;
|
OPM_MinReal = -OPM_MaxReal;
|
||||||
OPM_MinLReal = -OPM_MaxLReal;
|
OPM_MinLReal = -OPM_MaxLReal;
|
||||||
OPM_FindInstallDir();
|
OPM_FindInstallDir();
|
||||||
|
OPM_hasComment = 0;
|
||||||
|
OPM_currentComment[0] = 0x00;
|
||||||
__ENDMOD;
|
__ENDMOD;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPM__h
|
#ifndef OPM__h
|
||||||
#define OPM__h
|
#define OPM__h
|
||||||
|
|
@ -30,6 +30,7 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val);
|
||||||
import void OPM_FPrintReal (INT32 *fp, REAL val);
|
import void OPM_FPrintReal (INT32 *fp, REAL val);
|
||||||
import void OPM_FPrintSet (INT32 *fp, UINT64 val);
|
import void OPM_FPrintSet (INT32 *fp, UINT64 val);
|
||||||
import void OPM_Get (CHAR *ch);
|
import void OPM_Get (CHAR *ch);
|
||||||
|
import void OPM_GetComment (CHAR *text, ADDRESS text__len);
|
||||||
import void OPM_Init (BOOLEAN *done);
|
import void OPM_Init (BOOLEAN *done);
|
||||||
import void OPM_InitOptions (void);
|
import void OPM_InitOptions (void);
|
||||||
import INT16 OPM_Integer (INT64 n);
|
import INT16 OPM_Integer (INT64 n);
|
||||||
|
|
@ -48,6 +49,7 @@ import BOOLEAN OPM_OpenPar (void);
|
||||||
import void OPM_RegisterNewSym (void);
|
import void OPM_RegisterNewSym (void);
|
||||||
import INT64 OPM_SignedMaximum (INT32 bytecount);
|
import INT64 OPM_SignedMaximum (INT32 bytecount);
|
||||||
import INT64 OPM_SignedMinimum (INT32 bytecount);
|
import INT64 OPM_SignedMinimum (INT32 bytecount);
|
||||||
|
import void OPM_StoreComment (CHAR *text, ADDRESS text__len);
|
||||||
import void OPM_SymRCh (CHAR *ch);
|
import void OPM_SymRCh (CHAR *ch);
|
||||||
import INT32 OPM_SymRInt (void);
|
import INT32 OPM_SymRInt (void);
|
||||||
import INT64 OPM_SymRInt64 (void);
|
import INT64 OPM_SymRInt64 (void);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPP__h
|
#ifndef OPP__h
|
||||||
#define OPP__h
|
#define OPP__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -279,32 +279,74 @@ static void Comment__2 (void);
|
||||||
|
|
||||||
static void Comment__2 (void)
|
static void Comment__2 (void)
|
||||||
{
|
{
|
||||||
|
BOOLEAN isExported;
|
||||||
|
CHAR commentText[256];
|
||||||
|
INT16 i, nestLevel;
|
||||||
|
CHAR prevCh, nextCh;
|
||||||
|
i = 0;
|
||||||
|
while (i <= 255) {
|
||||||
|
commentText[__X(i, 256)] = 0x00;
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
isExported = 0;
|
||||||
|
i = 0;
|
||||||
|
nestLevel = 1;
|
||||||
|
prevCh = 0x00;
|
||||||
OPM_Get(&OPS_ch);
|
OPM_Get(&OPS_ch);
|
||||||
for (;;) {
|
if (OPS_ch == '*') {
|
||||||
for (;;) {
|
isExported = 1;
|
||||||
while (OPS_ch == '(') {
|
OPM_Get(&OPS_ch);
|
||||||
|
if (OPS_ch == ')') {
|
||||||
|
commentText[0] = 0x00;
|
||||||
|
OPM_StoreComment(commentText, 256);
|
||||||
|
OPM_Get(&OPS_ch);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while ((nestLevel > 0 && OPS_ch != 0x00)) {
|
||||||
|
if ((prevCh == '(' && OPS_ch == '*')) {
|
||||||
|
nestLevel += 1;
|
||||||
|
prevCh = 0x00;
|
||||||
|
} else if ((prevCh == '*' && OPS_ch == ')')) {
|
||||||
|
nestLevel -= 1;
|
||||||
|
if (nestLevel == 0) {
|
||||||
OPM_Get(&OPS_ch);
|
OPM_Get(&OPS_ch);
|
||||||
if (OPS_ch == '*') {
|
} else {
|
||||||
Comment__2();
|
prevCh = 0x00;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) {
|
||||||
|
if (i < 255) {
|
||||||
|
commentText[__X(i, 256)] = prevCh;
|
||||||
|
i += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (OPS_ch == '*') {
|
prevCh = OPS_ch;
|
||||||
OPM_Get(&OPS_ch);
|
}
|
||||||
break;
|
if (nestLevel > 0) {
|
||||||
}
|
|
||||||
if (OPS_ch == 0x00) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
OPM_Get(&OPS_ch);
|
OPM_Get(&OPS_ch);
|
||||||
}
|
}
|
||||||
if (OPS_ch == ')') {
|
}
|
||||||
OPM_Get(&OPS_ch);
|
if (OPS_ch == 0x00) {
|
||||||
break;
|
OPS_err(5);
|
||||||
|
}
|
||||||
|
if ((((((isExported && nestLevel == 0)) && prevCh != 0x00)) && prevCh != '*')) {
|
||||||
|
if (i < 255) {
|
||||||
|
commentText[__X(i, 256)] = prevCh;
|
||||||
|
i += 1;
|
||||||
|
} else {
|
||||||
|
OPM_LogWStr((CHAR*)"Truncating final comment character", 35);
|
||||||
|
OPM_LogWLn();
|
||||||
}
|
}
|
||||||
if (OPS_ch == 0x00) {
|
}
|
||||||
OPS_err(5);
|
if (isExported) {
|
||||||
break;
|
if (i >= 256) {
|
||||||
|
OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30);
|
||||||
|
OPM_LogWLn();
|
||||||
|
i = 255;
|
||||||
}
|
}
|
||||||
|
commentText[__X(i, 256)] = 0x00;
|
||||||
|
OPM_StoreComment(commentText, 256);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPS__h
|
#ifndef OPS__h
|
||||||
#define OPS__h
|
#define OPS__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -83,6 +83,7 @@ typedef
|
||||||
OPT_Const conval;
|
OPT_Const conval;
|
||||||
INT32 adr, linkadr;
|
INT32 adr, linkadr;
|
||||||
INT16 x;
|
INT16 x;
|
||||||
|
OPT_ConstExt comment;
|
||||||
} OPT_ObjDesc;
|
} OPT_ObjDesc;
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
@ -173,6 +174,7 @@ static void OPT_OutObj (OPT_Object obj);
|
||||||
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
|
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
|
||||||
static void OPT_OutStr (OPT_Struct typ);
|
static void OPT_OutStr (OPT_Struct typ);
|
||||||
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
|
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
|
||||||
|
static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len);
|
||||||
export OPT_Struct OPT_SetType (INT32 size);
|
export OPT_Struct OPT_SetType (INT32 size);
|
||||||
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir);
|
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir);
|
||||||
export INT32 OPT_SizeAlignment (INT32 size);
|
export INT32 OPT_SizeAlignment (INT32 size);
|
||||||
|
|
@ -388,6 +390,10 @@ OPT_Object OPT_NewObj (void)
|
||||||
{
|
{
|
||||||
OPT_Object obj = NIL;
|
OPT_Object obj = NIL;
|
||||||
__NEW(obj, OPT_ObjDesc);
|
__NEW(obj, OPT_ObjDesc);
|
||||||
|
obj->typ = NIL;
|
||||||
|
obj->conval = NIL;
|
||||||
|
obj->comment = NIL;
|
||||||
|
obj->name[0] = 0x00;
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -554,6 +560,8 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
|
||||||
OPT_Object ob0 = NIL, ob1 = NIL;
|
OPT_Object ob0 = NIL, ob1 = NIL;
|
||||||
BOOLEAN left;
|
BOOLEAN left;
|
||||||
INT8 mnolev;
|
INT8 mnolev;
|
||||||
|
CHAR commentText[256];
|
||||||
|
INT16 j;
|
||||||
ob0 = OPT_topScope;
|
ob0 = OPT_topScope;
|
||||||
ob1 = ob0->right;
|
ob1 = ob0->right;
|
||||||
left = 0;
|
left = 0;
|
||||||
|
|
@ -585,6 +593,16 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
|
||||||
__COPY(name, ob1->name, 256);
|
__COPY(name, ob1->name, 256);
|
||||||
mnolev = OPT_topScope->mnolev;
|
mnolev = OPT_topScope->mnolev;
|
||||||
ob1->mnolev = mnolev;
|
ob1->mnolev = mnolev;
|
||||||
|
OPM_GetComment((void*)commentText, 256);
|
||||||
|
if (commentText[0] != 0x00) {
|
||||||
|
ob1->comment = __NEWARR(NIL, 1, 1, 1, 0, 256);
|
||||||
|
j = 0;
|
||||||
|
while ((j < 255 && commentText[__X(j, 256)] != 0x00)) {
|
||||||
|
(*ob1->comment)[__X(j, 256)] = commentText[__X(j, 256)];
|
||||||
|
j += 1;
|
||||||
|
}
|
||||||
|
(*ob1->comment)[__X(j, 256)] = 0x00;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1103,6 +1121,13 @@ static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par)
|
||||||
tag = OPM_SymRInt();
|
tag = OPM_SymRInt();
|
||||||
last = NIL;
|
last = NIL;
|
||||||
while (tag != 18) {
|
while (tag != 18) {
|
||||||
|
if (tag < 0 || tag > 100) {
|
||||||
|
OPM_LogWStr((CHAR*)"ERROR: Invalid tag value in InSign: ", 37);
|
||||||
|
OPM_LogWNum(tag, 0);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return;
|
||||||
|
}
|
||||||
new = OPT_NewObj();
|
new = OPT_NewObj();
|
||||||
new->mnolev = -mno;
|
new->mnolev = -mno;
|
||||||
if (last == NIL) {
|
if (last == NIL) {
|
||||||
|
|
@ -1381,7 +1406,37 @@ static OPT_Object OPT_InObj (INT8 mno)
|
||||||
OPT_Struct typ = NIL;
|
OPT_Struct typ = NIL;
|
||||||
INT32 tag;
|
INT32 tag;
|
||||||
OPT_ConstExt ext = NIL;
|
OPT_ConstExt ext = NIL;
|
||||||
|
OPS_Name commentText;
|
||||||
|
BOOLEAN hasComment;
|
||||||
|
INT16 j;
|
||||||
|
INT32 len;
|
||||||
tag = OPT_impCtxt.nextTag;
|
tag = OPT_impCtxt.nextTag;
|
||||||
|
hasComment = 0;
|
||||||
|
while (tag == 41) {
|
||||||
|
len = OPM_SymRInt();
|
||||||
|
if (len < 0) {
|
||||||
|
len = 0;
|
||||||
|
}
|
||||||
|
if (len > 255) {
|
||||||
|
len = 255;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while (i < len) {
|
||||||
|
OPM_SymRCh(&commentText[__X(i, 256)]);
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
commentText[__X(i, 256)] = 0x00;
|
||||||
|
hasComment = 1;
|
||||||
|
tag = OPM_SymRInt();
|
||||||
|
}
|
||||||
|
OPT_impCtxt.nextTag = tag;
|
||||||
|
if (tag < 0 || tag > 50) {
|
||||||
|
OPM_LogWStr((CHAR*)"ERROR: Invalid tag in InObj: ", 30);
|
||||||
|
OPM_LogWNum(tag, 0);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return NIL;
|
||||||
|
}
|
||||||
if (tag == 19) {
|
if (tag == 19) {
|
||||||
OPT_InStruct(&typ);
|
OPT_InStruct(&typ);
|
||||||
obj = typ->strobj;
|
obj = typ->strobj;
|
||||||
|
|
@ -1397,7 +1452,7 @@ static OPT_Object OPT_InObj (INT8 mno)
|
||||||
obj->conval = OPT_NewConst();
|
obj->conval = OPT_NewConst();
|
||||||
OPT_InConstant(tag, obj->conval);
|
OPT_InConstant(tag, obj->conval);
|
||||||
obj->typ = OPT_InTyp(tag);
|
obj->typ = OPT_InTyp(tag);
|
||||||
} else if (tag >= 31) {
|
} else if ((tag >= 31 && tag <= 33)) {
|
||||||
obj->conval = OPT_NewConst();
|
obj->conval = OPT_NewConst();
|
||||||
obj->conval->intval = -1;
|
obj->conval->intval = -1;
|
||||||
OPT_InSign(mno, &obj->typ, &obj->link);
|
OPT_InSign(mno, &obj->typ, &obj->link);
|
||||||
|
|
@ -1424,20 +1479,37 @@ static OPT_Object OPT_InObj (INT8 mno)
|
||||||
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32);
|
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32);
|
||||||
OPM_LogWNum(tag, 0);
|
OPM_LogWNum(tag, 0);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return NIL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (tag == 20) {
|
} else if (tag == 20) {
|
||||||
obj->mode = 5;
|
obj->mode = 5;
|
||||||
OPT_InStruct(&obj->typ);
|
OPT_InStruct(&obj->typ);
|
||||||
} else {
|
} else if (tag == 21 || tag == 22) {
|
||||||
obj->mode = 1;
|
obj->mode = 1;
|
||||||
if (tag == 22) {
|
if (tag == 22) {
|
||||||
obj->vis = 2;
|
obj->vis = 2;
|
||||||
}
|
}
|
||||||
OPT_InStruct(&obj->typ);
|
OPT_InStruct(&obj->typ);
|
||||||
|
} else {
|
||||||
|
OPM_LogWStr((CHAR*)"ERROR: Unexpected tag in InObj: ", 33);
|
||||||
|
OPM_LogWNum(tag, 0);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return NIL;
|
||||||
}
|
}
|
||||||
OPT_InName((void*)obj->name, 256);
|
OPT_InName((void*)obj->name, 256);
|
||||||
}
|
}
|
||||||
|
if ((hasComment && obj != NIL)) {
|
||||||
|
obj->comment = __NEWARR(NIL, 1, 1, 1, 0, 256);
|
||||||
|
j = 0;
|
||||||
|
while ((((j < 255 && j < len)) && commentText[__X(j, 256)] != 0x00)) {
|
||||||
|
(*obj->comment)[__X(j, 256)] = commentText[__X(j, 256)];
|
||||||
|
j += 1;
|
||||||
|
}
|
||||||
|
(*obj->comment)[__X(j, 256)] = 0x00;
|
||||||
|
}
|
||||||
OPT_FPrintObj(obj);
|
OPT_FPrintObj(obj);
|
||||||
if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) {
|
if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) {
|
||||||
OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255);
|
OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255);
|
||||||
|
|
@ -1780,13 +1852,40 @@ static void OPT_OutConstant (OPT_Object obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len)
|
||||||
|
{
|
||||||
|
INT16 i;
|
||||||
|
__DUP(text, text__len, CHAR);
|
||||||
|
i = 0;
|
||||||
|
while ((i < 255 && text[__X(i, text__len)] != 0x00)) {
|
||||||
|
OPM_SymWCh(text[__X(i, text__len)]);
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
OPM_SymWCh(0x00);
|
||||||
|
__DEL(text);
|
||||||
|
}
|
||||||
|
|
||||||
static void OPT_OutObj (OPT_Object obj)
|
static void OPT_OutObj (OPT_Object obj)
|
||||||
{
|
{
|
||||||
INT16 i, j;
|
INT16 i, j;
|
||||||
OPT_ConstExt ext = NIL;
|
OPT_ConstExt ext = NIL;
|
||||||
|
INT16 k, l;
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPT_OutObj(obj->left);
|
OPT_OutObj(obj->left);
|
||||||
if (__IN(obj->mode, 0x06ea, 32)) {
|
if (__IN(obj->mode, 0x06ea, 32)) {
|
||||||
|
if (obj->comment != NIL) {
|
||||||
|
OPM_SymWInt(41);
|
||||||
|
k = 0;
|
||||||
|
while ((k < 255 && (*obj->comment)[__X(k, 256)] != 0x00)) {
|
||||||
|
k += 1;
|
||||||
|
}
|
||||||
|
OPM_SymWInt(k);
|
||||||
|
l = 0;
|
||||||
|
while (l < k) {
|
||||||
|
OPM_SymWCh((*obj->comment)[__X(l, 256)]);
|
||||||
|
l += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (obj->history == 4) {
|
if (obj->history == 4) {
|
||||||
OPT_FPrintErr(obj, 250);
|
OPT_FPrintErr(obj, 250);
|
||||||
} else if (obj->vis != 0) {
|
} else if (obj->vis != 0) {
|
||||||
|
|
@ -2026,7 +2125,7 @@ static void EnumPtrs(void (*P)(void*))
|
||||||
}
|
}
|
||||||
|
|
||||||
__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}};
|
__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}};
|
||||||
__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}};
|
__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 308), {0, 4, 8, 12, 284, 288, 304, -32}};
|
||||||
__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}};
|
__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}};
|
||||||
__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}};
|
__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}};
|
||||||
__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76,
|
__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPT__h
|
#ifndef OPT__h
|
||||||
#define OPT__h
|
#define OPT__h
|
||||||
|
|
@ -61,6 +61,7 @@ typedef
|
||||||
OPT_Const conval;
|
OPT_Const conval;
|
||||||
INT32 adr, linkadr;
|
INT32 adr, linkadr;
|
||||||
INT16 x;
|
INT16 x;
|
||||||
|
OPT_ConstExt comment;
|
||||||
} OPT_ObjDesc;
|
} OPT_ObjDesc;
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPV__h
|
#ifndef OPV__h
|
||||||
#define OPV__h
|
#define OPV__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Out__h
|
#ifndef Out__h
|
||||||
#define Out__h
|
#define Out__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Platform__h
|
#ifndef Platform__h
|
||||||
#define Platform__h
|
#define Platform__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Reals__h
|
#ifndef Reals__h
|
||||||
#define Reals__h
|
#define Reals__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Strings__h
|
#ifndef Strings__h
|
||||||
#define Strings__h
|
#define Strings__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Files.h"
|
#include "Files.h"
|
||||||
#include "Modules.h"
|
#include "Modules.h"
|
||||||
#include "Out.h"
|
|
||||||
#include "Reals.h"
|
#include "Reals.h"
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
@ -1810,7 +1809,6 @@ export void *Texts__init(void)
|
||||||
__DEFMOD;
|
__DEFMOD;
|
||||||
__MODULE_IMPORT(Files);
|
__MODULE_IMPORT(Files);
|
||||||
__MODULE_IMPORT(Modules);
|
__MODULE_IMPORT(Modules);
|
||||||
__MODULE_IMPORT(Out);
|
|
||||||
__MODULE_IMPORT(Reals);
|
__MODULE_IMPORT(Reals);
|
||||||
__REGMOD("Texts", EnumPtrs);
|
__REGMOD("Texts", EnumPtrs);
|
||||||
__INITYP(Texts_FontDesc, Texts_FontDesc, 0);
|
__INITYP(Texts_FontDesc, Texts_FontDesc, 0);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Texts__h
|
#ifndef Texts__h
|
||||||
#define Texts__h
|
#define Texts__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -34,6 +34,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len);
|
||||||
export void VT100_HVP (INT16 n, INT16 m);
|
export void VT100_HVP (INT16 n, INT16 m);
|
||||||
export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len);
|
export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len);
|
||||||
export void VT100_RCP (void);
|
export void VT100_RCP (void);
|
||||||
|
export void VT100_Reset (void);
|
||||||
static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end);
|
static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end);
|
||||||
export void VT100_SCP (void);
|
export void VT100_SCP (void);
|
||||||
export void VT100_SD (INT16 n);
|
export void VT100_SD (INT16 n);
|
||||||
|
|
@ -136,6 +137,15 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len)
|
||||||
__DEL(letter);
|
__DEL(letter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VT100_Reset (void)
|
||||||
|
{
|
||||||
|
CHAR cmd[6];
|
||||||
|
__COPY("\033", cmd, 6);
|
||||||
|
Strings_Append((CHAR*)"c", 2, (void*)cmd, 6);
|
||||||
|
Out_String(cmd, 6);
|
||||||
|
Out_Ln();
|
||||||
|
}
|
||||||
|
|
||||||
void VT100_CUU (INT16 n)
|
void VT100_CUU (INT16 n)
|
||||||
{
|
{
|
||||||
VT100_EscSeq(n, (CHAR*)"A", 2);
|
VT100_EscSeq(n, (CHAR*)"A", 2);
|
||||||
|
|
@ -256,6 +266,7 @@ export void *VT100__init(void)
|
||||||
__REGCMD("DECTCEMh", VT100_DECTCEMh);
|
__REGCMD("DECTCEMh", VT100_DECTCEMh);
|
||||||
__REGCMD("DECTCEMl", VT100_DECTCEMl);
|
__REGCMD("DECTCEMl", VT100_DECTCEMl);
|
||||||
__REGCMD("RCP", VT100_RCP);
|
__REGCMD("RCP", VT100_RCP);
|
||||||
|
__REGCMD("Reset", VT100_Reset);
|
||||||
__REGCMD("SCP", VT100_SCP);
|
__REGCMD("SCP", VT100_SCP);
|
||||||
/* BEGIN */
|
/* BEGIN */
|
||||||
__COPY("\033", VT100_CSI, 5);
|
__COPY("\033", VT100_CSI, 5);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef VT100__h
|
#ifndef VT100__h
|
||||||
#define VT100__h
|
#define VT100__h
|
||||||
|
|
@ -25,6 +25,7 @@ import void VT100_EL (INT16 n);
|
||||||
import void VT100_HVP (INT16 n, INT16 m);
|
import void VT100_HVP (INT16 n, INT16 m);
|
||||||
import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len);
|
import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len);
|
||||||
import void VT100_RCP (void);
|
import void VT100_RCP (void);
|
||||||
|
import void VT100_Reset (void);
|
||||||
import void VT100_SCP (void);
|
import void VT100_SCP (void);
|
||||||
import void VT100_SD (INT16 n);
|
import void VT100_SD (INT16 n);
|
||||||
import void VT100_SGR (INT16 n);
|
import void VT100_SGR (INT16 n);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -22,7 +22,7 @@ static extTools_CommandString extTools_CFLAGS;
|
||||||
|
|
||||||
|
|
||||||
export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len);
|
export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len);
|
||||||
static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len);
|
static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len);
|
||||||
export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len);
|
export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len);
|
||||||
static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len);
|
static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len);
|
||||||
|
|
||||||
|
|
@ -70,22 +70,26 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES
|
||||||
__DEL(cmd);
|
__DEL(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len)
|
static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len)
|
||||||
{
|
{
|
||||||
__COPY("gcc -fPIC -g", s, s__len);
|
__DUP(additionalopts, additionalopts__len, CHAR);
|
||||||
|
__COPY("gcc -fPIC -g -Wno-stringop-overflow", s, s__len);
|
||||||
Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len);
|
Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len);
|
||||||
Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len);
|
Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len);
|
||||||
Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len);
|
Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len);
|
||||||
|
Strings_Append(additionalopts, additionalopts__len, (void*)s, s__len);
|
||||||
|
Strings_Append((CHAR*)" ", 2, (void*)s, s__len);
|
||||||
Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096);
|
Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096);
|
||||||
Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len);
|
Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len);
|
||||||
Strings_Append((CHAR*)" ", 2, (void*)s, s__len);
|
Strings_Append((CHAR*)" ", 2, (void*)s, s__len);
|
||||||
|
__DEL(additionalopts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len)
|
void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len)
|
||||||
{
|
{
|
||||||
extTools_CommandString cmd;
|
extTools_CommandString cmd;
|
||||||
__DUP(moduleName, moduleName__len, CHAR);
|
__DUP(moduleName, moduleName__len, CHAR);
|
||||||
extTools_InitialiseCompilerCommand((void*)cmd, 4096);
|
extTools_InitialiseCompilerCommand((void*)cmd, 4096, (CHAR*)"", 1);
|
||||||
Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096);
|
Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096);
|
||||||
Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096);
|
Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096);
|
||||||
Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096);
|
Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096);
|
||||||
|
|
@ -97,10 +101,9 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati
|
||||||
{
|
{
|
||||||
extTools_CommandString cmd;
|
extTools_CommandString cmd;
|
||||||
__DUP(additionalopts, additionalopts__len, CHAR);
|
__DUP(additionalopts, additionalopts__len, CHAR);
|
||||||
extTools_InitialiseCompilerCommand((void*)cmd, 4096);
|
extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len);
|
||||||
Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096);
|
Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096);
|
||||||
Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096);
|
Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096);
|
||||||
Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096);
|
|
||||||
if (statically) {
|
if (statically) {
|
||||||
Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096);
|
Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef extTools__h
|
#ifndef extTools__h
|
||||||
#define extTools__h
|
#define extTools__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -19,6 +19,6 @@ export void *Configuration__init(void)
|
||||||
__DEFMOD;
|
__DEFMOD;
|
||||||
__REGMOD("Configuration", 0);
|
__REGMOD("Configuration", 0);
|
||||||
/* BEGIN */
|
/* BEGIN */
|
||||||
__MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
|
__MOVE("2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
|
||||||
__ENDMOD;
|
__ENDMOD;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Configuration__h
|
#ifndef Configuration__h
|
||||||
#define Configuration__h
|
#define Configuration__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -86,6 +86,7 @@ export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
|
||||||
export void Files_Purge (Files_File f);
|
export void Files_Purge (Files_File f);
|
||||||
export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
||||||
|
export void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
||||||
export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
||||||
export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
||||||
|
|
@ -634,6 +635,11 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
|
||||||
|
{
|
||||||
|
Files_Read(&*r, r__typ, &*x);
|
||||||
|
}
|
||||||
|
|
||||||
void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n)
|
void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n)
|
||||||
{
|
{
|
||||||
INT32 xpos, min, restInBuf, offset;
|
INT32 xpos, min, restInBuf, offset;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Files__h
|
#ifndef Files__h
|
||||||
#define Files__h
|
#define Files__h
|
||||||
|
|
@ -41,6 +41,7 @@ import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
|
||||||
import void Files_Purge (Files_File f);
|
import void Files_Purge (Files_File f);
|
||||||
import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
|
||||||
|
import void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
|
||||||
import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
|
||||||
import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
|
||||||
import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */
|
||||||
|
|
||||||
#ifndef Heap__h
|
#ifndef Heap__h
|
||||||
#define Heap__h
|
#define Heap__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef Modules__h
|
#ifndef Modules__h
|
||||||
#define Modules__h
|
#define Modules__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -1626,6 +1626,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
if (x == y) {
|
if (x == y) {
|
||||||
} else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) {
|
} else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) {
|
||||||
} else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) {
|
} else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) {
|
||||||
|
OPB_err(113);
|
||||||
} else if (x->BaseTyp == OPT_chartyp) {
|
} else if (x->BaseTyp == OPT_chartyp) {
|
||||||
if (g == 8) {
|
if (g == 8) {
|
||||||
if (ynode->conval->intval2 > x->n) {
|
if (ynode->conval->intval2 > x->n) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPB__h
|
#ifndef OPB__h
|
||||||
#define OPB__h
|
#define OPB__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -618,31 +618,33 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
|
||||||
{
|
{
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPC_DefineTProcMacros(obj->left, &*empty);
|
OPC_DefineTProcMacros(obj->left, &*empty);
|
||||||
if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) {
|
if ((obj->mode == 13 && obj == OPC_BaseTProc(obj))) {
|
||||||
OPM_WriteString((CHAR*)"#define __", 11);
|
if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) {
|
||||||
OPC_Ident(obj);
|
OPM_WriteString((CHAR*)"#define __", 11);
|
||||||
OPC_DeclareParams(obj->link, 1);
|
OPC_Ident(obj);
|
||||||
OPM_WriteString((CHAR*)" __SEND(", 9);
|
OPC_DeclareParams(obj->link, 1);
|
||||||
if (obj->link->typ->form == 11) {
|
OPM_WriteString((CHAR*)" __SEND(", 9);
|
||||||
OPM_WriteString((CHAR*)"__TYPEOF(", 10);
|
if (obj->link->typ->form == 11) {
|
||||||
OPC_Ident(obj->link);
|
OPM_WriteString((CHAR*)"__TYPEOF(", 10);
|
||||||
|
OPC_Ident(obj->link);
|
||||||
|
OPM_Write(')');
|
||||||
|
} else {
|
||||||
|
OPC_Ident(obj->link);
|
||||||
|
OPM_WriteString((CHAR*)"__typ", 6);
|
||||||
|
}
|
||||||
|
OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16));
|
||||||
|
if (obj->typ == OPT_notyp) {
|
||||||
|
OPM_WriteString((CHAR*)"void", 5);
|
||||||
|
} else {
|
||||||
|
OPC_Ident(obj->typ->strobj);
|
||||||
|
}
|
||||||
|
OPM_WriteString((CHAR*)"(*)", 4);
|
||||||
|
OPC_AnsiParamList(obj->link, 0);
|
||||||
|
OPM_WriteString((CHAR*)", ", 3);
|
||||||
|
OPC_DeclareParams(obj->link, 1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
} else {
|
OPM_WriteLn();
|
||||||
OPC_Ident(obj->link);
|
|
||||||
OPM_WriteString((CHAR*)"__typ", 6);
|
|
||||||
}
|
}
|
||||||
OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16));
|
|
||||||
if (obj->typ == OPT_notyp) {
|
|
||||||
OPM_WriteString((CHAR*)"void", 5);
|
|
||||||
} else {
|
|
||||||
OPC_Ident(obj->typ->strobj);
|
|
||||||
}
|
|
||||||
OPM_WriteString((CHAR*)"(*)", 4);
|
|
||||||
OPC_AnsiParamList(obj->link, 0);
|
|
||||||
OPM_WriteString((CHAR*)", ", 3);
|
|
||||||
OPC_DeclareParams(obj->link, 1);
|
|
||||||
OPM_Write(')');
|
|
||||||
OPM_WriteLn();
|
|
||||||
}
|
}
|
||||||
OPC_DefineTProcMacros(obj->right, &*empty);
|
OPC_DefineTProcMacros(obj->right, &*empty);
|
||||||
}
|
}
|
||||||
|
|
@ -652,7 +654,7 @@ static void OPC_DefineType (OPT_Struct str)
|
||||||
{
|
{
|
||||||
OPT_Object obj = NIL, field = NIL, par = NIL;
|
OPT_Object obj = NIL, field = NIL, par = NIL;
|
||||||
BOOLEAN empty;
|
BOOLEAN empty;
|
||||||
if (OPM_currFile == 1 || str->ref < 255) {
|
if ((OPM_currFile == 1 || str->ref < 255) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) {
|
||||||
obj = str->strobj;
|
obj = str->strobj;
|
||||||
if (obj == NIL || OPC_Undefined(obj)) {
|
if (obj == NIL || OPC_Undefined(obj)) {
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
|
|
@ -719,6 +721,13 @@ static void OPC_DefineType (OPT_Struct str)
|
||||||
if (!empty) {
|
if (!empty) {
|
||||||
OPM_WriteLn();
|
OPM_WriteLn();
|
||||||
}
|
}
|
||||||
|
} else if ((obj->typ->form == 11 && obj->typ->BaseTyp->comp == 4)) {
|
||||||
|
empty = 1;
|
||||||
|
OPC_DeclareTProcs(obj->typ->BaseTyp->link, &empty);
|
||||||
|
OPC_DefineTProcMacros(obj->typ->BaseTyp->link, &empty);
|
||||||
|
if (!empty) {
|
||||||
|
OPM_WriteLn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPC__h
|
#ifndef OPC__h
|
||||||
#define OPC__h
|
#define OPC__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -19,6 +19,8 @@ typedef
|
||||||
CHAR OPM_FileName[32];
|
CHAR OPM_FileName[32];
|
||||||
|
|
||||||
|
|
||||||
|
static CHAR OPM_currentComment[256];
|
||||||
|
static BOOLEAN OPM_hasComment;
|
||||||
static CHAR OPM_SourceFileName[256];
|
static CHAR OPM_SourceFileName[256];
|
||||||
static CHAR OPM_GlobalModel[10];
|
static CHAR OPM_GlobalModel[10];
|
||||||
export CHAR OPM_Model[10];
|
export CHAR OPM_Model[10];
|
||||||
|
|
@ -59,6 +61,7 @@ static void OPM_FindInstallDir (void);
|
||||||
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos);
|
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos);
|
||||||
static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len);
|
static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len);
|
||||||
export void OPM_Get (CHAR *ch);
|
export void OPM_Get (CHAR *ch);
|
||||||
|
export void OPM_GetComment (CHAR *text, ADDRESS text__len);
|
||||||
export void OPM_Init (BOOLEAN *done);
|
export void OPM_Init (BOOLEAN *done);
|
||||||
export void OPM_InitOptions (void);
|
export void OPM_InitOptions (void);
|
||||||
export INT16 OPM_Integer (INT64 n);
|
export INT16 OPM_Integer (INT64 n);
|
||||||
|
|
@ -82,6 +85,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len);
|
||||||
static void OPM_ShowLine (INT64 pos);
|
static void OPM_ShowLine (INT64 pos);
|
||||||
export INT64 OPM_SignedMaximum (INT32 bytecount);
|
export INT64 OPM_SignedMaximum (INT32 bytecount);
|
||||||
export INT64 OPM_SignedMinimum (INT32 bytecount);
|
export INT64 OPM_SignedMinimum (INT32 bytecount);
|
||||||
|
export void OPM_StoreComment (CHAR *text, ADDRESS text__len);
|
||||||
export void OPM_SymRCh (CHAR *ch);
|
export void OPM_SymRCh (CHAR *ch);
|
||||||
export INT32 OPM_SymRInt (void);
|
export INT32 OPM_SymRInt (void);
|
||||||
export INT64 OPM_SymRInt64 (void);
|
export INT64 OPM_SymRInt64 (void);
|
||||||
|
|
@ -157,6 +161,36 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len)
|
||||||
__DEL(modname);
|
__DEL(modname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OPM_StoreComment (CHAR *text, ADDRESS text__len)
|
||||||
|
{
|
||||||
|
INT16 i;
|
||||||
|
__DUP(text, text__len, CHAR);
|
||||||
|
i = 0;
|
||||||
|
while ((i < 255 && text[__X(i, text__len)] != 0x00)) {
|
||||||
|
OPM_currentComment[__X(i, 256)] = text[__X(i, text__len)];
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
OPM_currentComment[__X(i, 256)] = 0x00;
|
||||||
|
OPM_hasComment = 1;
|
||||||
|
__DEL(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPM_GetComment (CHAR *text, ADDRESS text__len)
|
||||||
|
{
|
||||||
|
INT16 i;
|
||||||
|
if (OPM_hasComment) {
|
||||||
|
i = 0;
|
||||||
|
while ((((i < text__len && i < 256)) && OPM_currentComment[__X(i, 256)] != 0x00)) {
|
||||||
|
text[__X(i, text__len)] = OPM_currentComment[__X(i, 256)];
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
text[__X(i, text__len)] = 0x00;
|
||||||
|
OPM_hasComment = 0;
|
||||||
|
} else {
|
||||||
|
text[0] = 0x00;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
INT64 OPM_SignedMaximum (INT32 bytecount)
|
INT64 OPM_SignedMaximum (INT32 bytecount)
|
||||||
{
|
{
|
||||||
INT64 result;
|
INT64 result;
|
||||||
|
|
@ -763,7 +797,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done)
|
||||||
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0);
|
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0);
|
||||||
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag);
|
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag);
|
||||||
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver);
|
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver);
|
||||||
if (tag != 0xf7 || ver != 0x83) {
|
if (tag != 0xf7 || ver != 0x84) {
|
||||||
if (!__IN(4, OPM_Options, 32)) {
|
if (!__IN(4, OPM_Options, 32)) {
|
||||||
OPM_err(-306);
|
OPM_err(-306);
|
||||||
}
|
}
|
||||||
|
|
@ -834,7 +868,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len)
|
||||||
if (OPM_newSFile != NIL) {
|
if (OPM_newSFile != NIL) {
|
||||||
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0);
|
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0);
|
||||||
Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7);
|
Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7);
|
||||||
Files_Write(&OPM_newSF, Files_Rider__typ, 0x83);
|
Files_Write(&OPM_newSF, Files_Rider__typ, 0x84);
|
||||||
} else {
|
} else {
|
||||||
OPM_err(153);
|
OPM_err(153);
|
||||||
}
|
}
|
||||||
|
|
@ -1143,5 +1177,7 @@ export void *OPM__init(void)
|
||||||
OPM_MinReal = -OPM_MaxReal;
|
OPM_MinReal = -OPM_MaxReal;
|
||||||
OPM_MinLReal = -OPM_MaxLReal;
|
OPM_MinLReal = -OPM_MaxLReal;
|
||||||
OPM_FindInstallDir();
|
OPM_FindInstallDir();
|
||||||
|
OPM_hasComment = 0;
|
||||||
|
OPM_currentComment[0] = 0x00;
|
||||||
__ENDMOD;
|
__ENDMOD;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPM__h
|
#ifndef OPM__h
|
||||||
#define OPM__h
|
#define OPM__h
|
||||||
|
|
@ -30,6 +30,7 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val);
|
||||||
import void OPM_FPrintReal (INT32 *fp, REAL val);
|
import void OPM_FPrintReal (INT32 *fp, REAL val);
|
||||||
import void OPM_FPrintSet (INT32 *fp, UINT64 val);
|
import void OPM_FPrintSet (INT32 *fp, UINT64 val);
|
||||||
import void OPM_Get (CHAR *ch);
|
import void OPM_Get (CHAR *ch);
|
||||||
|
import void OPM_GetComment (CHAR *text, ADDRESS text__len);
|
||||||
import void OPM_Init (BOOLEAN *done);
|
import void OPM_Init (BOOLEAN *done);
|
||||||
import void OPM_InitOptions (void);
|
import void OPM_InitOptions (void);
|
||||||
import INT16 OPM_Integer (INT64 n);
|
import INT16 OPM_Integer (INT64 n);
|
||||||
|
|
@ -48,6 +49,7 @@ import BOOLEAN OPM_OpenPar (void);
|
||||||
import void OPM_RegisterNewSym (void);
|
import void OPM_RegisterNewSym (void);
|
||||||
import INT64 OPM_SignedMaximum (INT32 bytecount);
|
import INT64 OPM_SignedMaximum (INT32 bytecount);
|
||||||
import INT64 OPM_SignedMinimum (INT32 bytecount);
|
import INT64 OPM_SignedMinimum (INT32 bytecount);
|
||||||
|
import void OPM_StoreComment (CHAR *text, ADDRESS text__len);
|
||||||
import void OPM_SymRCh (CHAR *ch);
|
import void OPM_SymRCh (CHAR *ch);
|
||||||
import INT32 OPM_SymRInt (void);
|
import INT32 OPM_SymRInt (void);
|
||||||
import INT64 OPM_SymRInt64 (void);
|
import INT64 OPM_SymRInt64 (void);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPP__h
|
#ifndef OPP__h
|
||||||
#define OPP__h
|
#define OPP__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -279,32 +279,74 @@ static void Comment__2 (void);
|
||||||
|
|
||||||
static void Comment__2 (void)
|
static void Comment__2 (void)
|
||||||
{
|
{
|
||||||
|
BOOLEAN isExported;
|
||||||
|
CHAR commentText[256];
|
||||||
|
INT16 i, nestLevel;
|
||||||
|
CHAR prevCh, nextCh;
|
||||||
|
i = 0;
|
||||||
|
while (i <= 255) {
|
||||||
|
commentText[__X(i, 256)] = 0x00;
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
isExported = 0;
|
||||||
|
i = 0;
|
||||||
|
nestLevel = 1;
|
||||||
|
prevCh = 0x00;
|
||||||
OPM_Get(&OPS_ch);
|
OPM_Get(&OPS_ch);
|
||||||
for (;;) {
|
if (OPS_ch == '*') {
|
||||||
for (;;) {
|
isExported = 1;
|
||||||
while (OPS_ch == '(') {
|
OPM_Get(&OPS_ch);
|
||||||
|
if (OPS_ch == ')') {
|
||||||
|
commentText[0] = 0x00;
|
||||||
|
OPM_StoreComment(commentText, 256);
|
||||||
|
OPM_Get(&OPS_ch);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while ((nestLevel > 0 && OPS_ch != 0x00)) {
|
||||||
|
if ((prevCh == '(' && OPS_ch == '*')) {
|
||||||
|
nestLevel += 1;
|
||||||
|
prevCh = 0x00;
|
||||||
|
} else if ((prevCh == '*' && OPS_ch == ')')) {
|
||||||
|
nestLevel -= 1;
|
||||||
|
if (nestLevel == 0) {
|
||||||
OPM_Get(&OPS_ch);
|
OPM_Get(&OPS_ch);
|
||||||
if (OPS_ch == '*') {
|
} else {
|
||||||
Comment__2();
|
prevCh = 0x00;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) {
|
||||||
|
if (i < 255) {
|
||||||
|
commentText[__X(i, 256)] = prevCh;
|
||||||
|
i += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (OPS_ch == '*') {
|
prevCh = OPS_ch;
|
||||||
OPM_Get(&OPS_ch);
|
}
|
||||||
break;
|
if (nestLevel > 0) {
|
||||||
}
|
|
||||||
if (OPS_ch == 0x00) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
OPM_Get(&OPS_ch);
|
OPM_Get(&OPS_ch);
|
||||||
}
|
}
|
||||||
if (OPS_ch == ')') {
|
}
|
||||||
OPM_Get(&OPS_ch);
|
if (OPS_ch == 0x00) {
|
||||||
break;
|
OPS_err(5);
|
||||||
|
}
|
||||||
|
if ((((((isExported && nestLevel == 0)) && prevCh != 0x00)) && prevCh != '*')) {
|
||||||
|
if (i < 255) {
|
||||||
|
commentText[__X(i, 256)] = prevCh;
|
||||||
|
i += 1;
|
||||||
|
} else {
|
||||||
|
OPM_LogWStr((CHAR*)"Truncating final comment character", 35);
|
||||||
|
OPM_LogWLn();
|
||||||
}
|
}
|
||||||
if (OPS_ch == 0x00) {
|
}
|
||||||
OPS_err(5);
|
if (isExported) {
|
||||||
break;
|
if (i >= 256) {
|
||||||
|
OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30);
|
||||||
|
OPM_LogWLn();
|
||||||
|
i = 255;
|
||||||
}
|
}
|
||||||
|
commentText[__X(i, 256)] = 0x00;
|
||||||
|
OPM_StoreComment(commentText, 256);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPS__h
|
#ifndef OPS__h
|
||||||
#define OPS__h
|
#define OPS__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#define SHORTINT INT8
|
#define SHORTINT INT8
|
||||||
#define INTEGER INT16
|
#define INTEGER INT16
|
||||||
|
|
@ -83,6 +83,7 @@ typedef
|
||||||
OPT_Const conval;
|
OPT_Const conval;
|
||||||
INT32 adr, linkadr;
|
INT32 adr, linkadr;
|
||||||
INT16 x;
|
INT16 x;
|
||||||
|
OPT_ConstExt comment;
|
||||||
} OPT_ObjDesc;
|
} OPT_ObjDesc;
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
@ -173,6 +174,7 @@ static void OPT_OutObj (OPT_Object obj);
|
||||||
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
|
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
|
||||||
static void OPT_OutStr (OPT_Struct typ);
|
static void OPT_OutStr (OPT_Struct typ);
|
||||||
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
|
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
|
||||||
|
static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len);
|
||||||
export OPT_Struct OPT_SetType (INT32 size);
|
export OPT_Struct OPT_SetType (INT32 size);
|
||||||
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir);
|
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir);
|
||||||
export INT32 OPT_SizeAlignment (INT32 size);
|
export INT32 OPT_SizeAlignment (INT32 size);
|
||||||
|
|
@ -388,6 +390,10 @@ OPT_Object OPT_NewObj (void)
|
||||||
{
|
{
|
||||||
OPT_Object obj = NIL;
|
OPT_Object obj = NIL;
|
||||||
__NEW(obj, OPT_ObjDesc);
|
__NEW(obj, OPT_ObjDesc);
|
||||||
|
obj->typ = NIL;
|
||||||
|
obj->conval = NIL;
|
||||||
|
obj->comment = NIL;
|
||||||
|
obj->name[0] = 0x00;
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -554,6 +560,8 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
|
||||||
OPT_Object ob0 = NIL, ob1 = NIL;
|
OPT_Object ob0 = NIL, ob1 = NIL;
|
||||||
BOOLEAN left;
|
BOOLEAN left;
|
||||||
INT8 mnolev;
|
INT8 mnolev;
|
||||||
|
CHAR commentText[256];
|
||||||
|
INT16 j;
|
||||||
ob0 = OPT_topScope;
|
ob0 = OPT_topScope;
|
||||||
ob1 = ob0->right;
|
ob1 = ob0->right;
|
||||||
left = 0;
|
left = 0;
|
||||||
|
|
@ -585,6 +593,16 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
|
||||||
__COPY(name, ob1->name, 256);
|
__COPY(name, ob1->name, 256);
|
||||||
mnolev = OPT_topScope->mnolev;
|
mnolev = OPT_topScope->mnolev;
|
||||||
ob1->mnolev = mnolev;
|
ob1->mnolev = mnolev;
|
||||||
|
OPM_GetComment((void*)commentText, 256);
|
||||||
|
if (commentText[0] != 0x00) {
|
||||||
|
ob1->comment = __NEWARR(NIL, 1, 1, 1, 0, ((INT64)(256)));
|
||||||
|
j = 0;
|
||||||
|
while ((j < 255 && commentText[__X(j, 256)] != 0x00)) {
|
||||||
|
(*ob1->comment)[__X(j, 256)] = commentText[__X(j, 256)];
|
||||||
|
j += 1;
|
||||||
|
}
|
||||||
|
(*ob1->comment)[__X(j, 256)] = 0x00;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1103,6 +1121,13 @@ static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par)
|
||||||
tag = OPM_SymRInt();
|
tag = OPM_SymRInt();
|
||||||
last = NIL;
|
last = NIL;
|
||||||
while (tag != 18) {
|
while (tag != 18) {
|
||||||
|
if (tag < 0 || tag > 100) {
|
||||||
|
OPM_LogWStr((CHAR*)"ERROR: Invalid tag value in InSign: ", 37);
|
||||||
|
OPM_LogWNum(tag, 0);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return;
|
||||||
|
}
|
||||||
new = OPT_NewObj();
|
new = OPT_NewObj();
|
||||||
new->mnolev = -mno;
|
new->mnolev = -mno;
|
||||||
if (last == NIL) {
|
if (last == NIL) {
|
||||||
|
|
@ -1381,7 +1406,37 @@ static OPT_Object OPT_InObj (INT8 mno)
|
||||||
OPT_Struct typ = NIL;
|
OPT_Struct typ = NIL;
|
||||||
INT32 tag;
|
INT32 tag;
|
||||||
OPT_ConstExt ext = NIL;
|
OPT_ConstExt ext = NIL;
|
||||||
|
OPS_Name commentText;
|
||||||
|
BOOLEAN hasComment;
|
||||||
|
INT16 j;
|
||||||
|
INT32 len;
|
||||||
tag = OPT_impCtxt.nextTag;
|
tag = OPT_impCtxt.nextTag;
|
||||||
|
hasComment = 0;
|
||||||
|
while (tag == 41) {
|
||||||
|
len = OPM_SymRInt();
|
||||||
|
if (len < 0) {
|
||||||
|
len = 0;
|
||||||
|
}
|
||||||
|
if (len > 255) {
|
||||||
|
len = 255;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while (i < len) {
|
||||||
|
OPM_SymRCh(&commentText[__X(i, 256)]);
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
commentText[__X(i, 256)] = 0x00;
|
||||||
|
hasComment = 1;
|
||||||
|
tag = OPM_SymRInt();
|
||||||
|
}
|
||||||
|
OPT_impCtxt.nextTag = tag;
|
||||||
|
if (tag < 0 || tag > 50) {
|
||||||
|
OPM_LogWStr((CHAR*)"ERROR: Invalid tag in InObj: ", 30);
|
||||||
|
OPM_LogWNum(tag, 0);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return NIL;
|
||||||
|
}
|
||||||
if (tag == 19) {
|
if (tag == 19) {
|
||||||
OPT_InStruct(&typ);
|
OPT_InStruct(&typ);
|
||||||
obj = typ->strobj;
|
obj = typ->strobj;
|
||||||
|
|
@ -1397,7 +1452,7 @@ static OPT_Object OPT_InObj (INT8 mno)
|
||||||
obj->conval = OPT_NewConst();
|
obj->conval = OPT_NewConst();
|
||||||
OPT_InConstant(tag, obj->conval);
|
OPT_InConstant(tag, obj->conval);
|
||||||
obj->typ = OPT_InTyp(tag);
|
obj->typ = OPT_InTyp(tag);
|
||||||
} else if (tag >= 31) {
|
} else if ((tag >= 31 && tag <= 33)) {
|
||||||
obj->conval = OPT_NewConst();
|
obj->conval = OPT_NewConst();
|
||||||
obj->conval->intval = -1;
|
obj->conval->intval = -1;
|
||||||
OPT_InSign(mno, &obj->typ, &obj->link);
|
OPT_InSign(mno, &obj->typ, &obj->link);
|
||||||
|
|
@ -1424,20 +1479,37 @@ static OPT_Object OPT_InObj (INT8 mno)
|
||||||
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32);
|
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32);
|
||||||
OPM_LogWNum(tag, 0);
|
OPM_LogWNum(tag, 0);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return NIL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (tag == 20) {
|
} else if (tag == 20) {
|
||||||
obj->mode = 5;
|
obj->mode = 5;
|
||||||
OPT_InStruct(&obj->typ);
|
OPT_InStruct(&obj->typ);
|
||||||
} else {
|
} else if (tag == 21 || tag == 22) {
|
||||||
obj->mode = 1;
|
obj->mode = 1;
|
||||||
if (tag == 22) {
|
if (tag == 22) {
|
||||||
obj->vis = 2;
|
obj->vis = 2;
|
||||||
}
|
}
|
||||||
OPT_InStruct(&obj->typ);
|
OPT_InStruct(&obj->typ);
|
||||||
|
} else {
|
||||||
|
OPM_LogWStr((CHAR*)"ERROR: Unexpected tag in InObj: ", 33);
|
||||||
|
OPM_LogWNum(tag, 0);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_err(155);
|
||||||
|
return NIL;
|
||||||
}
|
}
|
||||||
OPT_InName((void*)obj->name, 256);
|
OPT_InName((void*)obj->name, 256);
|
||||||
}
|
}
|
||||||
|
if ((hasComment && obj != NIL)) {
|
||||||
|
obj->comment = __NEWARR(NIL, 1, 1, 1, 0, ((INT64)(256)));
|
||||||
|
j = 0;
|
||||||
|
while ((((j < 255 && j < len)) && commentText[__X(j, 256)] != 0x00)) {
|
||||||
|
(*obj->comment)[__X(j, 256)] = commentText[__X(j, 256)];
|
||||||
|
j += 1;
|
||||||
|
}
|
||||||
|
(*obj->comment)[__X(j, 256)] = 0x00;
|
||||||
|
}
|
||||||
OPT_FPrintObj(obj);
|
OPT_FPrintObj(obj);
|
||||||
if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) {
|
if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) {
|
||||||
OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255);
|
OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255);
|
||||||
|
|
@ -1780,13 +1852,40 @@ static void OPT_OutConstant (OPT_Object obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len)
|
||||||
|
{
|
||||||
|
INT16 i;
|
||||||
|
__DUP(text, text__len, CHAR);
|
||||||
|
i = 0;
|
||||||
|
while ((i < 255 && text[__X(i, text__len)] != 0x00)) {
|
||||||
|
OPM_SymWCh(text[__X(i, text__len)]);
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
OPM_SymWCh(0x00);
|
||||||
|
__DEL(text);
|
||||||
|
}
|
||||||
|
|
||||||
static void OPT_OutObj (OPT_Object obj)
|
static void OPT_OutObj (OPT_Object obj)
|
||||||
{
|
{
|
||||||
INT16 i, j;
|
INT16 i, j;
|
||||||
OPT_ConstExt ext = NIL;
|
OPT_ConstExt ext = NIL;
|
||||||
|
INT16 k, l;
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPT_OutObj(obj->left);
|
OPT_OutObj(obj->left);
|
||||||
if (__IN(obj->mode, 0x06ea, 32)) {
|
if (__IN(obj->mode, 0x06ea, 32)) {
|
||||||
|
if (obj->comment != NIL) {
|
||||||
|
OPM_SymWInt(41);
|
||||||
|
k = 0;
|
||||||
|
while ((k < 255 && (*obj->comment)[__X(k, 256)] != 0x00)) {
|
||||||
|
k += 1;
|
||||||
|
}
|
||||||
|
OPM_SymWInt(k);
|
||||||
|
l = 0;
|
||||||
|
while (l < k) {
|
||||||
|
OPM_SymWCh((*obj->comment)[__X(l, 256)]);
|
||||||
|
l += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (obj->history == 4) {
|
if (obj->history == 4) {
|
||||||
OPT_FPrintErr(obj, 250);
|
OPT_FPrintErr(obj, 250);
|
||||||
} else if (obj->vis != 0) {
|
} else if (obj->vis != 0) {
|
||||||
|
|
@ -2026,7 +2125,7 @@ static void EnumPtrs(void (*P)(void*))
|
||||||
}
|
}
|
||||||
|
|
||||||
__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}};
|
__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}};
|
||||||
__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}};
|
__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, 336, -64}};
|
||||||
__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}};
|
__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}};
|
||||||
__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}};
|
__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}};
|
||||||
__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 5184), {16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136,
|
__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 5184), {16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
|
||||||
|
|
||||||
#ifndef OPT__h
|
#ifndef OPT__h
|
||||||
#define OPT__h
|
#define OPT__h
|
||||||
|
|
@ -61,6 +61,7 @@ typedef
|
||||||
OPT_Const conval;
|
OPT_Const conval;
|
||||||
INT32 adr, linkadr;
|
INT32 adr, linkadr;
|
||||||
INT16 x;
|
INT16 x;
|
||||||
|
OPT_ConstExt comment;
|
||||||
} OPT_ObjDesc;
|
} OPT_ObjDesc;
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue