MAWA - A language as simple as Python but as powerful as Assembler, modern ASM but much simpler.
Source: Dev.to
Introduction
MAWA is a programming language that combines a Python‑like syntax with the low‑level power of an assembler. It aims to simplify both the source code and the compilation pipeline, allowing source files (.mawa) to be assembled directly into binary (.bin) images.
Compilation Process
Traditional low‑level development with C/C++ involves multiple steps:
- Compile source (
.c/.cpp) → object file (.o) - Link object files → executable (
.elf) - Convert executable → binary (
.bin)
MAWA (and raw assembler) streamlines this:
- Assembler:
.asm→.bin - MAWA:
.mawa→.bin
This reduces the toolchain to a single step.
Syntax Example
Imp (‘A’, DefFinLinea(1), ‘B’, 0x0A)
FinalLoop (No Extensiones)
Explanation
Impprints characters.'A'is printed.DefFinLinea(1)inserts a line break.'B'is printed.- The final argument (
0x0A) encodes the background and foreground colors (background = 0, font = A).
FinalLoop (No Extensiones)creates an infinite loop to prevent the CPU from reading stray bytes (e.g.,00) that could cause QEMU to interpret garbage.
Equivalent NASM 16‑bit Code
BITS 16
startCode:
mov ax, 0x0003
int 0x10
mov ah, 0x09
mov al, 'A'
mov bl, 0x0A
mov bh, 0x00
mov cx, 1
int 0x10
call endLine
mov ah, 0x09
mov al, 'B'
mov bl, 0x0A
mov bh, 0x00
mov cx, 1
int 0x10
jmp $
endLine:
mov ah, 0x0E
mov al, 0x0D
int 0x10
mov ah, 0x0E
mov al, 0x0A
int 0x10
ret
times 510 - ($ - $$) db 0
dw 0xAA55
This program prints A and B with color attribute 0x09. After each character, endLine inserts a CR+LF (0x0D 0x0A) using BIOS interrupt 0x10 function 0x0E.
Equivalent NASM 32‑bit Code
BITS 32
mov edi, 0xB8000 ; VGA text buffer address
mov byte [edi], 'A' ; character
mov byte [edi+1], 0x0A ; attribute (light green)
add edi, 160 ; move to next line (80 columns × 2 bytes)
mov byte [edi], 'B' ; character
mov byte [edi+1], 0x0A ; attribute
jmp $ ; infinite loop
Here the program writes directly to video memory, placing characters and their color attributes. The add edi, 160 advances the cursor to the next line.
Comparison
- Line Count: MAWA requires only two statements, whereas the 16‑bit NASM version spans dozens of lines. The 32‑bit NASM version is shorter but still more verbose than MAWA.
- Toolchain Simplicity: MAWA eliminates the need for separate compilation, linking, and binary conversion steps.
- Readability: MAWA’s high‑level syntax makes intent clearer (e.g.,
Impfor “print”,DefFinLineafor “line break”).
Ongoing Projects
The author is also developing Win Anti App Anchor, an operating system built with MAWA. Further details will be shared in upcoming posts.
References
- Original MAWA introduction: https://dev.to/samuel_leonardo_37aff38b4/mawa-el-lenguaje-de-programacion-del-futuro-2bjh
All rights reserved, November 24 2025.