Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv13126
Modified Files:
Makefile.am tran-builtins tran.py
Added Files:
cpmhello.tran i8080.tran
Log Message:
introduced support for i8080 and CP/M
--- NEW FILE: cpmhello.tran ---
\\\\ cpmhello - 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: cpmhello.tran,v 1.1 2003/05/19 08:35:18 digg Exp $
\ Don't forget to translate with -fcom
needs i8080
label _start \ main entry point
%de 'message $mov
%c 9 $mov
5 $call
0 $jmp
.data
label message
"Hello, world!$"
times b,
\ vim: ft=tran
--- NEW FILE: i8080.tran ---
\\\\ i8080.tran - Intel's 8080 instructions
\
\ 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: i8080.tran,v 1.1 2003/05/19 08:35:18 digg Exp $
\ Note: %m is not a real register but reference via %hl
:regs reg8 %b %c %d %e %h %l %m %a ;
\ Note that minors of reg16 are not used yet.
:regs reg16 %bc %de %hl %psw %sp ; \ Z80 calls %psw %af
\ instructions
:[ lit ] $jmp #xC3 b, w, ;
:[ lit ] $call #xCD b, w, ;
:[ %bc lit ] $mov #x01 b, t, drop ;
:[ %de lit ] $mov #x11 b, t, drop ;
:[ %hl lit ] $mov #x21 b, t, drop ;
:[ %sp lit ] $mov #x31 b, t, drop ;
:[ reg8 lit ] $mov swap minor 8 * #o006 + b, b, ;
\ vim: ft=tran
Index: Makefile.am
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/Makefile.am,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- Makefile.am 18 May 2003 23:24:39 -0000 1.28
+++ Makefile.am 19 May 2003 08:35:18 -0000 1.29
@@ -10,10 +10,11 @@
coff.py com.py elf.py pe.py \
tran.py tran-builtins tran-emitters builtin.tran \
i8086.tran i80186.tran i80286.tran i80386.tran i80486.tran pentium.tran \
+ i8080.tran \
ia16.tran ia32.tran \
coff.tran elf.tran mz.tran pe.tran \
winapi.tran \
- hello.tran mswhello.tran doshello.tran \
+ hello.tran mswhello.tran doshello.tran cpmhello.tran \
makehello.py elfdump.py
all:
Index: tran-builtins
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/tran-builtins,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- tran-builtins 18 May 2003 17:43:27 -0000 1.37
+++ tran-builtins 19 May 2003 08:35:18 -0000 1.38
@@ -6,6 +6,10 @@
#
#### @(#) $Id$
+* int int
+ n = interpreter.regstack.pop(); m = interpreter.regstack.pop()
+ interpreter.regstack.append(m * n)
+
+ int int
n = interpreter.regstack.pop(); m = interpreter.regstack.pop()
interpreter.regstack.append(m + n)
Index: tran.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -d -r1.120 -r1.121
--- tran.py 18 May 2003 23:18:06 -0000 1.120
+++ tran.py 19 May 2003 08:35:18 -0000 1.121
@@ -56,6 +56,8 @@
return Integer_Literal(long(this) + long(that))
def __sub__ (this, that):
return Integer_Literal(long(this) - long(that))
+ def __mul__ (this, that):
+ return Integer_Literal(long(this) * long(that))
def __repr__ (this):
return 'Integer_Literal(%i)' % long(this)
def get_scalar (this):
|