The conversion kit

Coming from PowerBASIC - 64-bit migration checklist

PBXB64 produces 64-bit code, so a few PowerBASIC habits change. This page carries the complete checklist from the V23 product page. The rules are documentation/source evidence; no new compiler or functional test was run for this publication.

Back to PBXB64Deutsch

Checklist

TopicPBXB64 V23 behaviour
LONG8 bytes (64-bit). Use SDWORD / LONG32 where a 32-bit value is required (Win32 int).
INTEGER2 bytes since V23 (was 8). See MIGRATION_V23_INTEGER_TYPES.md. For old 64-bit data use QUAD.
Handles and pointersUse QUAD or a PTR type. DWORD truncates 64-bit values.
ConstantsOut-of-range constants are compile errors (PB_FRONTEND-8531); run-time stores wrap. CUINT8(300) = 44.
TYPE sizeA default TYPE is padded to a multiple of 8 (a 12-byte payload gives SIZEOF 16). TYPE name QWORD FILL gives the exact C sizeof.
DECLARE ... LIBWin32 int parameters and results as SDWORD, handles as QUAD (sample 10).
MemoryALLOCATE; FREE is a function; PEEK/POKE use 64-bit addresses (sample 4).
Pointers@p dereferences; p = p + 1 advances by target size. @p[i] is not valid.
IncludesUse -I Includes and #INCLUDE "windows_core.pbi"; the legacy Win32API include set is not shipped.
SUB parametersDefault BYREF (observed).
Division/ on integers is true division (7/2 = 3.5); (5>3) = -1.
ThreadsThe THREAD CREATE target must be a FUNCTION (sample 6).
EXE size / importsAbout 75 KB for hello world; imports only Windows DLLs.

Concrete migration patterns

These patterns illustrate the documented width and API rules. They are guidance, not newly executed qualification tests.

INTEGER records

TYPE OldRec
    id AS QUAD
    count AS QUAD
END TYPE
TYPE NewRec
    id AS INTEGER
    count AS INTEGER
END TYPE

' Narrow deliberately at the migration boundary.
n.id = o.id
n.count = CINT(o.count AND &HFFFF)

Win32-style declarations

' Win32 int is 32-bit; a handle is pointer-sized.
DECLARE FUNCTION GetValue LIB "example.dll" () AS SDWORD
DECLARE FUNCTION OpenThing LIB "example.dll" (BYVAL name AS STRING) AS QUAD

Pointer arithmetic

LOCAL p AS BYTE PTR
p = ALLOCATE(64)
POKE BYTE, p, 1
p = p + 1
ignored = FREE(p - 1)

Historical V23 example

PBXB64.exe 03_migration.bas -o 03_migration.exe

id = 7 | count =-25536
INTEGER range:-32768 .. 32767 | w =-1
CUINT8(300) = 44

The original page records this sample as compiled and run with PBXB64 V23 on 5 October 2026. That historical receipt is preserved; this detail page adds no new execution claim.