OpenLLM-France/wikimedia huggingface dataset:
# X86 Disassembly/Linux Executable Files

The Linux Executable Files page of the X86 Disassembly Wikibook is a stub. You can help by expanding this section.

## ELF Files

The ELF file format (short for Executable and Linking Format) was developed by Unix System Laboratories to be a successor to previous file formats such as COFF and a.out. In many respects, the ELF format is more powerful and versatile than previous formats, and has widely become the standard on Linux, Solaris, IRIX, and FreeBSD (although the FreeBSD-derived Mac OS X uses the Mach-O format instead). ELF has also been adopted by OpenVMS for Itanium and BeOS for x86.
Historically, Linux has not always used ELF; Red Hat Linux 4 was the first time that distribution used ELF; previous versions had used the a.out format.
ELF Objects are broken down into different segments and/or sections. These can be located by using the ELF header found at the first byte of the object. The ELF header provides the location for both the program header and the section header. Using these data structures the rest of the ELF objects contents can be found, this includes .text and .data segments which contain code and data respectively.
The GNU readelf utility, from the binutils package, is a common tool for parsing ELF objects.

### File Format

Each ELF file is made up of one ELF header, followed by file data. The file data can include:
* Program header table, describing zero or more segments
* Section header table, describing zero or more sections
* Data referred to by entries in the program or section header table
The segments contain information that is necessary for runtime execution of the file, while sections contain important data for linking and relocation. Each byte in the entire file is taken by no more than one section at a time, but there can be orphan bytes, which are not covered by a section. In the normal case of a Unix executable one or more sections are enclosed in one segment.

## Relocatable ELF Files

Relocatable ELF files are created by compilers. They need to be linked before running.
Those files are often found in .a archives, with a .o extension.

## a.out Files

a.out is a very simple format consisting of a header (at offset 0) which contains the size of 3 executable sections (code, data, bss), plus pointers to additional information such as relocations (for .o files), symbols and symbols' strings. The actual sections contents follows the header. Offsets of different sections are computed from the size of the previous section.
The a.out format is now rarely used.
# X86 Disassembly/Floating Point Examples
## Example: Floating Point Arithmetic

Here is the C source code, and the GCC assembly listing of a simple C language function that performs simple floating-point arithmetic. Can you determine what the numerical values of LC5 and LC6 are?
For this, we don't even need a floating-point number calculator, although you are free to use one if you wish (and if you can find a good one). LC5 is added to [ebp - 16], which we know to be y, and LC6 is added to [ebp - 24], which we know to be z. Therefore, LC5 is the number "2.0", and LC6 is the number "3.0". Notice that the fld1 instruction automatically loads the top of the floating-point stack with the constant value "1.0".
# X86 Disassembly/Functions and Stack Frame Examples
## Example: Number of Parameters

Given the following disassembled function (in MASM syntax), how many 4-byte parameters does this function receive? How many variables are created on the stack? What does this function do?
The function above takes 2 4-byte parameters, accessed by offsets +8 and +12 from ebp. The function also has 1 variable created on the stack, accessed by offset +0 from esp. The function is nearly identical to this C code:

## Example: Standard Entry Sequences

Does the following function follow the Standard Entry and Exit Sequences? if not, where does it differ?
The function does not follow the standard entry sequence, because it doesn't set up a proper stack frame with ebp and esp. The function basically performs the following C instructions:
Although an optimizing compiler has chosen to take a few shortcuts.
# X86 Disassembly/Loop Examples
## Example: Identify Purpose

What does this function do? What kinds of parameters does it take, and what kind of results (if any) does it return?
This function loops through an array of 4 byte integer values, pointed to by esi, and adds each entry. It returns the sum in eax. The only parameter (located in [ebp + 8]) is a pointer to an array of integer values. The comparison between ebx and 100 indicates that the input array has 100 entries in it. The pointer offset [esi + ebx * 4] shows that each entry in the array is 4 bytes wide.

## Example: Complete C Prototype

