Compare commits

..

59 commits

Author SHA1 Message Date
Norayr Chilingarian
65baeb77a9
Merge pull request #113 from robdaemon/fix-gcc-15
Fixes build problems on gcc 15
2026-02-04 12:51:31 +04:00
Robert Roland
9fce469f23 Fixes build problems on gcc 15
GCC 15 changes the C language standard to gnu23, and VOC compiles just fine on gnu11.

Tested against GCC 15 and GCC 14.
2026-02-03 17:43:38 -08:00
Norayr Chilingarian
84516b2ac6 prevents orphaned or misplaced comments from being written to symbol
files.
2025-07-19 05:56:37 +04:00
Norayr Chilingarian
a517a42357 comments length increased, multiline comments are also now possible. 2025-07-19 05:48:27 +04:00
Norayr Chilingarian
50b5a1438e better handling of faulty symbol files. ethStrings comments fixed. 2025-07-19 05:13:09 +04:00
Norayr Chilingarian
fa9e73f7af adapted Base64 file from Oberon S3. 2025-07-10 23:08:59 +04:00
Norayr Chilingarian
a9465ccfc6 bootstrap sources. 2025-06-24 18:27:35 +04:00
Norayr Chilingarian
dac6504f12 comments in symbol files, viewable by showdef browser. 2025-06-24 17:44:19 +04:00
Norayr Chilingarian
2f1ce08aff should fix type-bound procedure name mismatch between calls and definitions 2025-06-14 17:12:48 +04:00
Carlos Une
28c327be28 Math, MathL: add procedure fcmp 2025-05-08 15:48:46 +04:00
Norayr Chilingarian
94683df1d8
Merge pull request #111 from InnaKhachikyan/master
modified Index checking to handle run-time variable index containing …
2025-04-23 02:46:44 +04:00
Inna Khachikyan
f0e92c7434 modified Index checking to handle run-time variable index containing negative value 2025-04-17 23:44:56 +04:00
Norayr Chilingarian
71488ffe85
Merge pull request #110 from rbmk-plus/master
add ctags, fix dead links, and other minor fixes
2025-04-04 18:13:57 +00:00
sevoves
378de43274 rewording doc/ctags.md 2025-04-04 22:00:31 +04:00
sevoves
1fbbb68dc7 rewording ctags doc 2025-04-04 21:56:16 +04:00
sevoves
9846292b85 minor changes in docs 2025-04-04 21:51:30 +04:00
sevoves
bb7a731197 small change in ctags.md 2025-04-04 21:44:46 +04:00
sevoves
7dafb02d1e add ctags doc 2025-04-04 21:40:59 +04:00
sevoves
5e52f8c231 add ctags doc and remove comments from oberon.ctags 2025-04-04 21:39:45 +04:00
sevoves
e298d10d99 rewording in configure.c 2025-04-04 15:43:44 +04:00
sevoves
3460b9f78a create macros for ignoring flood warnings 2025-04-04 15:37:41 +04:00
sevoves
089ca94207 remove scope pop in ctag since file is the scope 2025-04-04 00:38:41 +04:00
sevoves
b12029e3ed remove warning floods for MinGW compiler 2025-04-03 22:26:20 +04:00
sevoves
cd06cd32b1 ignore common warnings in gcc and clang 2025-04-03 22:09:20 +04:00
sevoves
7691293a5b replace egrep with grep -E for less warnings 2025-04-03 21:05:42 +04:00
sevoves
d005317424 address more caveats in oberon.ctags 2025-04-03 20:57:00 +04:00
sevoves
a25b44ae21 exclude all confidence test files without extension except expect 2025-04-03 20:38:12 +04:00
sevoves
e64d4c4d44 add test binaries to .gitignore 2025-04-03 20:14:24 +04:00
sevoves
ac82959092 add stuff to .gitignore 2025-04-03 20:05:37 +04:00
sevoves
cb098d448d update deaed links in ReadMe 2025-04-03 19:20:01 +04:00
sevoves
9e9bbe7581 fix empty link in ReadMe 2025-04-03 19:00:09 +04:00
sevoves
9084ca288b rewording ceveats on oberon.ctags 2025-04-03 16:29:13 +04:00
sevoves
233761e7fa more matches 2025-04-03 08:16:27 +04:00
sevoves
e936f7d7b0 fix typo in ReadMe 2025-04-03 07:52:59 +04:00
sevoves
c4f3792047 add ctags 2025-04-03 07:52:22 +04:00
Norayr Chilingarian
812b3a56d6
Merge pull request #106 from tkurtbond/openbsdinstallfailsldconfig
Don't try to uninstall the shared libraries unless the directory exists.
2025-03-13 16:19:38 +04:00
Norayr Chilingarian
764e018de2
Merge pull request #108 from pascalecu/feat/netbsd
feat: add netbsd support (#107)
2025-03-13 16:17:37 +04:00
Ștefan-Iulian Alecu
b22fc3fd3f
feat: add netbsd support in configure.c 2025-03-12 02:07:15 +02:00
Norayr Chilingarian
2178fa7b18 now test server can listen on any ipv4 address. 2025-02-21 04:52:54 +04:00
Norayr Chilingarian
e36e862c8c Revert "now test server can listen on any ipv4 address."
This reverts commit afe5a2d824.
2025-02-21 04:52:20 +04:00
Norayr Chilingarian
afe5a2d824 now test server can listen on any ipv4 address. 2025-02-21 04:48:39 +04:00
T. Kurt Bond
7d14452a51 Don't try to uninstall the shared libraries unless the directory exists.
Otherwise it fails on OpenBSD during the first installation with:

    ldconfig: /usr/local/sw/versions/voc/git/lib: No such file or directory
2025-01-17 08:10:47 -05:00
Norayr Chilingarian
8d2d479664 unix nil check won't prevent windows builds. 2024-08-23 13:51:15 +04:00
9292b2a7d5
Merge pull request #102 from antranigv/master
set language to Oberon
2024-05-11 21:44:48 +04:00
Antranig Vartanian
e189882af8
set language to Oberon 2024-05-11 21:43:22 +04:00
Norayr Chilingarian
48741af5ac
Merge pull request #101 from vishaps/catching_segfault
now "NIL access" error in Modules.Mod indeed works.
2024-04-13 05:13:38 +04:00
Norayr Chilingarian
7fb61a066b now "NIL access" error in Modules.Mod indeed works. 2024-04-13 04:14:18 +04:00
Norayr Chilingarian
7ea99e20a0 fixed crash introduced in commit aed9134e99
see comments in OPB.Mod
2024-04-12 21:52:25 +04:00
Norayr Chilingarian
a7fe55d434 changed hardcoded test file name to the one which exists in current
directory.
2024-03-21 19:36:43 +04:00
Norayr Chilingarian
85dff7734d wrapper function for compatibility with project oberon 13 sources. 2024-03-14 18:01:26 +04:00
Norayr Chilingarian
e376e59f58 md5sum test will now work with binary files as well. 2024-02-21 03:30:49 +04:00
Norayr Chilingarian
75c155f8ec md5 sum calculation example. 2024-01-26 02:20:24 +04:00
Norayr Chilingarian
dfaf2d3622 example on how to read commandline arguments with Texts. 2024-01-14 17:15:40 +04:00
Norayr Chilingarian
5a93546143 insignificant readme and makefile changes. 2023-12-13 15:56:49 +04:00
Norayr Chilingarian
ff42920226 gcc: warning: switch ‘-gstabs’ is no longer supported - removed it. 2023-10-05 17:03:30 +04:00
Norayr Chilingarian
c4213e333a small fix to build options, whitespace is necessary. 2023-10-05 17:00:23 +04:00
Norayr Chilingarian
b8d08c007a additional opts should be on the left of other CFLAGS,
this fixes linking to third party libraries issue on some operating systems
including Ubuntu and Debian, probably older gcc 11 is to blame.
Did not notice this problem on Gentoo, at least with gcc 13.
2023-10-05 16:54:37 +04:00
Norayr Chilingarian
bd35c73c1f more changes for tcc 2023-04-26 04:01:15 +04:00
Faraz Vahedi
7ca08f1ef1
Remove an unused import 2022-07-04 16:31:45 +00:00
219 changed files with 2629 additions and 741 deletions

4
.gitattributes vendored
View file

@ -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
View file

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

View file

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

View file

@ -151,32 +151,41 @@ 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);
} }
} }
}
void setupAutomaticSegfaultHandler() {
SystemSetHandler(11, (ADDRESS)segfaultHandler); // Register handler for SIGSEGV
}
#else #else
// Windows system remains as is since Windows does not use SIGSEGV in the same way
// Provides Windows callback handlers for signal-like scenarios
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
SystemSignalHandler SystemInterruptHandler = 0; SystemSignalHandler SystemInterruptHandler = 0;
@ -189,7 +198,7 @@ typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler
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;
@ -197,7 +206,6 @@ typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler
} }
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

