Skip to main content

ASMpy is a python backend for nasm or yasm. It makes easy to writing operating systems.

I renamed these instructions:

jmp - jump mov - move hlt - halt int - interrupt cmp - compare

And added functions:

mkboot - alias for “times 510-($-$$) db 0” and “dw 0xAA55” (makes bootloader) printchar - prints a one symbol printchar_f - prints a one symbol without “mov AH, 0x0e” (before it you must call initvideo()) initvideo - alias for “mov AH, 0x0e” (tty mode) printtext - prints a text printtext_f - same as printtext

cmd - is a buffer

Example:

import asmpy

asmpy.printtext(“Hello world!!!”); asmpy.mkboot()

open(“hello_world.asm”,”w”).write(asmpy.cmd)

And you get a hello_world.asm file. Compile it with nasm or yasm:

nasm hello_world.asm

Run your program with qemu:

qemu-system-x86_64 hello_world

You get a Hello world on BIOS!

Metadata

Release files for asmpy 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asmpy 1.1
File Size Uploaded
asmpy-1.1.tar.gz 2.0 kB Details

Release files / asmpy-1.1.tar.gz

Download URL asmpy-1.1.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
af527c0832357c2150745be892811274e0f2b371776a6862a16a6e21f31da478
BLAKE2b-256 checksum
How to use checksums
a74f8adc53d37f47e9e9e821e15b9010e570ea76bf3d4758deb66d34705b0908
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Release history Release notifications | RSS feed

This release

1.1 This release

1 release file

1.0.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page