What is this function's C prototype? Make sure to include parameters, return values, and calling convention.
Notice how the ret function cleans its parameter off the stack? That means that this function is an STDCALL function. We know that the function takes, as its only parameter, a pointer to an array of integers. We do not know, however, whether the integers are signed or unsigned, because the je command is used for both types of values. We can assume one or the other, and for simplicity, we can assume unsigned values (unsigned and signed values, in this function, will actually work the same way). We also know that the return value is a 4-byte integer value, of the same type as is found in the parameter array. Since the function doesnt have a name, we can just call it "MyFunction", and we can call the parameter "array" because it is an array. From this information, we can determine the following prototype in C:

## Example: Decompile To C Code

Decompile this code into equivalent C source code.
Starting with the function prototype above, and the description of what this function does, we can start to write the C code for this function. We know that this function initializes eax, ebx, and ecx before the loop. However, we can see that ecx is being used as simply an intermediate storage location, receiving successive values from the array, and then being added to eax.
We will create two unsigned integer values, a (for eax) and b (for ebx). We will define both a and b with the register qualifier, so that we can instruct the compiler not to create space for them on the stack. For each loop iteration, we are adding the value of the array, at location ebx*4 to the running sum, eax. Converting this to our a and b variables, and using C syntax, we see:
The loop could be either a for loop, or a while loop. We see that the loop control variable, b, is initialized to 0 before the loop, and is incremented by 1 each loop iteration. The loop tests b against 100, after it gets incremented, so we know that b never equals 100 inside the loop body. Using these simple facts, we will write the loop in 3 different ways:
First, with a while loop.
Or, with a for loop:
And finally, with a do-while loop:
# X86 Disassembly/Licensing
## Licensing

This book is released under the following license:
# Trainz/Driver Sessions and Rules
## Introduction

A Rule is a command which runs in a Driver session.
In the config.txt file of a Trainz asset, setting "behavior" as the parameter of the kind tag identifies the asset as a Rule. For this reason, Rules are sometimes also called behaviours.
Rules are not the same as Driver Commands, although they are closely related to each other. The Driver Command Rule specifies which Driver Commands will be available in a Driver session.
Rules are also not the same as Scriptlets. Scriptlets are sections of GameScript coding associated with assets such as rolling stock items and industries.

## How Rules Are Specified

Rules and their parameters are specified when a Driver session is created in Surveyor, by means of the "Edit Session Rules" option. A few standard built-in Rules are available by default. Additional built-in and custom Rules can be added as desired.

## When Rules Operate

By default Rules commence operation as soon as the Driver session starts to run.
In "Edit Session Rules", Rules can be indented, in which case they will only be obeyed when the Rule immediately above the indented Rule fires its event.
For example, a master Trigger Rule can have a Play Sound Rule indented under it, so that the sound will be played when a train enters a trigger. This is analogous to the ON EVENT concept in traditional programming.
Rules indented under an Ordered List Rule will be run in sequence, each one commencing only after the previous one completes.

## More Information
### TRS2004 World Builders Manual > Section 13 Surveyor Main Menu > Session And Rules Management

    Explains the concept of Rules, how to specify Rules and their parameters, and what the standard built-in Rules do.

### TRS2006 Manual > Section 11.14 Session And Rules Management

    Explains the concept of Rules, how to specify Rules and their parameters, but not what the standard built-in Rules do.

### TRS2006 Sessions & Rules Guide (downloadable from Auran's web site)

    Covers the subject in detail, except that it has no information about how to create Rules, only how to use them. Most of the material in this document is also applicable to TRS2004.

### TRS2004 SP2 Variable Rules Tutorial (downloadable from Auran's web site)

    Explains the usage of the variable Rules which were introduced with TRS2004 SP2. The downloadable package includes a sample tutorial route and Driver session.
# Trainz/Driving Diesel Engines

Back to the Top
| ← Prev Driving Engines in DCC Mode Driving Engines in CAB Mode | ↑ Driver — Driver Commands ↓ | Driving Electric Engines Driving Steam Engines  Next → |
Glossary :
HKeys-CM :
HKeys-DVR :
HKeys-SUR :
HKeys-WIN :
Mouse use :
Notations :

## Starting oddly
### The following image contains streams of control hotkeys in Driver mode.

    Let's explore what is happening and why they were pressed.

### A simulated CAB mode Drive

With minimal repeating, this is a translation:

