Technical Capabilities
Having trouble finding what you need?
Get in touch with us, so we can answer your specific questions directly.
Get In Touch

VX/BASIC - OpenVMS BASIC to ANSI C

Overview

VX/BASIC is a full-featured VMS / OpenVMS BASIC to ANSI C transpiler and compiler. It enables OpenVMS BASIC applications to be maintained in their original form or converted into C for Linux and Windows.

100% conversion of VMS BASIC syntax to working C

Maintains original structure, variable names, and comments

Integrates with VMS system services (RMS, file handling, etc.)

Uses C as an intermediate language, ensuring long-term portability

Supports direct execution and debugging on modern systems

History

HP BASIC for OpenVMS has a history spanning over 30 years, with numerous name and ownership changes. Originally developed by DEC for their PDP-11 minicomputer and RSTS-11 operating system, it evolved through multiple transitions as DEC was acquired by Compaq, Compaq merged with HP, and HP’s division was later spun off to HPE. The product was adapted for various new platforms as they emerged.

BASIC-PLUS

BASIC-PLUS, DEC’s first version of BASIC, allowed programmers to directly enter code in the command interpreter or use a text editor. Programs were stored as .BAS files and could be compiled into binary .BAC files. The language featured line numbers, memory management, and a garbage collector. Programs could be large, but system limitations required creative memory management strategies like the CHAIN instruction.

BASIC Plus 2

BASIC Plus 2, developed later by DEC, offered enhanced features and better performance, including true compilation into machine language. BP2 programs ran under RSX-11 or RSTS/E, allowing larger programs than BASIC-PLUS. It also supported object file linking and overlaid routines, reducing memory usage.

VAX BASIC and DEC BASIC

DEC ported BASIC Plus 2 to VAX systems under the name VAX BASIC, and then to the Alpha microprocessor, renaming it DEC BASIC with OpenVMS. With this version, BASIC programs were no longer interpreted but compiled into executables.

Compaq, HP and VSI

After Compaq’s acquisition of DEC, the product was renamed Compaq BASIC for OpenVMS. Following HP’s acquisition of Compaq, it became HP BASIC for OpenVMS. In 2014, HP sold the OpenVMS ecosystem to VSI, which rebranded it as VSI BASIC for OpenVMS.

VX/BASIC Features

Feature Description
Full VMS BASIC supportSupports all commands except graphics.
Integrated VMS system callsOver 900+ VMS system service calls supported.
Automatic C structure mappingMaps BASIC records into C structures, aligning data correctly.
Error handlingIdentical error codes & handling as VMS BASIC.
Integrated RMSFull support for VMS RMS file handling.
Code MaintainabilityTranspiled C code retains BASIC structure for easy debugging.

VX/BASIC Data Types & Handling

VX/BASIC supports all VMS / OpenVMS BASIC data types, except GFLOAT and HFLOAT, which are converted to DOUBLE.

VMS BASIC Type Converted ANSI C Type
INTEGERint32_t
BYTEuint8_t
WORDuint16_t
LONGint64_t
DOUBLEdouble
STRINGchar[] with VMS descriptors


VX/BASIC retains dynamic and static string handling, ensuring compatibility with VMS BASIC memory management.

VX/BASIC Error Handling

VX/BASIC preserves all VMS error codes and handling mechanisms, ensuring that programs behave identically to their OpenVMS versions.


VMS BASIC Error Code Description
52Illegal value error
15WAIT exhausted error
98962File not found (RMS error)


If a program calls VMS system routines and checks their return values, VX/BASIC ensures identical behavior using the VX/RT runtime libraries.

VX/BASIC Statements & Functions

VX/BASIC supports all VMS BASIC statements, with identical syntax in the transpiled C code.

Control Statements
Statement Description
IF...THENConditional branching
FOR...NEXTLooping construct
WHILE...WENDWhile loop
GOTOUnconditional jump
ON ERROR GOTOError handling
SELECT CASEMulti-way branching

VX/BASIC I/O Handling

VX/BASIC supports all standard VMS BASIC I/O operations.

VMS BASIC Transpiled ANSI C
PRINT "Hello"printf("Hello\\n");
INPUT Ascanf("%d", &A);
OPEN "FILE.DAT" FOR INPUT AS #1FILE *fp = fopen("FILE.DAT", "r");

VX/BASIC Example Code

VMS / OpenVMS BASIC
10 PRINT "HELLO, WORLD!"
20 INPUT "Enter a number: ", X
30 IF X > 10 THEN PRINT "X is greater than 10" 
ELSE PRINT "X is 10 or less"
40 END
Transpiled ANSI C Code
#include <stdio.h>