View file

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

View file

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

View file

@ -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;
} }

View file

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

View file

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

View file

@ -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);

View file

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

View file

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

View file

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

View file

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

View file

@ -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) {

View file

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

View file

@ -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,7 +618,8 @@ 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))) {
if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) {
OPM_WriteString((CHAR*)"#define __", 11); OPM_WriteString((CHAR*)"#define __", 11);
OPC_Ident(obj); OPC_Ident(obj);
OPC_DeclareParams(obj->link, 1); OPC_DeclareParams(obj->link, 1);
@ -644,6 +645,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
OPM_Write(')'); OPM_Write(')');
OPM_WriteLn(); 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();
}
} }
} }
} }

View file

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

View file

@ -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;
} }

View file

@ -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);

View file

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

View file

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

View file

@ -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)
{ {
OPM_Get(&OPS_ch); BOOLEAN isExported;
for (;;) { CHAR commentText[256];
for (;;) { INT16 i, nestLevel;
while (OPS_ch == '(') { 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);
if (OPS_ch == '*') { if (OPS_ch == '*') {
Comment__2(); isExported = 1;
}
}
if (OPS_ch == '*') {
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);
break;
}
if (OPS_ch == 0x00) {
break;
}
OPM_Get(&OPS_ch);
}
if (OPS_ch == ')') { if (OPS_ch == ')') {
commentText[0] = 0x00;
OPM_StoreComment(commentText, 256);
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);
break; 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);
} else {
prevCh = 0x00;
}
} else {
if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) {
if (i < 255) {
commentText[__X(i, 256)] = prevCh;
i += 1;
}
}
prevCh = OPS_ch;
}
if (nestLevel > 0) {
OPM_Get(&OPS_ch);
}
} }
if (OPS_ch == 0x00) { if (OPS_ch == 0x00) {
OPS_err(5); OPS_err(5);
break;
} }
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 (isExported) {
if (i >= 256) {
OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30);
OPM_LogWLn();
i = 255;
}
commentText[__X(i, 256)] = 0x00;
OPM_StoreComment(commentText, 256);
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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);