#### First row

    QFWWW
    Q= release air brakes
    F= select forward (shift transmission)
    W= increase throttle one notch, hence WWW=up to third notch

#### 2nd row

    A...ZXXXW...ASRWWSA
    A = apply initial air brakes
    ...= wait or delay for some period,
   * when used between A-Z, it specifically means about three counts (2-3 seconds)
    Z = Toggle brakes Lap mode on. 'Lap' engages a 'air flow hold', keeping whatever partial brake pipe pressure as was built up during the '...' delay interval.
    X = Throttle back (reduce throttle one notch)
    A = a 2nd A key fully applies the air brakes, bringing their brake cylinders to full stopping pressure.
    S = Shifter to Neutral, necessary for reversing (next)
    R = Shift Transmission to Reverse, then throttle-up 2x to slow train fast
    S = Shifter to Neutral, necessary for shifting
    A = useless keystroke, nervous behavior; another A won't put full brakes on any faster, bur neither will it hurt.

#### 3rd row

    ...2SA.4...ZRJJJWW...X...EXEFQWW
    2 = means select exterior camera view
    SA = Shifter to neutral, throttle off (0 notch), begin braking
    . = quickly, immediately...
    4 = select free camera view, this allows user to 'walk about' (or fly around) in the World.
    ...= continue counting..., then Lap brakes (Z), reverse transmission (R)
    J = Switch junction ahead of Loco. JJJ is either a series of close junctions or a three way junction needing cycled to the correct divergent path.
WW = here, as after 'R' above, means increase throttle in Reverse; in this case, use the motors to slow the train quickly!
    E = Toggle (on/off) independent Locomotive brakes—these act very quickly compared to the main braking system.
    translation: "...X...EXEFQWW" means slow, but not as hard, loco-brakes on, remove throttle, loco brake off, shift to forwards, release main brakes, throttle-up, throttle-up.
Given the preceding RRR toggling, this is a likely sequence for abruptly slowing while navigating first a junction (merge or diverge) then a cross-over (two jcts connecting two parallel tracks) so the cars swerving through the resultant 'S-curve' don't go out of control.

#### 4th row

    AZSABK2------------4...Q[CTRL-J]FW
    B = ring Bell toggle
    K = A typo, was likely supposed to be J, switch junction, for is not a standard Driver hotkey.
    2------------4 = imply passing a junction, getting 'off the train loco' and waiting for the last car to pass,
    since [CTRL-J] = toggle junction BEHIND train (contrast with J above) follows right after, accompanied by a shift to Forwards and throttle-up again.
# Trainz/DLS and FCT

First of all, for the uninitiated, the designation DLS stands for Download Station, the central server where Auran stores all the Assets that have been created and submitted by Trainzers for general distribution to the Trainz Community. If you have a Trainz User ID and password you can access this site and download assets into your copy of Trainz.
Users of TRS2006 or above can use the supplied Content Manager Plus (CMP) application that manages content, searches and downloads. CMP also works hand-in-hand with CCP to aid in content creation.
FCT stands for First Class Ticket. For a nominal sum you can purchase a First Class Ticket from Auran which will allow you unlimited download privileges. Without the FCT, you are restricted to 100 MB each day and a download speed of 4kb/s. Depending on the copy that you purchase, you may be supplied with a '1 month FCT' free of charge with your new software.
# Trainz/Driver menu

Back to the Top
| ← Prev Driver | ↑ Trainz modules | Surveyor menu Next → |
Glossary :
HKeys-CM :
HKeys-DVR :
HKeys-SUR :
HKeys-WIN :
Mouse use :
Notations :
The Trainz Driver Menus have been fairly consistant in their appearance and mode of operation, after the introduction of Scenarios in Trainz 1.3 and especially in the era from TRS2004 (2003) through TS2009-SP4. TS2010, TS2012 and T:ANE all have different 'page design' arrangements, so navigation to a Driver Session is different.

## Notes, Footnotes & References

Config.txt files are endemic and ever present in Trainz assets, for no asset can be defined without this type of Computer Science container. The keyword-value_of_key pairing must always be kept in mind in editing or creating Trainz content. The TrainzBaseSpec contains values and containers which are most common in asset defining config.txt files.

### References

