[Wisp-cvs] wisp/users/dig com.py,NONE,1.1
Status: Alpha
Brought to you by:
digg
|
From: <di...@us...> - 2003-05-19 11:42:52
|
Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv6032
Added Files:
com.py
Log Message:
actually added com.py to the repository
--- NEW FILE: com.py ---
#### com.py - the COM executable format used by CP/M and MS-DOS
#
# Copyleft © 2003 by Andres Soolo (di...@us...)
# This file is licensed under the GNU GPL v2. If you
# don't know what that means, please do read the GPL.
#
#### @(#) $Id: com.py,v 1.1 2003/05/19 11:42:49 digg Exp $
from linkie import Linkie
def make_com_executable (text = None, data = None, bss = None,
base_address = 0x00400000):
e = Linkie('<');
if text.get_symbol_dict()['&_start'] != 0:
raise 'misplaced &_start', text
if text.get_alignment() > 0x100:
raise 'unattainable alignment', text
e.glue(e.memsz(), text, 0x100)
e.align(data.get_alignment())
e.glue(e.memsz(), data, e.memsz() + 0x100)
e.align(bss.get_alignment())
e.glue(e.memsz(), bss, e.memsz() + 0x100, bitlessp = 1)
e.link()
return e
|