# Copyright 2006-2007 Grant T. Olson.
# See LICENSE for terms.
from  compyler.codeObjectAssembler import codeObjectAssembler, debug
from pyasm.x86cpToCoff import CpToCoff
from pyasm.x86asm import manglePythonNames

testMod = """
a = 1
b = 2
print "I am awesome"
print "No I'm not"
print a + b

def foo():
    print "Dsfsdfsadf"

#foo()

print globals()

"""

debug = 0

co = compile(testMod,"","exec")
coa = codeObjectAssembler()

assem = coa.assembleCodeObject(co, name="exe:_main")
manglePythonNames(assem)

coff = CpToCoff(assem,"-defaultlib:LIBC -defaultlib:OLDNAMES ").makeReleaseCoff()
f = file("test_exe.obj","wb")
coff.WriteToFile(f)
f.close()