int main() {
    int X;
    printf("HELLO, WORLD!\n");
    printf("Enter a number: ");
    scanf("%d", &X);
    
    if (X > 10) {
        printf("X is greater than 10\n");
    } else {
        printf("X is 10 or less\n");
    }
    
    return 0;
}

VX/BASIC Record & Map Handling

VX/BASIC supports full translation of VMS BASIC records and maps into C structures.

VMS BASIC Record
RECORD EMPLOYEE
    STRING NAME*20
    INTEGER AGE
    DOUBLE SALARY
END RECORD
Transpiled C Structure
typedef struct {
    char NAME[20];
    int AGE;
    double SALARY;
} EMPLOYEE;

Why Choose VX/BASIC?

100% compatible with VMS / OpenVMS BASIC

Seamless portability to Linux / Windows

Retains original source structure for easy maintenance

Preserves all VMS-specific functionality (RMS, error handling, etc.)

Automatically generates optimized ANSI C code

VX/BASIC ensures long-term portability and future-proofing for legacy OpenVMS BASIC applications, making migration to modern architectures effortless.

Frequently Asked Questions

Curious about how Sector7 can facilitate your application migration? Explore our FAQs for expert insights.

Our OpenVMS application makes use of multiple System Services. How do you support that?

Sector7 has an extensive library of these services running on Linux to perform the same functions as on OpenVMS.  our language conversion tools will adapt the arguments in the procedure API to work with this library.  For instance, VX/COBOL or VX/FORTRAN etc will transform the argument passed BY DESCRIPTOR to a method that will work on Linux.

When the code is compiled on Linux, the compiled objects are linked with the Sector7 library of system services and the program executes on Linux just as it does on OpenVMS, making full use of the various system services.

The critical point here is that there is no need to touch the original source code, the Sector7 tools do all the work.

What is VX/BASIC and how does it help with legacy system migration?

VX/BASIC is a full-featured OpenVMS BASIC to ANSI C transpiler that enables legacy BASIC applications to run natively on Linux. It provides 100% conversion of VMS BASIC syntax to working C code while maintaining the original structure, variable names, and comments for easy maintenance.

For organizations ready to modernize their legacy systems, contact us to discuss your specific migration requirements.

What VMS BASIC data types does VX/BASIC support?

VX/BASIC supports all VMS BASIC data types including INTEGER, BYTE, WORD, LONG, DOUBLE, and STRING. The only exceptions are GFLOAT and HFLOAT, which are automatically converted to DOUBLE for compatibility.

How does VX/BASIC handle VMS error codes?

VX/BASIC preserves all VMS error codes and handling mechanisms, ensuring programs behave identically to their OpenVMS versions with the same error numbers and responses.

What I/O operations are supported in the migration?

VX/BASIC supports all standard VMS BASIC I/O operations including PRINT, INPUT, and file operations like OPEN FOR INPUT, converting them to equivalent ANSI C functions.

How does VX/BASIC handle VMS BASIC records and maps?

VX/BASIC provides full translation of VMS BASIC records and maps into C structures, automatically mapping data correctly and maintaining the original data alignment. This ensures that complex data structures work seamlessly in the migrated application.

Organizations like SEB have successfully used similar migration approaches to modernize their core systems while preserving data integrity.

How many VMS system service calls does VX/BASIC support?

VX/BASIC supports over 900+ VMS system service calls, providing comprehensive integration with VMS functionality including RMS file handling and other system services.

What makes VX/BASIC different from rewriting applications from scratch?

VX/BASIC maintains the original BASIC source code structure while generating optimized C code, allowing developers to continue working with familiar BASIC syntax. The transpiled C code retains the original program flow and variable names, making debugging and maintenance much easier than completely rewritten applications.

What are the key benefits of using VX/BASIC for migration?

VX/BASIC delivers 100% compatibility with VMS BASIC while providing seamless portability to Linux. Organizations retain their valuable software investments while gaining modern infrastructure benefits including reduced hardware costs, improved performance, and enhanced scalability.

Companies like HH Gregg have successfully migrated millions of lines of legacy code using similar approaches. The generated ANSI C code ensures long-term portability and future-proofing for legacy applications.

Ready to explore migration options for your BASIC applications? Contact us to discuss your specific requirements.

Transform Your Legacy Software Today!

Get In Touch
Unlock the potential of your legacy software with our expert migration services.