* Trainz printed or pdf file Manuals, applicable version - usually in the ..\extras or ..\extras\manuals folder
* TrainzOnline Wiki Config.txt file page and various other pages
* TrainzOnline Wiki: Content Creator's Guide pages (various)
* Various CCG and Auran websites
# Trainz/Shape File Viewers

Shape file viewers are applications used to open and view meshes created in 3D modelling software such as GMAX, 3DS Max or Blender. In Trainz, the shape file will be in Auran's Jet file format—either .im or .pm.

## Trainz Object Explorer

Trainz Object Explorer (TOE) is a stand-alone utility for viewing .im files exported from 3D modelling software. It was created by Adam Wojcieszyk and is still considered a work in progress, although an update has not been available since 2003 and it has been reported to have compatibility issues with recent developments.
Integrating TOE into the content creation workflow allows the content creator to save time when it is necessary to view 3D models as they would appear in Trainz. As a content creator, you may need to see how your model appears in Trainz several times an hour. In Windows, TOE can be set as the default program for opening .im files with. The program is also useful due to the lack of renderer in the Trainz Asset Creation Studio.
Trainz Object Explorer is available for free download on the Trainz Luvr website here.

## External Links

* Trainz Object Explorer
# Trainz/Sources for textures

These are sources for free textures but make sure to read the license agreements first.
* http://amazingtextures.com/textures/aboutus.php
* http://www.mega-tex.nl/index.php
* http://www.imageafter.com/
* http://web.archive.org/web/20060222080048/http://textures.boom.ru/texture/building/bu_lay.htm
* http://www.noir.org/Textures.html
* http://www.pawas.com/graphics/wood-textures.htm
* http://www.environment-textures.com/
* http://www.cgtextures.com/
# Trainz/Surveyor Mode Keyboard Shortcuts

The following keyboard shortcuts are based on Trainz Classics, 2.7.

## Topology Controls