View file

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

View file

@ -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);

View file

@ -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);

View file

@ -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);
} }

View file

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

View file

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

View file

@ -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;
} }

View file

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

View file

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

View file

@ -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);

View file

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

View file

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

View file

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

View file

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

View file

@ -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) {

View file

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

View file

@ -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,7 +618,8 @@ 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))) {
if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) {
OPM_WriteString((CHAR*)"#define __", 11); OPM_WriteString((CHAR*)"#define __", 11);
OPC_Ident(obj); OPC_Ident(obj);
OPC_DeclareParams(obj->link, 1); OPC_DeclareParams(obj->link, 1);
@ -644,6 +645,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
OPM_Write(')'); OPM_Write(')');
OPM_WriteLn(); 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();
}
} }
} }
} }

View file

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

View file

@ -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;
} }

View file

@ -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);

View file

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

View file

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

View file

@ -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)
{ {
OPM_Get(&OPS_ch); BOOLEAN isExported;
for (;;) { CHAR commentText[256];
for (;;) { INT16 i, nestLevel;
while (OPS_ch == '(') { 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);
if (OPS_ch == '*') { if (OPS_ch == '*') {
Comment__2(); isExported = 1;
}
}
if (OPS_ch == '*') {
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);
break;
}
if (OPS_ch == 0x00) {
break;
}
OPM_Get(&OPS_ch);
}
if (OPS_ch == ')') { if (OPS_ch == ')') {
commentText[0] = 0x00;
OPM_StoreComment(commentText, 256);
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);
break; 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);
} else {
prevCh = 0x00;
}
} else {
if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) {
if (i < 255) {
commentText[__X(i, 256)] = prevCh;
i += 1;
}
}
prevCh = OPS_ch;
}
if (nestLevel > 0) {
OPM_Get(&OPS_ch);
}
} }
if (OPS_ch == 0x00) { if (OPS_ch == 0x00) {
OPS_err(5); OPS_err(5);
break;
} }
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 (isExported) {
if (i >= 256) {
OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30);
OPM_LogWLn();
i = 255;
}
commentText[__X(i, 256)] = 0x00;
OPM_StoreComment(commentText, 256);
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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);

