Your First Program
Let’s compile a simple program that demonstrates all the compiler’s capabilities. We’ll create a program that performs arithmetic and prints the result.Write Your First Program
Create a file called This program:
first.txt with this content:first.txt
- Declares variable
xand assigns it the value 8 (5 + 3) - Declares variable
yand assigns it 16 (x * 2) - Prints the value of
y
Launch the Compiler
- GUI Mode
- Console Mode
Launch the graphical interface:A window will open with:
- Editor pane on the left for writing code
- Output pane on the right for compilation results
- Toolbar at the top with buttons
Enter Your Code
- GUI Mode
- Console Mode
- Type or paste your code into the editor pane
- Click the Compilar button or press
Ctrl+Enter - Watch the output appear in the right pane
Understanding the Output
Let’s break down what each phase does with your program:- Phase 1: Tokens
- Phase 2: AST
- Phase 3: Semantic
- Phase 4: IR
- Phase 5: Execution
- Phase 6: Assembly
The Scanner breaks your code into tokens:Each piece of your code is identified and categorized.
Try More Examples
Simple Arithmetic
20Multiple Variables
60Parentheses
30Complex Expression
75Common First Steps
How do I save my program?
How do I save my program?
In GUI mode, your code is automatically maintained in the editor. You can manually copy it to a text file.In console mode, type your program in a text editor first, then paste it into the console.
How do I export the assembly code?
How do I export the assembly code?
In GUI mode, click the Export ASM button after successful compilation. Choose a location to save the
.asm file.In console mode, the assembly code is printed to the console - you can redirect it to a file:What if I get an error?
What if I get an error?
The compiler will show you exactly what went wrong and where:Check the line and column numbers to find and fix the issue.
Can I test the assembly code?
Can I test the assembly code?
Yes! Export the assembly code and open it in EMU8086:
- Click Export ASM in the GUI
- Open EMU8086
- Load your
.asmfile - Click Emulate to assemble and run it
- View the output in the EMU8086 console
Next Steps
Now that you’ve compiled your first program, dive deeper:Language Syntax
Learn all the language features
Compiler Architecture
Understand how it works internally
More Examples
Explore complex programs
CLI Guide
Master console mode features
GUI Guide
Learn all GUI shortcuts
Understanding Output
Decode compilation results
Congratulations! You’ve successfully compiled your first program with Mini-Compilador Educativo.