* U Height Up
* D Height Down
* A Height Adjust
* - Decrease Cursor Radius
* + Increase Cursor Radius
* ] Decrease Height Sensitivity
* [ Increase Height Sensitivity
* G Get Height
* H Use Height
* P Plateau
* W Add Water
* Q Delete Water
* E Adjust Water Height
* X Extend Section
* ⇧ Shift+[ Rotate Displacement Counter Clockwise
* ⇧ Shift+] Rotate Displacement Clockwise
* Ctrl+[ Decrease Displacement Scale
* Ctrl+] Increase Displacement Scale
* B Selection Box
* F Apply Displacement
* C Cancel Displacement

## Track Laying Tools

* T Spline Mode
* Y Object Mode
* V Trackmark Mode
* - Previous Selection
* + Next Section
* A Add Track
* M Move Track
* R Rotate Object / Trackmark
* G Get Track
* D Delete Track
* B Straighten Track
* J Junction Direct
* N Define Name
* Q Split Spline
* H Spline Height
* X Remove Spline Point
* I Insert Spline Point
* S Smooth Spline
* J Get Spline Gradient
* K Apply Spline Gradient
* L Get Curve Radius
# Trainz/Stations

Back to the Top
* Trainz Asset Maintenance and Creation
* TOC | Beginnings | Fun | AM&C | Creation | InBook Refs | ORP Refs:  • Index • Containers • Kinds • Tags | Appendixes  • Vers
Glossary :
HKeys-CM :
HKeys-DVR :
HKeys-SUR :
HKeys-WIN :
Mouse use :
Notations :
Trainz Stations are interactive 'Industry class' assets that use people, albeit digital people, as products. Passenger Cars are the complementary rolling stock assets which transport that product. The implementation of such products in Trainz depends on hidden smoke and mirrors of TrainzScript, and properly designed assets with a sufficiency of mesh attachment points.
There are a wide variety of Train Station assets on the DLS and available through third party software vendors. Moreover, there is a wide variety of so-called invisible platforms which with suitable detailing allow most any building to be made into an interactive station. Trains stations inside a session like other interactive industries need be told what to do, so this page will deal with that bit of programming in the game.

## Module Goals

By working through this material, the student will learn:
* Station Industries, glitz and glitter aside as like any other interactive Trainz Industries.
* Optional asset selection approaches and technologies for setting up Station Industries.
* Gain an understanding of Interactive Stations
* Gather an understanding of Dummy Stations,
** and how to upgrade them when modifying an older gem of a route using invisible platforms.
** Some tricks to substitute or mask or combine components of several technologies to get an desired 3D model.
* Master programming of Interactive Stations, when to do that in what layer, and so forth.

## Dummy Station Components

In the beginner, before the Lord created the heaven's and the Earth... Stations in Trainz had the same humble beginning as dummy industries of any kind. Content Creators put together a set of likely looking scenery items, built up some splines objects of various appearances to act as platforms (each adroitly side stepped having stairs or steps by using ramps) and with the use of a few Trackmarks the primitive AI programability that was added into the Scenarios technology (Trainz UTC, v1.5) a scenario designer/writer could generate traffic for a human operator to sometimes interact with. Compared to what is possible with the much more highly evolved Trainz of today, there wasn't a lot of capabilities to exploit.
* Likely looking building
* Track with signalling
* Track mark on Tracks to interact with AI drivers and triggers for sensing control
* Station platform, either of the F3 tools 'Objects': F3,O or 'Spline scenery assets': F3,S groups.
# XHTML/What is XHTML

Extensible Hypertext Mark Up Language (XHTML) is the successive markup language to the near ubiquitous Hypertext Mark Up Language (HTML). Rooted in Standard Generalized Markup Language (SGML), HTML is flexible but complex, leaving the liberties with which web browsers take with its rules to cause a number of problems. Based on the strict and simple Extensible Markup Language (XML) standard, XHTML aims to resolve said problems while offering extensibility with other XML-based applications. In summation, XHTML is HTML rewritten to comply with XML, hence its name.
XHTML, being a subset of XML, will also be extensible to other XML applications and featured. For example, it may also include fragments from other XML based languages, such as Scalable Vector Graphics or MathML through the usage of namespaces.

## What HTML Stands For

The abbreviation of HTML stands for HyperText Mark-Up Language. Explained in more detail, this means:
* H (Hyper): The opposite of linear. Instead of going from the first line to the following one, the decision in where and when everything is set is up to the programmer (Specifically, you.).
* T (Text): This one is self-explanatory. The programming language is created through text.
* M (Mark-Up): This is what you can do with the text; you can mark-ups to edit a text's style, such as boldness, headings, bullets, and so on.
* L (Language): Also self-explanatory. HTML is a programming language.

## The Components

An XHTML document is made up of four main components:
* Document Type Definition (DTD): This used to be optional in HTML, but it is compulsory in XHTML. The DTD describes the language or script in which the text has been encoded.
* Text content: the headers and paragraphs that appear on the page.
* References: Advanced content like links and images.
* Mark-Up: Instructions on how the content should be displayed.
Each of these components is comprised of text. This means that the page can be saved in text format and viewed in any browser.
XHTML stands for extensible Hypertext Markup Language. It is a different version of HTML, it is based off of XML. XHTML is used to make webpages and has a very specific way to be written to be correct and without error. XHTML is also very case-sensitive. the tags are written in lowercase and need to be closed.The order of the tags also need to be in correct order for the information to come out correct. there are three main sections of XHTML consist of A declaration statement, a Head statement and a body.
* XHTML
# XHTML/DTD (Document Type Definition)
## Introduction

An XHTML DTD describes the allowed syntax and grammar of XHTML markup. Every XHTML document must start with a DTD declaration and a line of code that declares that you are starting to write XHTML code.
This is the mandatory minimum way to start an XHTML document:

## The Three Document Type Definitions

There are currently three XHTML 1.0 document types:
* Strict
* Transitional
* Frameset

## XHTML 1.0 Strict

This is used when the user wants a clean markup, free of presentational clutter. Use this in conjunction with Cascading Style Sheets.

## XHTML 1.0 Transitional

Use this when taking advantage of XHTML's presentational features and when you want to support browsers that do not understand Cascading Style Sheets. This is the one that is favored to use among developers and is used commonly.

## XHTML 1.0 Frameset

Use this when you want to use XHTML Frames to partition the browser window into two or more frames.

## XHTML 2.0

XHTML was a working draft, but its development was halted in favor of HTML 5.0. Even though the specification will not be completed, its doctype is: