Commit 650ad97a authored by Dmitry Bogatov's avatar Dmitry Bogatov

Import Upstream version 2.71

parent 03f29eed
Sat Oct 27 21:10:34 2007 Albrecht Kleine <kleine@ak.sax.de>
-e3.h: UTF8 runtime detection now disabled by default
-e3.asm: removed ugly hack (introduced in #210)
-Makefile: removed destinations statc, dync, dync2
and added adjustments for linking on 32/64 bit
and current YASM and NASM versions with different
command line syntax, added 2 make destinations,
see release notes (in README) for details.
-e3_nasm_yasm.sed: extended script to avoid
later syntax errors in nasm
-e3.c: added Christian Ostheimer's patch for gcc 4.1
(thank you -- and sorry for delay!)
#215
***** FINAL RELEASE v2.7.1 *****
------------------------------------------------------------
Mon Jan 23 18:14:21 2006 Albrecht Kleine <kleine@ak.sax.de>
-e3.asm: bugfixed ^T key in empty file (WS edit mode)
-README: merged with README.UTF8
#214
***** released as v2.7.0 *****
-----------------------------------------------------------
Wed Jan 11 20:00:00 2006 Albrecht Kleine <kleine@ak.sax.de>
-e3.asm: various changes:
*replace variable errno with _errno
for "make statc" working again
* chganged max filesize to 1024000
* changed max filesize to 1024000
* bugfix handling ascii character 127
-Makefile: removed make distinations
test, dync and dync2
-/contrib directory: removed old stuff
-/bin directory: removed BeOS, QNX and Atheos stuff
-Makefile: removed make distination dync and dync2
#213
------------------------------------------------------------
Sun Jan 8 20:00:00 2006 Albrecht Kleine <kleine@ak.sax.de>
......@@ -82,7 +94,7 @@ Sun Feb 27 01:04:56 2005 Albrecht Kleine <kleine@ak.sax.de>
-e3.asm added runtime checking of console status
(started this in #195). This solves some problems
running e3/UTF8 in non-UTF8-terminals like "rxvt".
[ We are trying to keep togeher the UTF-8 bytes
[ We are trying to keep together the UTF-8 bytes
for 1 character also on non UTF-8 terminals. ]
#204
--------------------------------------------------------------
......
......@@ -35,25 +35,14 @@ MANDIR='$(PREFIX)/man/man$(MANSEC)'
ASOURCES=e3.asm e3.h
AFLAGS = -w+orphan-labels -f elf
# this fixes a nasty NASM version conflict
# NASM 0.98.08 claims to use -O2 by default, but does not.
# NASM 0.98 does not know the -O2 switch
#
ASVER := $(shell nasm -r)
ifeq ($(ASVER),NASM version 0.98)
NASM=nasm
else
NASM=nasm -O2
endif
NASM=nasm -O2
all: e3
e3: $(ASOURCES) Makefile
ifeq ($(OS),LINUX)
echo $(ASVER)
$(NASM) -f bin -l e3.lst -o e3 e3.asm -DCRIPLED_ELF=1 -D$(OS) -D$(EXMODE)
$(NASM) -f bin -l e3.lst -o e3 e3.asm -DCRIPLED_ELF=1 -D$(OS) -D$(EXMODE) -DNASM
chmod +x e3
ifeq ($(COMPRESS),upx)
if which upx > /dev/null 2>&1 ; then \
......@@ -65,7 +54,7 @@ ifeq ($(COMPRESS),gzexe)
endif
else
echo $(ASVER)
$(NASM) $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS) -D$(EXMODE)
$(NASM) $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS) -D$(EXMODE) -DNASM
ifeq ($(OS),QNX)
ld -s -o e3 e3.o -lc
else
......@@ -79,31 +68,11 @@ endif
ln -sf e3 e3vi
ln -sf e3 e3ne
# next three are for testing purpose: linking w libc
statc:
$(NASM) $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS) -DLIBC -D$(EXMODE)
ld -s -static -o e3statc e3.o -lc
dync:
$(NASM) $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS) -DLIBC -DDYN -D$(EXMODE)
gcc e3.o -o e3dync
# strip e3dync
dync2:
ifeq ($(OS),LINUX)
$(NASM) $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS) -DLIBC -DDYN -D$(EXMODE)
ld -s -m elf_i386 -o e3dync2 e3.o \
-lc -dynamic-linker /lib/ld-linux.so.2 \
/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtn.o
else
$(NASM) $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS) -DLIBC -DDYN -D$(EXMODE)
ld -m elf_i386 -o e3dync2 e3.o -lc -e _start /usr/lib/crt1.o
endif
# next for running in gnu debugger
debug: $(ASOURCES) Makefile
$(NASM) $(AFLAGS) -g -o e3.o e3.asm -l e3.lst -D$(OS) -D$(EXMODE)
ld -s -o e3 e3.o
$(NASM) $(AFLAGS) -g -o e3.o e3.asm -l e3.lst -D$(OS) -D$(EXMODE) -DNASM
ld -b elf32-i386 --oformat elf32-i386 -s -o e3 e3.o
strip --remove-section .comment e3
ln -sf e3 e3ws
ln -sf e3 e3em
......@@ -116,9 +85,10 @@ debug: $(ASOURCES) Makefile
# needs some sed changes (jmp vs jmp near) due heavy bugs in YASM optimizer
# (how to switch off that optimizer ?)
yasm: $(ASOURCES) Makefile
cat e3.asm | sed -f e3_nasm_yasm.sed \
| yasm -f elf -p nasm $(AFLAGS) -l e3.lstyasm -o e3.o -DLINUX -DSED -DYASM
ld -s -o e3 e3.o
cat e3.asm | sed -f e3_nasm_yasm.sed > e3.tmp
yasm -a x86 -m x86 -f elf32 -p nasm $(AFLAGS) -l e3.lstyasm -o e3.o -DLINUX -DSED -DYASM e3.tmp
rm e3.tmp
ld -b elf32-i386 --oformat elf32-i386 -s -o e3 e3.o
ln -sf e3 e3ws
ln -sf e3 e3em
ln -sf e3 e3pi
......@@ -129,28 +99,47 @@ yasm: $(ASOURCES) Makefile
# ditto YASM stuff
yasm64: $(ASOURCES) Makefile
cat e3.asm | sed -f e3_nasm_yasm.sed \
| sed -f e3_yasm_yasm64.sed \
| yasm -m amd64 -f elf -p nasm $(AFLAGS) -l e3.lstyasm64 -o e3.o -DLINUX -DSED -DYASM -DAMD64
ld -s -o e3 e3.o
| sed -f e3_yasm_yasm64.sed >e3.tmp
yasm -a x86 -m amd64 -f elf64 -p nasm -L nasm $(AFLAGS) \
-l e3.lstyasm64 -o e3.o -DLINUX -DSED -DYASM -DAMD64 e3.tmp
rm e3.tmp
ld -b elf64-x86-64 --oformat elf64-x86-64 -s -o e3 e3.o
ln -sf e3 e3ws
ln -sf e3 e3em
ln -sf e3 e3pi
ln -sf e3 e3vi
ln -sf e3 e3ne
# L I N U X only
# Experimental stuff for using NASM assembler
nasm64: $(ASOURCES) Makefile
cat e3.asm | sed -f e3_nasm_yasm.sed \
| sed -f e3_yasm_yasm64.sed >e3.tmp
$(NASM) -w+orphan-labels -f elf64 -o e3.o e3.tmp -l e3.lst64 -DLINUX -DSED -DYASM -DAMD64 -DNASM
rm e3.tmp
ld -b elf64-x86-64 --oformat elf64-x86-64 -s -o e3 e3.o
ln -sf e3 e3ws
ln -sf e3 e3em
ln -sf e3 e3pi
ln -sf e3 e3vi
ln -sf e3 e3ne
# added for compatibility reason:
nasm32: e3
# next for cross asm for the ELKS people
elks:
nasm -w+orphan-labels -f as86 -o e3-16.o e3-16.asm -l e3-16.lst -D AS86 -D ELKS
nasm -w+orphan-labels -f as86 -o e3-16.o e3-16.asm -l e3-16.lst -D AS86 -D ELKS -DNASM
ld86 -0 -s -i -H 0xF800 -o e3-16 e3-16.o
# next two for cross asm testing
w32lst:
$(NASM) -f coff -o e3.oW32 e3.asm -l e3.lstW32 -DW32
$(NASM) -f coff -o e3.oW32 e3.asm -l e3.lstW32 -DW32 -DNASM
rm e3.oW32
qnxlst:
$(NASM) -f elf -o e3.oQNX e3.asm -l e3.lstQNX -DQNX
$(NASM) -f elf -o e3.oQNX e3.asm -l e3.lstQNX -DQNX -DNASM
rm e3.oQNX
# next for release maintainance
......
README for mini editor e3 release 2.7.0 (aka 2.7)
README for mini editor e3 release 2.7.1
(c) GPL 2000-06 Albrecht Kleine
(c) GPL 2000-07 Albrecht Kleine
kleine@ak.sax.de
alb.kleine@gmx.de (please use "e3" in mail subject line)
1. OVERVIEW
......@@ -19,10 +18,20 @@ e3 can use Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings,
whichever the user chooses.
Also the user can calculate arithmetics inside the text.
e3's assembler version is available on 11 most important x86 OS,
see below for details.
Also available is an (alpha level) 32 bit native code assembler version
for ARM CPUs in little endian mode.
e3's assembler version is available on 9 important OS,
using 16/32/64 bit CPUs:
* Linux kernels 2.x
(from 16 bit ELKS via 32 bit x86 up to AMD64,
plus ARM-linux kernel 2.4 @zaurus PDA)
* FreeBSD 2.x-5.x
* OpenBSD 3.4,
* NetBSD 1.6,2.0
* BeOS 5PE
* Win98
* QNX RTP 6.1
* Atheos 0.3.7
* FreeDOS kernel 1.1.24
There is also a GNU-C-written version for non-i386-Unix
and non-ARM-Linux platforms (e3.c) using Wordstar keybindings only.
This README doesn't further mention e3.c. (Just make it!)
......@@ -31,33 +40,17 @@ e3 is designed to be INDEPENDENT OF LIBC OR ANY OTHER library,
except on QNX and Win32.
It's been tested using the terminal console, but Xterm, Eterm,
kvt, rxvt (no UTF8), vt220 and vt100 should work too.
kvt, rxvt, vt220 and vt100 should work too.
Beginning in version 2.6.0 e3 does support UTF-8 coding of unicode
characters like this: α ( <---should be a greek alpha )
e3.asm it's been tested under several x86 32 bit OS:
* Linux kernels 2.x
* FreeBSD 2.x-5.0
* OpenBSD 3.4,
* NetBSD 1.6,2.0
* BeOS 5PE
* Win98
* QNX RTP 6.1
* Atheos 0.3.7
e3.asm 64 bit it's been tested under Linux OS:
* kernel 2.4 and 2.6 for AMD x86-64
e3-16.asm it's been tested under:
* FreeDOS kernel 1.1.24
* ELKS pre 0.1 (vt52 emulation)
running on original 8086 (!) up to current x86
e3.s is tested under:
* ARM-linux kernel 2.4 (@zaurus PDA)
2a. BUILD on Linux/FreeBSD/NetBSD/BeOS/QNX/Atheos (32 bit)
==========================================================
A. For assembling of e3 you need NASM assembler.
A. For assembling of e3 you need NASM assembler release nasm-0.99.05
B. If you don't like the default OS or destination (LINUX , /usr/local/ )
then edit top of Makefile
......@@ -86,27 +79,25 @@ F. Optional: some more editable options are on top of e3.h:
Also you could activate error beeping in vi mode by uncommenting
the BEEP_IN_VI line.
G. Take care:
If you are building your own e3 binary, be careful: some
NASM versions are producing oversized binaries.
2b. BUILD on Linux (64 bit)
===========================
A. For assembling of e3 you need YASM 0.4 assembler.
A. For assembling of e3 you need YASM or NASM assembler,
e.g. yasm 0.6.99.2005
or NASM version 0.99.05
B. see 2a, except for make, this should be:
make yasm64
or
make nasm64
2c. BUILD on Win9x / ME / DOS
=============================
A. For assembling of e3 you need NASM assembler v0.98,
A. For assembling of e3 you need NASM assembler nasm-0.99.05
and ALINK (Anthony's Linker) and Win32 Import Library (win32.lib)
Both are available for free on the net:
http://www.octium.net/nasm/
http://alink.home.dhs.org/
Both are available for free on the net.
B. Type 'make' , i.e. run make.bat, and move e3.exe, e3-16.com
and e3*.bat wherever you want.
......@@ -121,7 +112,8 @@ C. Optional: some more editable options are on top of e3.h:
2d. BUILD on OpenBSD
====================
Here is a Makefile for BSD-make included. See ./bin directory.
Also you need NASM. In general you don't need to change that file.
Also you need current NASM (nasm-0.99.05)
In general you don't need to change that file.
2e. BUILD for ELKS
......@@ -147,11 +139,19 @@ Or adjust 'Makefile' and build e3arm on the destination ARM box.
3. RELEASE NOTES
================
* some bugfixes
* AMD 64 bit version: yasm 0.4 can used again
* added runtime switching of UTF-8 edit mode,
see UTF8 section below.
* enhanced max filesize
FINAL RELEASE with some adjustments for supporting current
NASM and YASM assemblers both supporting for 32/64 bit.
So now on LINUX(x86) beside
make
make yasm
make yasm64
you have the NEW make destinations
make nasm64
make nasm32 (<- same as pure 'make')
Please don't try old NASMs or YASMs. It won't work.
Except Linux (16/32/64 bit) no more binaries are included.
......@@ -232,7 +232,7 @@ do NOT expect very high precision.
6. MIXED HINTS
==============
* The emacs-mode version has currently a kill buffer but no kill ring,
so be careful about that. I'm sure, inside 10000 byte you won't
so be careful about that. I'm sure, inside some 1000 byte you won't
expect a complete Emacs key set, but IMHO you get the most important part.
* The Pico mode is both: extended and incomplete compared to some Pico options,
......@@ -242,7 +242,7 @@ do NOT expect very high precision.
filename contains blank spaces.
* The size of files you edit is currently limited to the maximum of either
100k or twice the file's size if you start with a file on command line, i.e.,
1024k or twice the file's size if you start with a file on command line, i.e.,
for example, starting e3 with a 2MB_sized_file gives you another 2 MB space
for inserts.
......@@ -359,7 +359,7 @@ e3c/* - C stuff for non x86 systems, e.g. Alpha
elks/* - specials for ELKS
binaries/* - binaries separated for operating systems
armlinux/* - specials for Linux @ ARM RISC CPU
*.sed - special stuff for using YASM assembler
*.sed - for using YASM assembler and/or making 64 bit versions
9. THANKS
......@@ -386,4 +386,5 @@ Andi Kleen (at suse)
10. TM note
===========
Some names are trademarks of their owners:
Linux BSD BeOS QNX Unix WordStar Unox DOS Win Alpha BSE Atheos ELKS ARM BEIN .. etc.
Linux BSD BeOS QNX Unix WordStar Unox DOS Win Alpha BSE Atheos ELKS ARM AMD .. etc.
NEW in 2.4:
Here is an e3 binary running on the Z and other ARM Linux computers.
The binary is built from native assembler code
in e3.s using gnu-as. The assembler code is
machine generated from e3.asm by my translator tool,
look on the freshmeat forum for package "cattt".
e3*.ipk is a ready-for-install package for the Zaurus palmtop.
CONSIDER: this e3 is for ARM CPUs running in
little endian mode only.
\ No newline at end of file
e3.exe contains 2 (two!)
executables in 1 (one!) file,
one for DOS (the 'stub') and one for Win9x.
Also included the 'stub' itself: e3-16.com,
useful for some space limited DOS rescue disks.
../Win9x/e3.exe
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
e3
\ No newline at end of file
@ren e3.exe e3em.exe >NUL
@e3em.exe
@ren e3em.exe e3.exe
@ren e3.exe e3ne.exe >NUL
@e3ne.exe
@ren e3ne.exe e3.exe
@ren e3.exe e3pi.exe >NUL
@e3pi.exe
@ren e3pi.exe e3.exe
@ren e3.exe e3vi.exe >NUL
@e3vi.exe
@ren e3vi.exe e3.exe
@ren e3.exe e3ws.exe >NUL
@e3ws.exe
@ren e3ws.exe e3.exe
;--------------------------------------------------------------------
;
; e3.asm v2.7.0 Copyright (C) 2000-2006 Albrecht Kleine <kleine@ak.sax.de>
; e3.asm v2.7.1 Copyright (C) 2000-2007 Albrecht Kleine <kleine@ak.sax.de>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
......@@ -429,15 +429,15 @@ CompJump2:mov bh,0
lea ebx,[bx] ;1 byte shorter than 'and ebx,0ffh'
%endif
movzx ebx,word [2*ebx+jumptab1] ;2*ebx is due 2 byte per entry
%ifdef YASM
%ifdef AMD64
add rbx,0x400000b0
%else
add ebx,0x08048080 ;most ugly work around ever written
%endif
%else
;;;%ifdef YASM
;;;%ifdef AMD64
;;; add rbx,0x400000b0
;;;%else
;;; add ebx,0x08048080 ;most ugly work around ever written
;;;%endif
;;;%else
add ebx,_start ;offset inside code
%endif
;;;%endif
;-------
call ebx ;the general code jump dispatcher
;-------
......@@ -6075,8 +6075,8 @@ align 2
editmode:db 'p WSp Pip Emp NE'
;
helptext:
db "MicroEditor e3 v2.7.0"
%ifdef YASM
db "MicroEditor e3 v2.7.1"
%ifndef NASM
db "Y"
%endif
%ifdef UTF8
......@@ -6084,7 +6084,7 @@ db "-UTF8 ",0C2h,0A9h
%else
db " (C)"
%endif
db "2000-06 A.Kleine",10
db "2000-07 A.Kleine",10
db "Enter filename or leave with RETURN",10,10
%ifdef YASM
%ifdef UTF8
......
......@@ -14,7 +14,7 @@
%define LESSWRITEOPS
;-------
%define UTF8 ;for UTF8 console or xterm e.g. @ Suse 9.1
%define UTF8RTS ;runtime detection of UTF8 console display
;%define UTF8RTS ;runtime detection of UTF8 console display
;-------
%define BEEP_IN_VI ;undef if you hate beeping computers
%define USE_MATH ;undef if you don't use the numerics
......
%define Name e3
%define Version 2.7.0
%define Prefix /usr/local
Name: e3
Version: 2.7.0
Release: 1
Group: System/Utilities
Summary: e3 is tiny wordstar/emacs/pico/vi/nedit alike editor, well suited for rescue disks.
Copyright: GPL
Packager : Urs Rau <urs.rau@uk.om.org>
#Conflicts:
#Buildroot: /tmp/%{Name}-%{Version}
Provides: editor e3 e3-2.7.0
Source: %{Name}-%{Version}.tar.gz
%Description
e3 is teeny tiny editor that doesn't depend on any libs.
e3 uses subset of wordstar|emacs|pico|vi|nedit commands.
Author: Albrecht Kleine <kleine@ak.sax.de>
%Prep
%setup -q -n %{Name}-%{Version}
%Build
make
%Install
rm -rf $RPM_BUILD_ROOT
make PREFIX="$RPM_BUILD_ROOT/usr/local" install
%Clean
rm -rf $RPM_BUILD_ROOT
%Files
%defattr(-,root,root)
%{Prefix}/bin/e3
%{Prefix}/man/man1/e3.1
s/jmp short/jmp/g
s/jb short/jb/g
s/jne short/jne/g
s/jz short/jz/g
s/jnz short/jnz/g
s/ja short/ja/g
s/jmp /jmp near /g
s/jnz /jnz near /g
s/jz /jz near /g
......
......@@ -231,7 +231,8 @@ long stack[100];
#define RETURN goto *(*esp--)
#define CALL(calladr,retadr) *++esp=(long)&&_loc##retadr; goto calladr; _loc##retadr:
#define PUSH(arg) *++esp=arg
#define POP(arg) (long*)arg=*esp--
//#define POP(arg) (long*)arg=*esp--
#define POP(arg) arg=(long *)(*esp--);
int main(int argc,char**argv,char **envp)
{
......@@ -1303,7 +1304,8 @@ SpaceAva:PUSH(edi);
Ins0: POP(edi); // here is the jmp destination from DeleteByte
//------
changed = CHANGED;
(long)ebp+=eax;
// (long)ebp+=eax;
ebp=(void *)((long)ebp+eax);
if ((unsigned long)edi>=(unsigned long)blockende) goto Ins1;
blockende+=eax;
Ins1: if ((unsigned long)edi>=(unsigned long)blockbegin) goto Ins2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment