All Projects → pbatard → Fasmg Ebc

pbatard / Fasmg Ebc

Licence: gpl-3.0
An EFI Byte Code (EBC) assembler, based on fasmg

Programming Languages

assembly
5116 projects
assembler
53 projects

Projects that are alternatives of or similar to Fasmg Ebc

Efifs
EFI FileSystem drivers
Stars: ✭ 272 (+1500%)
Mutual labels:  arm, uefi, aarch64, x64, qemu
Build
Armbian Linux build framework
Stars: ✭ 1,827 (+10647.06%)
Mutual labels:  arm, aarch64, uefi
Uefi Ntfs
UEFI:NTFS - Boot NTFS partitions from UEFI
Stars: ✭ 386 (+2170.59%)
Mutual labels:  arm, uefi, x64
Simdjson
Parsing gigabytes of JSON per second
Stars: ✭ 15,115 (+88811.76%)
Mutual labels:  arm, aarch64, x64
Raspberrypipkg
DEPRECATED - DO NOT USE | Go here instead ->
Stars: ✭ 758 (+4358.82%)
Mutual labels:  arm, uefi, aarch64
fdtd3d
fdtd3d is an open source 1D, 2D, 3D FDTD electromagnetics solver with MPI, OpenMP and CUDA support for x86, arm, arm64 architectures
Stars: ✭ 77 (+352.94%)
Mutual labels:  arm, x64, aarch64
Tow-Boot
An opinionated distribution of U-Boot. — https://matrix.to/#/#Tow-Boot:matrix.org?via=matrix.org
Stars: ✭ 338 (+1888.24%)
Mutual labels:  arm, uefi, aarch64
opcodesDB
x86-64 | ARM (AArch32/AArch64/THUMB) full instruction set.
Stars: ✭ 49 (+188.24%)
Mutual labels:  arm, x64, aarch64
Frankenstein
Broadcom and Cypress firmware emulation for fuzzing and further full-stack debugging
Stars: ✭ 285 (+1576.47%)
Mutual labels:  arm, qemu
Lumia950xlpkg
Non-EOL (yes!) AArch64 UEFI firmware for Lumia 950 / Lumia 950 XL
Stars: ✭ 300 (+1664.71%)
Mutual labels:  uefi, aarch64
Sse2neon
A translator from Intel SSE intrinsics to Arm/Aarch64 NEON implementation
Stars: ✭ 316 (+1758.82%)
Mutual labels:  arm, aarch64
Shecc
A self-hosting and educational C compiler
Stars: ✭ 286 (+1582.35%)
Mutual labels:  arm, qemu
Sleef
SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT
Stars: ✭ 353 (+1976.47%)
Mutual labels:  arm, aarch64
Woa Deployer Lumia
Making your Lumias great again!
Stars: ✭ 380 (+2135.29%)
Mutual labels:  arm, aarch64
Cemu
Cheap EMUlator: lightweight multi-architecture assembly playground
Stars: ✭ 666 (+3817.65%)
Mutual labels:  arm, aarch64
Reverse Engineering Tutorial
A FREE comprehensive reverse engineering tutorial covering x86, x64, 32-bit ARM & 64-bit ARM architectures.
Stars: ✭ 5,763 (+33800%)
Mutual labels:  arm, x64
Raspberry Pi Cross Compilers
Latest GCC Cross Compiler & Native (ARM & ARM64) CI generated precompiled standalone toolchains for all Raspberry Pis. 🍇
Stars: ✭ 261 (+1435.29%)
Mutual labels:  arm, aarch64
Asmdb
Instructions database and utilities for X86/X64 and ARM (THUMB/A32/A64) architectures.
Stars: ✭ 258 (+1417.65%)
Mutual labels:  arm, aarch64
Raspberry Pi Pcie Devices
Raspberry Pi PCI Express device compatibility database
Stars: ✭ 444 (+2511.76%)
Mutual labels:  arm, aarch64
Docker Cloudflare Ddns
A small amd64/ARM/ARM64 Docker image that allows you to use CloudFlare as a DDNS / DynDNS Provider.
Stars: ✭ 467 (+2647.06%)
Mutual labels:  arm, aarch64

fasmg-ebc - EBC (EFI Byte Code) assembler for fasmg

Because programming in assembler for UEFI is easy and nobody should have to pay to produce EBC executables...

Prerequisites

  • QEMU v2.7 or later NB: You can find QEMU Windows binaries here.
    Make sure you use QEMU 2.7 or later, as earlier versions may produce a Synchronous Exception on AARCH64.
  • git (e.g. TortoiseGit for Windows).

Instructions and syntax

See Chapter 21 (EFI Byte Code Virtual Machine) of the UEFI Specifications.

This assembler accepts not specifying a size for arithmetic or comparison operations, in which case the 64-bit version is used (since all EBC registers are 64 bit). This means that XOR R1, R2 will be converted to XOR64 R1, R2.

For JMP/CALL[EX] operations where you do not specify a size, the assembler will also insert the most appropriate version.
For instance CALL @R1 will be converted to CALL32 @R1 whereas CALL 0x1234 will be converted to CALL64 0x1234.

Also, if you are using a label with JMP or CALL, the assembler will convert it to a relative offset.
For instance, say you have the following code:

Label:
   (...)
   JMPcc Label

Then JMPcc will either be converted to JMP8cc <offset> or JMP32cc R0(<offset>) or JMP64cc <offset> with <offset> being the relative value required for each specific instruction size, to point to Label.

The assembler can also guess the size of indexes or immediates, if you don't explicitly specify one. For instance MOVIn R1, (+2,+8) gets assembled as MOVInw R1, (+2,+8) whereas MOVIn R1, (+2,+4096) gets assembled as MOVInd R1, (+2,+4096).

Finally, if you use the struct macro to define a set of EFI structures, the assembler will convert member references to their equivalent indexes. This means that something like this:

MOVn R1, @R1(EFI_SYSTEM_TABLE.ConOut)

gets assembled as:

MOVn R1, @R1(+5,+24)

Oh, and this conversion is smart enough to handle alignment computations, such that an UINT32 (aligned to natural size) followed by an UINT64 does generate (+1,+0) for the UINT64 index and not (+0,+4).
For more, see efi.inc and hello.asm.

Assembly and testing (Windows)

  • Run make to compile the hello.asm sample. If not already available, the latest fasmg binary is downloaded automatically.
  • Additionally, you can compile one of the other samples by providing its short name (e.g. make arch)
  • If you have QEMU installed, you can add a qemu parameter to run the application (e.g. make hello qemu)
    You may also add one of x64, ia32, arm and aa64 to run the application against a specific UEFI architecture (e.g. make hello qemu aa64)
  • If you wish to debug the samples with the EBC Debugger, simply replace qemu with debug (e.g. make arch debug arm). The EBC Debugger will be automatically downloaded for the required arch.

Note: The assembler itself is really only comprised of the files you can find under include\. Everything else is just samples or test data.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].