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.

Transform Your Legacy Software Today!

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