Linley Compiler 4.8.3 Open Documentation

1. Introduction

Linley Compiler is a native x86 compiler for the Windows platform and
produces optimized portable executable files (PE) through built in linker.
Linley compiles directly into machine code so there is no need for any
runtime libraries or other dependencies.


1. 1 How to Read

1.1.1 Meanings of the Symbols used in this Document

Symbol

Meaning

|

Or (you can choose between)

[]

Optional Statement

<>

Number Expression

""

String Expression



2. Data Types

byte

word

dword

single

signed

-128 to 128

-32767 to 32767

-214748364 to 214748364

X

unsigned

0 to 256

0 to 65536

0 to 4294967294

X


The datatypes are declared as signed by standard if you want to have the
unsigned version you have to tell this to the parser by

unsigned byte i; or the other way signed byte i;

if only: byte i; is written then it is declared as signed.


3 Directives

3.1 The Application Directive

application FORMAT APPTYPE [EXTRA entry Symbol];

The first statement is important to tell the parser what application is made.
You specify the file format and application type by this directive. You cannot
leave this directive out it is expected as first directive by the parser.

Directive

Format

Apptype

Extra

Entry

application

PE

CUI or GUI

DLL

entry @

;


Example: application PE GUI entry main;



3.2 The Import Directive

import Name [alias AliasName] [ascii|unicode] lib "Library.dll",<Parameters>;

Keyword

Format

Example

Name

is the function name.

MessageBox

[alias AliasName]

specifies alias that is passed to the library. and the name declared before is used in code.

MessageBox alias MessageBoxA

[ascii|unicode]

is for standard ascii or unicode aliases.

1. MessageBox ascii ~
MessageBoxA

2. MessageBox unicode ~ MessageBoxW

lib "Library.dll"

specifies in which Dynamic Link Library the functions is stored.

"USER32.DLL"

Parameters

Specifies the number of parameters which will be passed to that import.

MessageBox has 4 parameters.


Example:

import MessageBox ascii lib "USER32.DLL",4;

MessageBox(0,"Hello World!","Linley",$20);