Skip to content

pombredanne/pynasm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About:

pynasm is a python wrapper around nasm. It's still in very early stages, but if you're feeling adventurous, you can try the following snippet:

from pynasm import *

with assembler() as get_max_cores:
    push(ebx)
    push(ecx)
    push(edx)
    mov(eax,4) 
    xor(ecx,ecx)
    cpuid()
    shr(eax,26)
    inc(eax)
    pop(edx)
    pop(ecx)
    pop(ebx)
    ret()

print("maximum number of cores:", get_max_cores())

About

Python wrapper around nasm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published