wisp-cvs Mailing List for Wisp interpreter (Page 3)
Status: Alpha
Brought to you by:
digg
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(30) |
Sep
(312) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(5) |
Feb
(131) |
Mar
(17) |
Apr
(184) |
May
(252) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
From: <di...@us...> - 2003-05-19 13:37:51
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv26052 Modified Files: coff.tran pe.py Log Message: made !coff/symptr and #coff/nsyms optional Index: coff.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/coff.tran,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- coff.tran 18 May 2003 16:17:55 -0000 1.3 +++ coff.tran 19 May 2003 13:37:48 -0000 1.4 @@ -31,8 +31,8 @@ \ 0x0466 Mips 16 with FPU '#coff/nscns w, '#coff/timdat (opt) t, - '!coff/symptr t, - '#coff/nsyms t, + '!coff/symptr (opt) t, + '#coff/nsyms (opt) t, '#coff/opthdr w, '#coff/flags w, \ Flags for COFF: Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- pe.py 19 May 2003 13:34:31 -0000 1.27 +++ pe.py 19 May 2003 13:37:48 -0000 1.28 @@ -185,8 +185,6 @@ e.place_symbol('#coff/magic', 0x014C) # I386MAGIC e.place_symbol('#coff/nscns', len(sectnames)) e.place_symbol('#coff/timdat', int(time.time())) - e.place_symbol('!coff/symptr', 0) - e.place_symbol('#coff/nsyms', 0) e.place_symbol('#coff/opthdr', 0x00E0) e.place_symbol('#coff/flags', 0x020F) e.place_symbol('#aout/magic', 0x010B) # PE32 |
From: <di...@us...> - 2003-05-19 13:34:34
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv23301 Modified Files: pe.py Log Message: more tranification Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- pe.py 19 May 2003 13:30:32 -0000 1.26 +++ pe.py 19 May 2003 13:34:31 -0000 1.27 @@ -80,13 +80,14 @@ e.place_symbol('!pe') e.emit_string('PE\0\0') interpret_single('make-coff-header', e, include = 'coff') - Interpreter(e).do('needs pe make-pe-aout-header') + do = Interpreter(e).do + do('needs pe') + do('make-pe-aout-header') text = text.copy() # so we won't add import stubs to the original linkie imports = Linkie('<') sectnames = ['.text', '.data', '.bss', '.imports'] sections = {'.text': text, '.data': data, '.bss': bss, '.imports': imports} - for s in sectnames: - interpret_single(["'", s, 'make-pe-section-header'], e, include = 'pe') + for s in sectnames: do("' " + s + " make-pe-section-header") e.place_symbol('#.text/flags', 0x60000020) e.place_symbol('#.data/flags', 0xc0000040) e.place_symbol('#.bss/flags', 0xc0000080) |
From: <di...@us...> - 2003-05-19 13:34:04
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv18383 Modified Files: pe.py pe.tran Log Message: converted the body of make_pe_aout_header into |make-pe-aout-header| Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- pe.py 19 May 2003 13:22:21 -0000 1.24 +++ pe.py 19 May 2003 13:28:27 -0000 1.25 @@ -52,81 +52,7 @@ def make_pe_aout_header (): h = Linkie('<') interp = Interpreter(h) - # #aout/image-base must be multiple of 64ki - # #aout/file-align must be a power of 2 in range of [512 ... 64Ki] - # &aout/image-end must be a multiple of #aout/memory-align - # !aout/header-end must be a multiple of #aout/file-align - # Known flags for #aout/dll-flags - # 0x0001 - per-process library initialization - # 0x0002 - per-process library termination - # 0x0004 - per-thread library initialization - # 0x0008 - per-thread library termination - # All others must be zero. - interp.do(""" - 4 align - ' #aout/magic w, 0x10B =: #?aout/magic - ' #aout/linker-version-major (opt) b, - ' #aout/linker-version-minor (opt) b, - ' #aout/text-size t, - ' #aout/data-size t, - ' #aout/bss-size t, - ' &_start ' #rva + t, - ' &.text ' #rva + t, - ' &.data ' #rva + t,""" + # not present in PE32+ (?) - """ - ' #aout/image-base t, - ' #aout/memory-align t, - ' #aout/file-align t, - ' #aout/os-version-major w, - ' #aout/os-version-minor w, - ' #aout/image-version-major (opt) w, - ' #aout/image-version-minor (opt) w, - ' #aout/subsys-version-major w, - ' #aout/subsys-version-minor w, - 0 t, - ' &aout/image-end ' #rva + t, - ' !aout/header-end t, - ' #aout/checksum (opt) t, - ' #aout/subsys w, - ' #aout/dll-flags w, - ' #aout/stack-reserve-size t, - ' #aout/stack-commit-size t, - ' #aout/heap-reserve-size t, - ' #aout/heap-commit-size t, - 0 t,""" + # loader flags -- obsolete - """ - ' #aout/dict-entry-count t, - ' &export-table ' #rva + t, - ' #export-table/size t, - ' &.imports ' #rva + t, - ' #.imports/memsz t, - ' &resource-table ' #rva + t, - ' #resource-table/size t, - ' &exception-table ' #rva + t, - ' #exception-table/size t, - ' !cert-table t, - ' #cert-table/size t, - ' &base-rel-table ' #rva + t, - ' #base-rel-table/size t, - ' &debug-data ' #rva + t, - ' #debug-data/size t, - ' &arch-specific ' #rva + t, - ' #arch-specific/size t, - ' &global-pointer ' #rva + t, - 0 t, - ' &tls ' #rva + t, - ' #tls/size t, - ' &load-config-table ' #rva + t, - ' #load-config-table/size t, - ' &bound-import-table ' #rva + t, - ' #bound-import-table/size t, - ' &import-address-table ' #rva + t, - ' #import-address-table/size t, - ' &delay-import-descr ' #rva + t, - ' #delay-import-descr/size t, - ' &COM+-runtime-header ' #rva + t, - ' #COM+-runtime-header/size t, - 0 t, 0 t,""") # reserved + interp.do('needs pe make-pe-aout-header') return h def populate_pe_directories (linkie, base, **given): Index: pe.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.tran,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- pe.tran 18 May 2003 17:47:38 -0000 1.8 +++ pe.tran 19 May 2003 13:28:27 -0000 1.9 @@ -42,4 +42,77 @@ mingle #*/flags t, ; +:[ ] make-pe-aout-header + \ &aout/image-end must be a multiple of #aout/memory-align + \ !aout/header-end must be a multiple of #aout/file-align + 4 align + '#aout/magic w, #x10B =: #?aout/magic + '#aout/linker-version-major (opt) b, + '#aout/linker-version-minor (opt) b, + '#aout/text-size t, + '#aout/data-size t, + '#aout/bss-size t, + '&_start '#rva + t, + '&.text '#rva + t, + '&.data '#rva + t, \ not present in PE32+ (?) + '#aout/image-base t, \ must be multiple of 64ki + '#aout/memory-align t, + '#aout/file-align t, \ must be a power of 2 in range of [512 ... 64Ki] + '#aout/os-version-major w, + '#aout/os-version-minor w, + '#aout/image-version-major (opt) w, + '#aout/image-version-minor (opt) w, + '#aout/subsys-version-major w, + '#aout/subsys-version-minor w, + 0 t, + '&aout/image-end '#rva + t, + '!aout/header-end t, + '#aout/checksum (opt) t, + '#aout/subsys w, + '#aout/dll-flags w, + \ Known flags for #aout/dll-flags + \ 0x0001 - per-process library initialization + \ 0x0002 - per-process library termination + \ 0x0004 - per-thread library initialization + \ 0x0008 - per-thread library termination + \ All others must be zero. + '#aout/stack-reserve-size t, + '#aout/stack-commit-size t, + '#aout/heap-reserve-size t, + '#aout/heap-commit-size t, + 0 t, \ loader flags -- obsolete + '#aout/dict-entry-count t, + '&export-table '#rva + t, + '#export-table/size t, + '&.imports '#rva + t, + '#.imports/memsz t, + '&resource-table '#rva + t, + '#resource-table/size t, + '&exception-table '#rva + t, + '#exception-table/size t, + '!cert-table t, + '#cert-table/size t, + '&base-rel-table '#rva + t, + '#base-rel-table/size t, + '&debug-data '#rva + t, + '#debug-data/size t, + '&arch-specific '#rva + t, + '#arch-specific/size t, + '&global-pointer '#rva + t, + 0 t, + '&tls '#rva + t, + '#tls/size t, + '&load-config-table '#rva + t, + '#load-config-table/size t, + '&bound-import-table '#rva + t, + '#bound-import-table/size t, + '&import-address-table '#rva + t, + '#import-address-table/size t, + '&delay-import-descr '#rva + t, + '#delay-import-descr/size t, + '&COM+-runtime-header '#rva + t, + '#COM+-runtime-header/size t, + 0 t, 0 t, +; + \ vim: ft=tran |
From: <di...@us...> - 2003-05-19 13:30:35
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv19595 Modified Files: pe.py Log Message: dropped make_pe_aout_header Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- pe.py 19 May 2003 13:28:27 -0000 1.25 +++ pe.py 19 May 2003 13:30:32 -0000 1.26 @@ -49,12 +49,6 @@ b.place_symbol('#mz/blocks-in-file', (b.filesz() + 0x1FF) / 0x200) return b -def make_pe_aout_header (): - h = Linkie('<') - interp = Interpreter(h) - interp.do('needs pe make-pe-aout-header') - return h - def populate_pe_directories (linkie, base, **given): defaults = { '&export-table': base, '#export-table/size': 0, @@ -86,7 +80,7 @@ e.place_symbol('!pe') e.emit_string('PE\0\0') interpret_single('make-coff-header', e, include = 'coff') - e.glue(e.memsz(), make_pe_aout_header(), None) + Interpreter(e).do('needs pe make-pe-aout-header') text = text.copy() # so we won't add import stubs to the original linkie imports = Linkie('<') sectnames = ['.text', '.data', '.bss', '.imports'] |
From: <di...@us...> - 2003-05-19 13:22:25
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv14202 Modified Files: pe.py Log Message: tranified some more of make_pe_aout_header via Interpreter.do Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- pe.py 19 May 2003 13:19:45 -0000 1.23 +++ pe.py 19 May 2003 13:22:21 -0000 1.24 @@ -122,12 +122,11 @@ ' #bound-import-table/size t, ' &import-address-table ' #rva + t, ' #import-address-table/size t, - """) - h.emit_tetra_sum(['&delay-import-descr', '#rva']) - h.emit_tetra_sum(['#delay-import-descr/size']) - h.emit_tetra_sum(['&COM+-runtime-header', '#rva']) - h.emit_tetra_sum(['#COM+-runtime-header/size']) - h.emit_tetra(0); h.emit_tetra(0) # reserved + ' &delay-import-descr ' #rva + t, + ' #delay-import-descr/size t, + ' &COM+-runtime-header ' #rva + t, + ' #COM+-runtime-header/size t, + 0 t, 0 t,""") # reserved return h def populate_pe_directories (linkie, base, **given): |
From: <di...@us...> - 2003-05-19 13:19:48
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv12366 Modified Files: pe.py Log Message: tranified some more of make_pe_aout_header via Interpreter.do Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- pe.py 19 May 2003 13:07:24 -0000 1.22 +++ pe.py 19 May 2003 13:19:45 -0000 1.23 @@ -118,11 +118,11 @@ ' #tls/size t, ' &load-config-table ' #rva + t, ' #load-config-table/size t, + ' &bound-import-table ' #rva + t, + ' #bound-import-table/size t, + ' &import-address-table ' #rva + t, + ' #import-address-table/size t, """) - h.emit_tetra_sum(['&bound-import-table', '#rva']) - h.emit_tetra_sum(['#bound-import-table/size']) - h.emit_tetra_sum(['&import-address-table', '#rva']) - h.emit_tetra_sum(['#import-address-table/size']) h.emit_tetra_sum(['&delay-import-descr', '#rva']) h.emit_tetra_sum(['#delay-import-descr/size']) h.emit_tetra_sum(['&COM+-runtime-header', '#rva']) |
From: <di...@us...> - 2003-05-19 13:07:27
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv2297 Modified Files: pe.py Log Message: tranified some more of make_pe_aout_header via Interpreter.do Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- pe.py 19 May 2003 13:05:44 -0000 1.21 +++ pe.py 19 May 2003 13:07:24 -0000 1.22 @@ -114,11 +114,11 @@ ' #arch-specific/size t, ' &global-pointer ' #rva + t, 0 t, + ' &tls ' #rva + t, + ' #tls/size t, + ' &load-config-table ' #rva + t, + ' #load-config-table/size t, """) - h.emit_tetra_sum(['&tls', '#rva']) - h.emit_tetra_sum(['#tls/size']) - h.emit_tetra_sum(['&load-config-table', '#rva']) - h.emit_tetra_sum(['#load-config-table/size']) h.emit_tetra_sum(['&bound-import-table', '#rva']) h.emit_tetra_sum(['#bound-import-table/size']) h.emit_tetra_sum(['&import-address-table', '#rva']) |
From: <di...@us...> - 2003-05-19 13:05:47
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv1129 Modified Files: pe.py Log Message: tranified some more of make_pe_aout_header via Interpreter.do Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- pe.py 19 May 2003 12:57:20 -0000 1.20 +++ pe.py 19 May 2003 13:05:44 -0000 1.21 @@ -108,13 +108,13 @@ ' #cert-table/size t, ' &base-rel-table ' #rva + t, ' #base-rel-table/size t, + ' &debug-data ' #rva + t, + ' #debug-data/size t, + ' &arch-specific ' #rva + t, + ' #arch-specific/size t, + ' &global-pointer ' #rva + t, + 0 t, """) - h.emit_tetra_sum(['&debug-data', '#rva']) - h.emit_tetra_sum(['#debug-data/size']) - h.emit_tetra_sum(['&arch-specific', '#rva']) - h.emit_tetra_sum(['#arch-specific/size']) - h.emit_tetra_sum(['&global-pointer', '#rva']) - h.emit_tetra(0) h.emit_tetra_sum(['&tls', '#rva']) h.emit_tetra_sum(['#tls/size']) h.emit_tetra_sum(['&load-config-table', '#rva']) |
From: <di...@us...> - 2003-05-19 13:02:55
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv31252 Modified Files: builtin.tran Log Message: extracted |by-default| from |(opt)| Index: builtin.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/builtin.tran,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- builtin.tran 18 May 2003 16:15:10 -0000 1.3 +++ builtin.tran 19 May 2003 13:02:52 -0000 1.4 @@ -6,8 +6,12 @@ \ \\\\ @(#) $Id$ +:[ sym int ] by-default \ ( symbol int -- symbol ) + over weaker bind +; + :[ sym ] (opt) \ ( symbol -- symbol ) - dup weaker 0 swap bind + 0 by-default ; :[ ] tetras dup + dup + ; \ FIXME |
From: <di...@us...> - 2003-05-19 13:02:23
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv30814 Modified Files: tran-builtins Log Message: implemented |over any any| Index: tran-builtins =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran-builtins,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- tran-builtins 19 May 2003 08:35:18 -0000 1.38 +++ tran-builtins 19 May 2003 13:02:21 -0000 1.39 @@ -146,6 +146,9 @@ interpreter.toksrc.push(Lexer(str(name) + '.tran')) interpreter.included[name] = 1 +over any any + interpreter.regstack.append(interpreter.regstack[-2]) + '|name if not name[0] in '&#!': name = '&' + name interpreter.regstack.append(Symbol_Literal(name)) |
From: <di...@us...> - 2003-05-19 12:57:23
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv26561 Modified Files: pe.py Log Message: tranified some more of make_pe_aout_header via Interpreter.do Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- pe.py 19 May 2003 12:52:30 -0000 1.19 +++ pe.py 19 May 2003 12:57:20 -0000 1.20 @@ -100,15 +100,15 @@ ' #export-table/size t, ' &.imports ' #rva + t, ' #.imports/memsz t, + ' &resource-table ' #rva + t, + ' #resource-table/size t, + ' &exception-table ' #rva + t, + ' #exception-table/size t, + ' !cert-table t, + ' #cert-table/size t, + ' &base-rel-table ' #rva + t, + ' #base-rel-table/size t, """) - h.emit_tetra_sum(['&resource-table', '#rva']) - h.emit_tetra_sum(['#resource-table/size']) - h.emit_tetra_sum(['&exception-table', '#rva']) - h.emit_tetra_sum(['#exception-table/size']) - h.emit_tetra_sum(['!cert-table']) - h.emit_tetra_sum(['#cert-table/size']) - h.emit_tetra_sum(['&base-rel-table', '#rva']) - h.emit_tetra_sum(['#base-rel-table/size']) h.emit_tetra_sum(['&debug-data', '#rva']) h.emit_tetra_sum(['#debug-data/size']) h.emit_tetra_sum(['&arch-specific', '#rva']) |
From: <di...@us...> - 2003-05-19 12:52:34
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv22900 Modified Files: pe.py Log Message: tranified some more of make_pe_aout_header via Interpreter.do Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- pe.py 18 May 2003 23:49:41 -0000 1.18 +++ pe.py 19 May 2003 12:52:30 -0000 1.19 @@ -96,11 +96,11 @@ 0 t,""" + # loader flags -- obsolete """ ' #aout/dict-entry-count t, + ' &export-table ' #rva + t, + ' #export-table/size t, + ' &.imports ' #rva + t, + ' #.imports/memsz t, """) - h.emit_tetra_sum(['&export-table', '#rva']) - h.emit_tetra_sum(['#export-table/size']) - h.emit_tetra_sum(['&.imports', '#rva']) - h.emit_tetra_sum(['#.imports/memsz']) h.emit_tetra_sum(['&resource-table', '#rva']) h.emit_tetra_sum(['#resource-table/size']) h.emit_tetra_sum(['&exception-table', '#rva']) |
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 |
From: <di...@us...> - 2003-05-19 09:44:08
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv12423 Modified Files: cpmhello.tran Log Message: minor optimization Index: cpmhello.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/cpmhello.tran,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cpmhello.tran 19 May 2003 08:35:18 -0000 1.1 +++ cpmhello.tran 19 May 2003 09:21:09 -0000 1.2 @@ -14,7 +14,7 @@ %de 'message $mov %c 9 $mov 5 $call - 0 $jmp + 0 $rst .data label message |
From: <di...@us...> - 2003-05-19 09:20:52
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv12150 Modified Files: i8080.tran Log Message: implemented |$rst int| Index: i8080.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/i8080.tran,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- i8080.tran 19 May 2003 09:08:41 -0000 1.2 +++ i8080.tran 19 May 2003 09:20:47 -0000 1.3 @@ -22,4 +22,6 @@ :[ %sp lit ] $mov #x31 b, w, drop ; :[ reg8 lit ] $mov swap minor 8 * #o006 + b, b, ; +:[ int ] $rst 8 * #o307 + b, ; + \ vim: ft=tran |
From: <di...@us...> - 2003-05-19 09:08:44
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv3496 Modified Files: i8080.tran Log Message: fixed word width typos Index: i8080.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/i8080.tran,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- i8080.tran 19 May 2003 08:35:18 -0000 1.1 +++ i8080.tran 19 May 2003 09:08:41 -0000 1.2 @@ -16,10 +16,10 @@ :[ 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 ; +:[ %bc lit ] $mov #x01 b, w, drop ; +:[ %de lit ] $mov #x11 b, w, drop ; +:[ %hl lit ] $mov #x21 b, w, drop ; +:[ %sp lit ] $mov #x31 b, w, drop ; :[ reg8 lit ] $mov swap minor 8 * #o006 + b, b, ; \ vim: ft=tran |
From: <di...@us...> - 2003-05-19 08:35:22
|
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): |
From: <di...@us...> - 2003-05-18 23:49:44
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv1690 Modified Files: pe.py Log Message: tranified some more of make_pe_aout_header via Interpreter.do Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- pe.py 18 May 2003 21:56:26 -0000 1.17 +++ pe.py 18 May 2003 23:49:41 -0000 1.18 @@ -93,9 +93,10 @@ ' #aout/stack-commit-size t, ' #aout/heap-reserve-size t, ' #aout/heap-commit-size t, + 0 t,""" + # loader flags -- obsolete + """ + ' #aout/dict-entry-count t, """) - h.emit_tetra(0) # loader flags - obsolete - h.emit_tetra_sum(['#aout/dict-entry-count']) h.emit_tetra_sum(['&export-table', '#rva']) h.emit_tetra_sum(['#export-table/size']) h.emit_tetra_sum(['&.imports', '#rva']) |
From: <di...@us...> - 2003-05-18 23:24:42
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv15814 Modified Files: Makefile.am i80286.tran Added Files: i80186.tran Log Message: introduced i80186.tran --- NEW FILE: i80186.tran --- \\\\ i80186.tran - Intel's 80186 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: i80186.tran,v 1.1 2003/05/18 23:24:39 digg Exp $ needs i8086 :[ ] $insb #x6C b, ; \ vim: ft=tran Index: Makefile.am =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/Makefile.am,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Makefile.am 18 May 2003 23:22:26 -0000 1.27 +++ Makefile.am 18 May 2003 23:24:39 -0000 1.28 @@ -9,7 +9,8 @@ EXTRA_DIST = .cvsignore .pycheckrc struburn.wisp bits.py linkie.py \ coff.py com.py elf.py pe.py \ tran.py tran-builtins tran-emitters builtin.tran \ - i8086.tran i80286.tran i80386.tran i80486.tran pentium.tran ia16.tran ia32.tran \ + i8086.tran i80186.tran i80286.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 doshello.tran \ Index: i80286.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/i80286.tran,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- i80286.tran 18 May 2003 23:22:26 -0000 1.1 +++ i80286.tran 18 May 2003 23:24:39 -0000 1.2 @@ -6,7 +6,7 @@ \ \\\\ @(#) $Id$ -needs i8086 +needs i80186 :[ ] $clts #x0F b, #x06 b, ; |
From: <di...@us...> - 2003-05-18 23:22:29
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv13802 Modified Files: Makefile.am i80386.tran Added Files: i80286.tran Log Message: introduced i80286.tran --- NEW FILE: i80286.tran --- \\\\ i80286.tran - Intel's 80286 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: i80286.tran,v 1.1 2003/05/18 23:22:26 digg Exp $ needs i8086 :[ ] $clts #x0F b, #x06 b, ; \ vim: ft=tran Index: Makefile.am =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/Makefile.am,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Makefile.am 18 May 2003 23:18:06 -0000 1.26 +++ Makefile.am 18 May 2003 23:22:26 -0000 1.27 @@ -9,7 +9,7 @@ EXTRA_DIST = .cvsignore .pycheckrc struburn.wisp bits.py linkie.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 \ + i8086.tran i80286.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 doshello.tran \ Index: i80386.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/i80386.tran,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- i80386.tran 18 May 2003 17:47:38 -0000 1.5 +++ i80386.tran 18 May 2003 23:22:26 -0000 1.6 @@ -6,7 +6,7 @@ \ \\\\ @(#) $Id$ -needs i8086 +needs i80286 \ registers :regs reg16/32 |
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() |
From: <di...@us...> - 2003-05-18 22:45:23
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv18613 Modified Files: mswhello.tran hello.tran Log Message: minor cleanup Index: mswhello.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/mswhello.tran,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- mswhello.tran 18 May 2003 21:33:05 -0000 1.16 +++ mswhello.tran 18 May 2003 22:45:15 -0000 1.17 @@ -12,9 +12,7 @@ needs ia32 needs winapi -\ main entry point - -label _start +label _start \ main entry point -11 GetStdHandle 'message '#msglen 'rckeep 0 WriteFile drop 0 ExitProcess Index: hello.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/hello.tran,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- hello.tran 18 May 2003 21:30:23 -0000 1.7 +++ hello.tran 18 May 2003 22:45:15 -0000 1.8 @@ -11,9 +11,7 @@ needs i80386 needs ia32 -\ main entry point - -label _start +label _start \ main entry point %edx '#msglen $mov %ecx 'message $mov %ebx 1 $mov |
From: <di...@us...> - 2003-05-18 21:56:30
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv17666 Modified Files: linkie.py pe.py Log Message: no file bits for .bss in PE files Index: linkie.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/linkie.py,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- linkie.py 18 May 2003 15:42:06 -0000 1.63 +++ linkie.py 18 May 2003 21:56:26 -0000 1.64 @@ -199,7 +199,7 @@ for ofs, typ, arg in that._linker_notes: this._linker_notes.append((ofs + delta, typ, arg)) return delta - def glue (this, offset, that, origin): + def glue (this, offset, that, origin, bitlessp = 0): # Pastes /that/ into /this/ at specified /offset/. # Adds /origin/ to all &symbols in /that/ and converta sll # relative references to &symbols in /that/ into absolute @@ -216,9 +216,10 @@ # convert any padding to hard zeroes if needed if that.filesz(): this.deskip() - # carry over all the bits - this._contents.extend(that._contents) - this._skipped = that._skipped + if not bitlessp: + # carry over all the bits + this._contents.extend(that._contents) + this._skipped = that._skipped # carry over the symbols for sym, val in that._symbols: Index: pe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- pe.py 18 May 2003 18:04:14 -0000 1.16 +++ pe.py 18 May 2003 21:56:26 -0000 1.17 @@ -245,14 +245,17 @@ # memory alignment memory_boundary = roundup(memory_boundary, \ max(0x1000, sections[s].get_alignment())) - # establish origin symbols - e.place_symbol('!' + s) - e.place_symbol('&' + s, memory_boundary) # process sizes e.place_symbol('#' + s + '/memsz', sections[s].memsz()) - e.place_symbol('#' + s + '/filesz', roundup(sections[s].filesz(), 0x200)) + filesz = roundup(sections[s].filesz(), 0x200) + e.place_symbol('#' + s + '/filesz', filesz) + # establish origin symbols + if filesz: e.place_symbol('!' + s) + else: e.place_symbol('!' + s, 0) + e.place_symbol('&' + s, memory_boundary) + # paste bits - e.glue(e.memsz(), sections[s], memory_boundary) + e.glue(e.memsz(), sections[s], memory_boundary, bitlessp = s == '.bss') # increase memory_boundary memory_boundary = roundup(memory_boundary + sections[s].memsz(), 4096) |
From: <di...@us...> - 2003-05-18 21:33:08
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv5707 Modified Files: mswhello.tran Log Message: use cleaner string syntax Index: mswhello.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/mswhello.tran,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- mswhello.tran 18 May 2003 17:47:38 -0000 1.15 +++ mswhello.tran 18 May 2003 21:33:05 -0000 1.16 @@ -16,12 +16,14 @@ label _start -11 GetStdHandle - 'message 7 'rckeep 0 WriteFile drop + 'message '#msglen 'rckeep 0 WriteFile drop 0 ExitProcess .data label message - #/H b, #/E b, #/L b, #/L b, #/O b, 13 b, 10 b, + "Hello, world!\r\n" + dup =: #msglen + times b, .bss label rckeep |
From: <di...@us...> - 2003-05-18 21:30:27
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv4806 Modified Files: hello.tran Log Message: use cleaner string syntax Index: hello.tran =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/hello.tran,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- hello.tran 18 May 2003 17:47:38 -0000 1.6 +++ hello.tran 18 May 2003 21:30:23 -0000 1.7 @@ -14,7 +14,7 @@ \ main entry point label _start - %edx 6 $mov + %edx '#msglen $mov %ecx 'message $mov %ebx 1 $mov %eax 4 $mov @@ -25,6 +25,8 @@ .data label message - #/H b, #/E b, #/L b, #/L b, #/O b, 10 b, + "Hello, world!\n" + dup =: #msglen \ assign its length to #msglen + times b, \ emit data \ vim: ft=tran |