[Wisp-cvs] wisp/users/dig doshello.tran,NONE,1.1 Makefile.am,1.25,1.26 i8086.tran,1.9,1.10 tran.py,1
Status: Alpha
Brought to you by:
digg
|
From: <di...@us...> - 2003-05-18 23:18:10
|
Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv9772
Modified Files:
Makefile.am i8086.tran tran.py
Added Files:
doshello.tran
Log Message:
implemented COM-file generation
--- NEW FILE: doshello.tran ---
\\\\ doshello.tran - produce a friendly greeting
\
\ 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: doshello.tran,v 1.1 2003/05/18 23:18:06 digg Exp $
\ Don't forget to translate with -fcom
needs i8086
needs ia16
label _start \ main entry point
#x8C b, #xc8 b, \ mov %ax, %cs
#x8E b, #xD8 b, \ mov %ds, %ax
%ah 9 $mov
%dx 'message $mov
#x21 $int
%ax #x4C00 $mov
#x21 $int
.data
label message
"Hello, world!$"
times b,
\ vim: ft=tran
Index: Makefile.am
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/Makefile.am,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Makefile.am 18 May 2003 17:22:55 -0000 1.25
+++ Makefile.am 18 May 2003 23:18:06 -0000 1.26
@@ -7,12 +7,12 @@
#### @(#) $Id$
EXTRA_DIST = .cvsignore .pycheckrc struburn.wisp bits.py linkie.py \
- coff.py elf.py pe.py \
+ coff.py com.py elf.py pe.py \
tran.py tran-builtins tran-emitters builtin.tran \
i8086.tran i80386.tran i80486.tran pentium.tran ia16.tran ia32.tran \
coff.tran elf.tran mz.tran pe.tran \
winapi.tran \
- hello.tran mswhello.tran \
+ hello.tran mswhello.tran doshello.tran \
makehello.py elfdump.py
all:
Index: i8086.tran
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/i8086.tran,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- i8086.tran 18 May 2003 11:40:46 -0000 1.9
+++ i8086.tran 18 May 2003 23:18:06 -0000 1.10
@@ -24,7 +24,7 @@
\ instructions
:[ lit ] $int #xCD b, b, ;
-:[ reg8 lit ] $mov swap minor #o260 + b, ;
+:[ reg8 lit ] $mov swap minor #o260 + b, b, ;
:[ reg16 lit ] $mov $o16 swap minor #o270 + b, w, ;
:[ reg32 lit ] $mov $o32 swap minor #o270 + b, t, ;
Index: tran.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- tran.py 18 May 2003 21:28:22 -0000 1.119
+++ tran.py 18 May 2003 23:18:06 -0000 1.120
@@ -380,9 +380,14 @@
from getopt import getopt
import elf
import pe
+ import com
import sys
- default_output_names = {'elf': 'a.out', 'pe': 'untitled.exe'}
+ default_output_names = {
+ 'elf': 'a.out',
+ 'pe': 'untitled.exe',
+ 'com': 'prog.com',
+ }
verbose = 0
format = 'elf'
opts, args = getopt(sys.argv[1:], 'vo:b:f:',
@@ -409,6 +414,9 @@
binary = apply(elf.make_ELF32_object, [], argum)
elif format == 'pe':
binary = apply(pe.make_pe_executable, [], argum)
+ elif format == 'com':
+ binary = apply(com.make_com_executable, [], argum)
+ else: raise 'unknown output format', format
f = open(output_name, 'w')
binary.get_file().tofile(f)
f.close()
|