View file

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

View file

@ -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);

View file

@ -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);

View file

@ -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);
} }

View file

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

View file

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

View file

@ -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;
} }

View file

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

View file

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

View file

@ -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);

View file

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

View file

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

View file

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

View file

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

View file

@ -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) {

View file

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

View file

@ -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,7 +618,8 @@ 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))) {
if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) {
OPM_WriteString((CHAR*)"#define __", 11); OPM_WriteString((CHAR*)"#define __", 11);
OPC_Ident(obj); OPC_Ident(obj);
OPC_DeclareParams(obj->link, 1); OPC_DeclareParams(obj->link, 1);
@ -644,6 +645,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
OPM_Write(')'); OPM_Write(')');
OPM_WriteLn(); 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();
}
} }
} }
} }

View file

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

View file

@ -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;
} }

View file

@ -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);

View file

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

View file

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

View file

@ -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)
{ {
OPM_Get(&OPS_ch); BOOLEAN isExported;
for (;;) { CHAR commentText[256];
for (;;) { INT16 i, nestLevel;
while (OPS_ch == '(') { 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);
if (OPS_ch == '*') { if (OPS_ch == '*') {
Comment__2(); isExported = 1;
}
}
if (OPS_ch == '*') {
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);
break;
}
if (OPS_ch == 0x00) {
break;
}
OPM_Get(&OPS_ch);
}
if (OPS_ch == ')') { if (OPS_ch == ')') {
commentText[0] = 0x00;
OPM_StoreComment(commentText, 256);
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);
break; 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);
} else {
prevCh = 0x00;
}
} else {
if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) {
if (i < 255) {
commentText[__X(i, 256)] = prevCh;
i += 1;
}
}
prevCh = OPS_ch;
}
if (nestLevel > 0) {
OPM_Get(&OPS_ch);
}
} }
if (OPS_ch == 0x00) { if (OPS_ch == 0x00) {
OPS_err(5); OPS_err(5);
break;
} }
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 (isExported) {
if (i >= 256) {
OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30);
OPM_LogWLn();
i = 255;
}
commentText[__X(i, 256)] = 0x00;
OPM_StoreComment(commentText, 256);
} }
} }

View file

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

View file

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

View file

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