summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Wiecek <coven@debian.org>2005-01-08 17:52:59 +0100
committerDmitry Bogatov <KAction@debian.org>2019-01-13 16:51:07 +0000
commit3459c2f632b844fe92c90703bbf681b139e164f1 (patch)
treefb614d30d691372651d252767b7dcd88d005aaa5
parent11c6f281daedc5edf6d2200ec3efe32977a5d66d (diff)
parent3c0f89afd49b6a32b4e11ba902b7bc11126df20a (diff)
Import Debian changes 1:2.61-1
e3 (1:2.61-1) unstable; urgency=low * New upstream version e3 (1:2.50-1) unstable; urgency=low * New upstream version * Added amd64 support (closes: #249972) * Updated standards version (no changes required) e3 (1:2.43-1) unstable; urgency=low * New upstream version e3 (1:2.40-1) unstable; urgency=low * New upstream version e3 (1:2.33-1) unstable; urgency=low * New upstream version e3 (1:2.31-1) unstable; urgency=low * New upstream version * Fixed mistaken version numbering (closes: #144003) e3 (e3-2.30-1) unstable; urgency=low * New upstream version
-rw-r--r--COPYRIGHT2
-rw-r--r--ChangeLog219
-rw-r--r--Makefile51
-rw-r--r--README151
-rw-r--r--README.UTF854
-rw-r--r--armlinux/Makefile12
-rw-r--r--armlinux/e3.s7923
-rw-r--r--armlinux/emulayer.s314
-rw-r--r--armlinux/macros39
-rw-r--r--bin/ARM_Linux/README11
-rwxr-xr-xbin/ARM_Linux/e3bin0 -> 35716 bytes
-rw-r--r--bin/ARM_Linux/e3_2.6.1_arm.ipkbin0 -> 12629 bytes
l---------bin/ARM_Linux/e3em (renamed from bin/Linux/e3_uncompressed)0
l---------bin/ARM_Linux/e3ne1
l---------bin/ARM_Linux/e3pi1
l---------bin/ARM_Linux/e3vi1
l---------bin/ARM_Linux/e3ws1
-rw-r--r--bin/DOS/README3
-rwxr-xr-xbin/DOS/e3-16.combin3750 -> 0 bytes
l---------bin/DOS/e3.exe1
-rwxr-xr-xbin/ELKS/e3-16bin4184 -> 4448 bytes
-rwxr-xr-xbin/FreeBSD/e3bin12748 -> 12984 bytes
-rw-r--r--bin/Linux/README3
-rwxr-xr-xbin/Linux/e3bin12652 -> 13105 bytes
-rwxr-xr-xbin/Linux/e3_noUTF8bin0 -> 12938 bytes
-rwxr-xr-xbin/Linux/e3_selfcompressedbin9081 -> 0 bytes
l---------bin/Linux/e3_withUTF81
-rwxr-xr-xbin/Linux/e3_yasmbin0 -> 16616 bytes
-rwxr-xr-xbin/Linux_x86-64/e3_64bin0 -> 16664 bytes
-rw-r--r--bin/NetBSD/Makefile1
-rw-r--r--bin/NetBSD/README2
-rwxr-xr-xbin/NetBSD/e311
-rw-r--r--bin/OpenBSD/Makefile3
-rw-r--r--bin/OpenBSD/README6
-rwxr-xr-xbin/Win9x/e3.exebin19444 -> 19464 bytes
-rw-r--r--contrib/e3.spec6
-rw-r--r--debian/changelog41
-rw-r--r--debian/control4
-rw-r--r--doswin9x/make.bat2
-rw-r--r--e3-16.asm420
-rw-r--r--e3.asm1022
-rw-r--r--e3.h110
-rw-r--r--e3.html53
-rw-r--r--e3.man18
-rw-r--r--e3_nasm_yasm.sed16
-rw-r--r--e3_yasm_yasm64.sed19
l---------[-rw-r--r--]e3c/Makefile36
-rw-r--r--e3c/Makefile.arm39
-rw-r--r--e3c/Makefile.x8639
-rw-r--r--e3c/e3.c8
50 files changed, 10238 insertions, 406 deletions
diff --git a/COPYRIGHT b/COPYRIGHT
index a4cdfb0..eed4426 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -3,7 +3,7 @@ for any purpose without royalty or fees in accordance with the terms of the
copyright.
-----------------------------------------------------------------------------
- Copyright (c) 2000,01,02 Albrecht Kleine
+ Copyright (c) 2000-2004 Albrecht Kleine
All rights reserved.
You may distribute under the terms of the GNU General Public License.
diff --git a/ChangeLog b/ChangeLog
index 181e66e..ec31ea5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,222 @@
+Mon Jan 3 18:00:48 2005 Albrecht Kleine <kleine@ak.sax.de>
+ -e3.asm, e3.h: continued 64 bit version, i. e.
+ fixed bugs in commandline reading and numerics
+ -e3.asm:added push ecx / pop ecx pair to save register ECX
+ during the Wait4 system call:
+ Linux kernel 2.6.8 seems to need that (unlike 2.6.5)
+ This crashed sed filtering, e.g. by ^KP in WS mode.
+ #199
+ ***** released as v2.6.1 *****
+-------------------------------------------------------------
+Mon Dec 27 11:43:41 2004 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3.asm, e3.h, Makefile: prepared e3.asm for generating
+ 64 bit files by using the YASM 0.4 assembler for the
+ AMD-64 CPU (Linux only.)
+ -The AMD-64 code is built from e3.asm by running
+ sed converter script "e3_yasm_yasm64.sed"
+ This script is now part of e3 distribution archive.
+ *** Use it by entering "make yasm64" ***
+ #198
+-------------------------------------------------------------
+Sun Oct 03 17:00:00 2004 Albrecht Kleine <kleine@ak.sax.de>
+
+ - e3.asm, Makefile: prepared e3.asm for YASM assembler.
+ Due ugly problems in jecxz op by "near jmp" vs "short jmp"
+ we need a sed converter script: so added file
+ "e3_nasm_yasm.sed" to distribution
+ *** Use it by entering "make yasm" ***
+ #197
+-------------------------------------------------------------
+Sun Jun 27 21:34:00 2004 Albrecht Kleine <kleine@ak.sax.de>
+
+ e3.asm: clean up for next release
+ #196
+ ***** released as v2.6.0 *****
+-------------------------------------------------------------
+Sun Jun 18 19:45:00 2004 Albrecht Kleine <kleine@ak.sax.de>
+
+ e3.asm: trial for runtime detection of UTF-8 console
+ (switch via %ifdef UTF8RTS) ** not yet continued **
+ #195
+-------------------------------------------------------------
+Fri Jun 18 21:14:55 2004 Albrecht Kleine <kleine@ak.sax.de>
+
+ e3.asm: optimizing previous builds
+ #194
+-------------------------------------------------------------
+Thu Jun 3 20:50:17 2004 Albrecht Kleine <kleine@ak.sax.de>
+
+ e3.asm,e3.h: special cursor control, switch it via
+ %define NEW_CURSOR_MGNT in e3.h
+ see also:
+ /usr/src/linux/Documentation/VGA-softcursor.txt
+ #192,#193
+-------------------------------------------------------------
+Thu Jun 3 20:50:17 2004 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3.asm: added initial UNICODE UTF-8
+ stuff via checking the bits 7 and 8
+ #190,#191
+-------------------------------------------------------------
+Mon Apr 12 09:44:27 2004 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3.asm: for easier line input just added some
+ readline edit functions in InputString:
+ home / end / insert / delete / go_left / go_right
+ -Makefile: removed default usage of "gzexe":
+ seems to be broken
+ #189
+ ***** released as v2.5 *****
+-------------------------------------------------------------
+Sun Apr 4 21:29:07 2004 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3.h,e3.asm: make e3/OpenBSD work again by adding
+ some ELF file specials needed for OpenBSD version 4.3.
+ Many thanks to Benjamin Pineau!
+ #188
+-------------------------------------------------------------
+Fri Nov 14 00:00:00 2003 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3.asm: a patch for Scott Swanson's vt420
+ use via %ifdef VT420SPECIAL
+ #187
+-------------------------------------------------------------
+Fri Aug 09 00:00:00 2003 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3.asm: check file name linkage also in dynamic linked
+ file versions
+ #186
+-------------------------------------------------------------
+Mon Apr 21 18:22:36 2003 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3.asm: bugfix (a certain combination of
+ sed-piping followed by UNDO operation could cause a
+ crash with core dump)
+ Many thanks for bug report to:
+ basti at a181213.studnetz.uni-leipzig.de
+ #185
+ ***** released as v2.43 *****
+-------------------------------------------------------------
+Mon Mar 24 17:17:17 2003 Albrecht Kleine <kleine@ak.sax.de>
+
+ - e3-16.asm: fixed bug in IsShowBlock
+ replaced "cmp dword ...." with "cmp word ....."
+ This makes e3-16 running on elks at old 8086 PC.
+ - e3-16.asm: LESSWRITEOPS are now switched on by default.
+ - e3.asm: added fchmod call to prevent file
+ permissions modified by umask
+ (was bug report on freshmeat site)
+ #184
+ ***** released as v2.42 *****
+-------------------------------------------------------------
+Sat Mar 1 10:00:00 2003 Albrecht Kleine <kleine@ak.sax.de>
+
+ - e3.asm: fixed heavy bug in FreeBSD version of e3,
+ (core dump with newer FreeBSD kernels due ugly
+ workaround in e3 / now replaced by a real solution
+ for sed child program piping, see also:
+ http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/47505 )
+ Thanks to joseph at randomnetworks dot com for
+ his patience and assistance.
+ #183
+ ***** released as v2.41 *****
+-------------------------------------------------------------
+Tue Oct 8 20:55:00 2002 Albrecht Kleine <kleine@ak.sax.de>
+
+ - e3.asm: fixed bug in Pico mode
+ (repeated search&replace could hang e3:
+ Thanks for bug report to Roy Sutton!)
+ - added NO_AUTO_INDENT assemble time option
+ #182
+ ***** released as v2.4 *****
+-------------------------------------------------------------
+Sat Oct 5 18:13:13 2002 Albrecht Kleine <kleine@ak.sax.de>
+
+ - NEW: added e3.s to the e3 distribution
+ (NATIVE StrongARM assembler code for gnu assembler)
+ Also included helper macros and emulayer.s.
+ Also adjusted Makefile.
+
+ - e3-16.asm: added a %define for bypassing BIOS int 10h,
+ function 1302h. Very slow, but running on some
+ very old 1980's PC.
+ #181
+-------------------------------------------------------------
+Sat Sep 14 15:44:02 2002 Albrecht Kleine <kleine@ak.sax.de>
+
+ e3.asm/e3.h: initial assembler version for
+ the ARM CPU produced (for gnu-as,gnu-ld)
+ and running on the Zaurus PDA
+ (control by %define ARMCPU)
+
+Wed Jul 31 00.00.00 2002 Albrecht Kleine <kleine@ak.sax.de>
+ e3-16.asm: changed some opcodes to pure 16 bit
+ e.g. replaced pusha with a sequence of
+ push ax,push bx,.... etc for running on 8088 CPU.
+ #180
+-------------------------------------------------------------
+Sun May 19 17:30:59 2002 Albrecht Kleine <kleine@ak.sax.de>
+
+ e3.asm: bug fixed: search in Pico mode could
+ cause inf-loop if string was not found
+ MANY thanks to Robin Green!
+ #179
+ ***** released as v2.33 *****
+-------------------------------------------------------------
+Thu May 2 09:01:11 2002 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3c.c, e3c/Makefile : patch for running on PDAs
+ running Linux on the StrongARM CPU
+ #178a
+ ***** ARM binary released as v2.32 *****
+-------------------------------------------------------------
+Sat Apr 20 21:44:31 2002 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3.asm: some adjustments to assemble again in Win9x
+ -e3-16.asm: added ^QI key (go line#)
+ to the ELKS and DOS versions
+ -Makefile, e3.asm, e3.h changed variable errno to ErrNo
+ for better linking to libc, if desired.
+ Now this is also in FreeBSD possible,
+ see build #169 for make details.
+ #178
+ ***** released as v2.31 *****
+-------------------------------------------------------------
+Tue Apr 16 20:31:28 2002 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3.asm refined cursor position after vi's p and P cmds
+ -e3.asm vi mode: now also cmd x and X pasteable
+ -e3.asm bugfix in WS ^QY (introduced in #175
+ due vi command D changing)
+ -e3-16.asm: removed most of useless screen redrawing
+ for the ELKS version
+ #177
+-------------------------------------------------------------
+Sat Apr 13 20:57:41 2002 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3-16.asm bugfix (^KR did not work in ELKS)
+ added special handling code of lseek
+ offset (32 bit arg #2) via I/O-pointer
+ -e3-16.asm bugfix (^KV did not work in ELKS and DOS)
+ (Tnx for report to Tim Pearce)
+ -e3.asm [libc versions] fixed bug in error handling:
+ now using extern [_errno]
+ -e3.asm added UNDO information collector for Emacs ^T
+ #176
+-------------------------------------------------------------
+Wed Apr 10 18:11:42 2002 Albrecht Kleine <kleine@ak.sax.de>
+
+ -e3.asm added command dw (delete word) in vi mode
+ (by Matthias's suggestion)
+ -e3.asm after pasting now changing cursor position
+ by using [EmaKiSize] (old was call CountToLineEnd)
+ -e3.asm vi command mode
+ added cursor left motion after D command
+ -e3.asm bugfix: vi command r was not undoable
+ (Tnx for report to Tim Pearce)
+ #175
+-------------------------------------------------------------
Sun Apr 7 19:30:36 2002 Albrecht Kleine <kleine@ak.sax.de>
e3-16: added color support for e3-16/ELKS (*) ,
diff --git a/Makefile b/Makefile
index d5efd98..9f558f7 100644
--- a/Makefile
+++ b/Makefile
@@ -3,12 +3,13 @@
OS=LINUX
#OS=BEOS
#OS=FREEBSD
+#OS=OPENBSD
#OS=QNX
#OS=ATHEOS
#OS=W32 ** please use a separate make.bat for W9x **
# Set this to gzexe or upx if you want compression
-#COMPRESS=gzexe
+# COMPRESS=gzexe
COMPRESS=upx
# 2. edit dest dir prefix if you want....
@@ -76,20 +77,24 @@ endif
# next three are for testing purpose: linking w libc
statc:
- $(NASM) $(AFLAGS) -o e3.o e3.asm -l e3.lst -DLINUX -DLIBC -D$(EXMODE)
+ $(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 -DLINUX -DLIBC -DDYN -D$(EXMODE)
+ $(NASM) $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS) -DLIBC -DDYN -D$(EXMODE)
gcc e3.o -o e3dync
# strip e3dync
dync2:
- $(NASM) $(AFLAGS) -o e3.o e3.asm -l e3.lst -DLINUX -DLIBC -DDYN -D$(EXMODE)
+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
@@ -102,6 +107,34 @@ debug: $(ASOURCES) Makefile
ln -sf e3 e3vi
ln -sf e3 e3ne
+# L I N U X only
+# Experimental stuff for using YASM assembler
+# 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
+ 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 / AMD-64 only
+# 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
+ ln -sf e3 e3ws
+ ln -sf e3 e3em
+ ln -sf e3 e3pi
+ ln -sf e3 e3vi
+ ln -sf e3 e3ne
+
+
# selftest, linux only, assembled with a special option for using an input pipe
test:
ifeq ($(OS),LINUX)
@@ -166,6 +199,12 @@ else
cd $(MANDIR) && ln -s e3.1 e3ne.1
endif
+
+armlinux: e3
+ @cd armlinux && make all
+
+
clean:
rm -f e3*.o e3*.lst e3 e3em e3pi e3vi e3ws e3ne *~ \
- PIPE_IN e3test~ e3test e3dync e3dync2 e3statc
+ PIPE_IN e3test~ e3test e3dync e3dync2 e3statc \
+ armlinux/*.o armlinux/e3arm
diff --git a/README b/README
index 698cf2b..00ff299 100644
--- a/README
+++ b/README
@@ -1,13 +1,15 @@
-README for mini editor e3 release 2.3
+README for mini editor e3 release 2.6.1 (aka 2.61)
+
+(c) GPL 2000-05 Albrecht Kleine
+kleine@ak.sax.de
+alb.kleine@gmx.de (please use "e3" in mail subject line)
-(c) GPL 2000-02 Albrecht Kleine
-mailto:kleine@ak.sax.de
1. OVERVIEW
===========
-e3 is a collection of micro text editors with an executable code
-size between 3500 and 20000 bytes, depending on used assembler options,
+e3 is a micro text editor with an executable code size between
+3800 and 35000 bytes, depending on used assembler options,
platform and self compressor.
Except for 'syntax highlighting', the e3 binary supports all of the basic
functions one expects plus built in arithmetic calculations. If you have
@@ -16,53 +18,58 @@ getting the full power of regular expressions.
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 Linux, FreeBSD, NetBSD,
-OpenBSD, BeOS, QNX, Win9x, Atheos, and just new in a 16 bit version (e3-16)
-for DOS and ELKS (==Embeddable Linux Kernel Subset).
-
+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 StrongARM ("Advanced Risc Machine") CPUs.
There is also a GNU-C-written version for non-i386-Unix
-platforms (e3.c) using Wordstar keybindings only. This README
-doesn't further mention e3.c. (Just make it!)
+and non-ARM-Linux platforms (e3.c) using Wordstar keybindings only.
+This README doesn't further mention e3.c. (Just make it!)
e3 is designed to be INDEPENDENT OF LIBC OR ANY OTHER library,
-except on the QNX and Win32 operating systems.
+except on QNX and Win32.
+
It's been tested using the terminal console, but Xterm, Eterm,
-kvt, rxvt, vt220 and vt100 should work too.
-It's been tested under several x86 OS:
- * Linux kernels 2.0, 2.2, 2.4
- * FreeBSD 2.2, 3.1, 4.4
- * OpenBSD 2.9
+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.0, 2.2, 2.4, 2.6
+ * FreeBSD 2.2, 3.1, 4.4, 5.0
+ * OpenBSD 3.4,
* NetBSD 1.51
* 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/BeOS/QNX/Atheos
==========================================
-A. For assembling of e3 you need NASM assembler v0.98 or v0.98.08
+A. For assembling of e3 you need NASM assembler.
-B. Unless you build a debug version ("make debug") Makefile will call
- a compressor for executables, but in Linux only and only if you
- have defined either gzexe or upx in Makefile.
- UPX comes from http://wildsau.idv.uni-linz.ac.at/mfx/upx.html .
+B. If you don't like the default OS or destination (LINUX , /usr/local/ )
+ then edit top of Makefile
+ (other possible OS are FreeBSD or BEOS or QNX or ATHEOS).
-C. If you don't like the default OS or destination (LINUX , /usr/local/ )
- then edit Makefile (other possible OS are FreeBSD or BEOS or QNX
- or ATHEOS).
-
-D. e3 is expecting "sed" at /bin/sed, or "ex" at /usr/bin/ex; otherwise change
+C. e3 is expecting "sed" at /bin/sed, or "ex" at /usr/bin/ex; otherwise change
SEDPATH in e3.asm. By default /bin/sed is used, but you can
use /usr/bin/ex instead, if you edit Makefile as appropriate.
- (NOT available for BeOS,QNX,Atheos))
+ (NOT available for BeOS,QNX,Atheos)
-E. Build e3 via typing 'make' (or 'gmake' on FreeBSD) for building:
+D. Build e3 via typing 'make' (or 'gmake' on FreeBSD) for building:
e3 : the default Wordstar-like version,
e3ws : ditto Wordstar,
e3em : the Emacs-like version,
@@ -71,15 +78,21 @@ E. Build e3 via typing 'make' (or 'gmake' on FreeBSD) for building:
e3ne : the Nedit-like version.
(e3?? are symbolic links to e3. In fact only one executable is built.)
-F. Optional: type 'make install' or
+E. Optional: type 'make install' or
move or copy e3 and its symlinks wherever you want.
-G. Optional: some more editable options are on top of e3.h:
+F. Optional: some more editable options are on top of e3.h:
for example, if you don't like WS mode, choice an other default mode
by setting DEFAULT_MODE to one of EM, NE, PI or VI .
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, some won't
+ produce a e3.lst listing file: two bugs, but at all harmless.
+
+
2b. BUILD on Win9x / ME / DOS
=============================
@@ -101,29 +114,54 @@ C. Optional: some more editable options are on top of e3.h:
2c. BUILD on NetBSD,OpenBSD
===========================
-Here are 2 Makefile for BSD-make included.
-In general you don't need to change that files.
+Here are 2 Makefile for BSD-make included. See ./bin directory.
+Also you need NASM. In general you don't need to change that files.
2d. BUILD for ELKS
==================
-This is done on usual 32 bit x86 Linux systems either
+This is done usual on 32 bit x86 Linux systems either
by typing "make elks" or changing to elks/ and typing "make".
-You need to have installed the ld86 linker. (If you are interested
-in ELKS systems I think you have it already on the harddisk.)
+You need to have installed the ld86 linker (part of dev86 suite).
+
+
+2e. BUILD for ARM Linux
+=======================
+Simply type "make armlinux" on your x86 box.
+You will need the ARM linux toolchain, at least
+ arm-linux-as: GNU assembler 2.11.2
+ arm-linux-ld: GNU ld 2.11.2
+Fetch it via:
+ ftp://ftp.armlinux.org/pub/toolchain
+Or adjust 'Makefile' and build e3arm on the destination ARM box.
+
3. RELEASE NOTES
================
-* Added a 16 bit version of e3 (aka e3-16) supporting DOS and
- ELKS (==Embeddable Linux Kernel Subset) in one source code.
- This initial release supports WS keys only.
- With e3-16 now we have e3 editors on the 9th and 10th operating system.
-* Changed the Win32 version by replacing the DOS stub with e3-16 to
- do something useful instead of complaining about "it can run
- only under Win32".
- So you have TWO different editor executables in ONE file!
+
+Only changed Linux/ASM-version:
+
+* First step: introduced building with YASM assembler,
+ see http://www.tortall.net/projects/yasm
+ So added new make destination: "make yasm"
+
+* Second step: introduced building a 64-bit version
+ of e3 for Linux/AMD-64.
+ The program file says:
+ "e3_64: ELF 64-bit LSB executable, AMD x86-64,
+ version 1 (SYSV), statically linked, stripped"
+
+* Both steps are using the sed stream editor.
+ Thus now we are using 2 converter scripts:
+ nasm to yasm: e3_nasm_yasm.sed
+ yasm to 64bit: e3_yasm_yasm64.sed
+
+* Also fixed a bug first occurs running e3 under 2.6.8 kernels
+ during the Wait4 system call.
+ (This crashed sed filtering, e.g. by ^KP in WS mode.)
+
@@ -145,8 +183,8 @@ in ELKS systems I think you have it already on the harddisk.)
* On some computers (BeOS, QNX etc.) Alt-key combinations won't work:
press <ESC> followed by the key, e.g. press ESC and H instead of Alt-H.
-* e3 shows a dot for characters below ASCII 20h and between 80h and 9Fh
- (except win9x).
+* e3 shows a dot for characters below ASCII 20h and greater 7Fh
+ (except on win9x and except on UTF-8 version).
* At the end of an edit cycle, e3 asks you something like "SAVE? Ynl". Press
"n" to NOT save, "l" for SAVE and LOAD new, any other for SAVE and EXIT.
@@ -207,6 +245,9 @@ do NOT expect very high precision.
* The Pico mode is both: extended and incomplete compared to some Pico options,
new are some ^J (delete) and ^Q (quick_move) keys.
+* The win9x version does no accept any filename on the command line if this
+ 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.,
for example, starting e3 with a 2MB_sized_file gives you another 2 MB space
@@ -264,6 +305,7 @@ do NOT expect very high precision.
^U for NEDIT mode
+
7. FILES
========
Makefile - (edit destination path and OS if desired)
@@ -272,19 +314,18 @@ e3-16.asm
e3.h - NASM source code
e3.man - man page (copied by default to /usr/local/man/man1)
e3.html - man page, HTML version
-e3.spec - spec file for building RPM archives
README - you are reading this
ChangeLog - version history
COPYING.GPL
COPYRIGHT - please read before using e3!
test/* - partial test suite
e3c/* - C stuff for non x86 systems, e.g. Alpha
-contrib/* - useful things
-doswin9x/* - specials for Win9x and its derivates
+contrib/* - useful things, e.g. e3.spec (== spec for building RPMs)
+doswin9x/* - specials for DOS, Win9x and its derivates
elks/* - specials for ELKS
-binaries/* - binaries separated for some operating systems
- NOTE: binaries for QNX,AtheOS,BeOS are no more included.
- Sorry, but there never was any feedback.
+binaries/* - binaries separated for operating systems
+armlinux/* - specials for Linux @ ARM RISC CPU
+*.sed - special stuff for using YASM assembler
8. THANKS
@@ -304,9 +345,11 @@ Sergei Viznyuk <sviznyuk at hotmail.com>
Philippe Corbes <philippe.corbes at laposte.net>
Charles Steinkuehler <charles at steinkuehler.net>
Adrian Bunk <bunk at fs.tum.de>
+Joseph <joseph at randomnetworks.com>
+
9. TM note
==========
Some names are trademarks of their owners:
-Linux BSD BeOS QNX Unix WordStar Unox DOS Win Alpha BSE Atheos ELKS..etc.
+Linux BSD BeOS QNX Unix WordStar Unox DOS Win Alpha BSE Atheos ELKS ARM BEIN .. etc.
diff --git a/README.UTF8 b/README.UTF8
new file mode 100644
index 0000000..a723925
--- /dev/null
+++ b/README.UTF8
@@ -0,0 +1,54 @@
+Some notes on UTF-8 for the Linux/ASM-version:
+
+
+1.
+By default now e3 does does support UTF-8 coding of unicode
+characters like this: α (should be a greek alpha).
+
+
+2.
+You could disable UTF-8 support in e3 by editing e3.h at line 16:
+from
+%define UTF8 ;for UTF8 console or xterm e.g. @ Suse 9.1
+
+to
+;;; %define UTF8 ;for UTF8 console or xterm e.g. @ Suse 9.1
+
+and run 'make' again.
+
+
+3.
+Running e3_with_disabled_UTF-support at a UTF-8 console
+you will see two points .. for UTF-8 characters e.g. the greek alpha.
+
+
+4.
+If you terminal does _not_ support UTF-8 it is strongly
+recommended to _disable_ UTF8-support in e3.h,
+because output of some characters could be scrambled.
+
+
+5.
+e3 will _not_ convert your files from/to UTF-8 coding.
+It does simply _use_ your terminal encodings.
+
+UTF-8 characters like © (c) will look very false on non-UTF-8 terminals,
+but e3 can't help here. (So at first use a file converter.)
+
+
+6.
+If you simply call e3 without file argument the initial screen of e3
+will tell you whether UTF8-support is built in:
+
+MicroEditor e3 v2.6.0-UTF8 GPL © 2000-04
+vs.
+MicroEditor e3 v2.6.0 GPL (C) 2000-04
+
+
+
+BTW a runtime detection of UTF-8 console is planned, but not yet ready to use.
+
+
+Enjoy!
+Albrecht,
+Jun/29/2004
diff --git a/armlinux/Makefile b/armlinux/Makefile
new file mode 100644
index 0000000..c28ea1b
--- /dev/null
+++ b/armlinux/Makefile
@@ -0,0 +1,12 @@
+AS=arm-linux-as
+LD=arm-linux-ld
+STRIP=arm-linux-strip
+
+all: ../e3.asm e3.s
+# $(AS) --defsym LINUX=1 --defsym ARMCPU=1 -a=e3arm.lst -gstabs e3.s -o e3.o
+# $(AS) --defsym LINUX=1 --defsym ARMCPU=1 -a=emulayer.lst -gstabs emulayer.s -o emulayer.o
+ $(AS) --defsym LINUX=1 --defsym ARMCPU=1 e3.s -o e3.o
+ $(AS) --defsym LINUX=1 --defsym ARMCPU=1 emulayer.s -o emulayer.o
+ $(LD) e3.o emulayer.o -o e3arm
+ $(STRIP) e3arm
+
diff --git a/armlinux/e3.s b/armlinux/e3.s
new file mode 100644
index 0000000..8c43d51
--- /dev/null
+++ b/armlinux/e3.s
@@ -0,0 +1,7923 @@
+.include "macros"
+ @@ ************ BEGIN including e3.h ************
+.equ WS,1
+.equ EM,2
+.equ PI,4
+.equ VI,8
+.equ NE,16
+.equ DEFAULT_MODE,1
+.equ MAKE_BACKUP,1 @(no value known)
+.equ LESSWRITEOPS,1 @(no value known)
+.equ UTF8,1 @(no value known)
+.equ BEEP_IN_VI,1 @(no value known)
+.equ USE_BUILTINHELP,1 @(no value known)
+.ifdef OPENBSD
+.endif
+.ifdef BEOS
+.else
+.ifdef QNX
+.else
+.ifdef ATHEOS
+.else
+.ifdef LINUX
+.equ TERMIOS_SET,21506
+.equ TERMIOS_GET,21505
+.equ TERMIOS_WSIZE,21523
+.equ NCCS,19
+.equ VMIN,6
+.equ UIDGID_WORD,1 @(no value known)
+.struct 0
+stat_struc.st_dev:
+.struct 4
+stat_struc.st_ino:
+.struct 8
+stat_struc.st_mode:
+.struct 10
+stat_struc.st_nlink:
+.struct 12
+stat_struc.st_uid:
+.struct 14
+stat_struc.st_gid:
+.struct 16
+stat_struc.st_rdev:
+.struct 20
+stat_struc.st_size:
+.struct 24
+stat_struc.st_blksize:
+.struct 28
+stat_struc.st_blocks:
+.struct 32
+stat_struc.st_atime:
+.struct 36
+stat_struc.__unused1:
+.struct 40
+stat_struc.st_mtime:
+.struct 44
+stat_struc.__unused2:
+.struct 48
+stat_struc.st_ctime:
+.struct 52
+stat_struc.__unused3:
+.struct 56
+stat_struc.__unused4:
+.struct 60
+stat_struc.__unused5:
+.struct 64
+.equ stat_struc_size,64
+.equ SYS_exit,1
+.equ SYS_fork,2
+.equ SYS_read,3
+.equ SYS_write,4
+.equ SYS_open,5
+.equ SYS_close,6
+.equ SYS_unlink,10
+.equ SYS_execve,11
+.equ SYS_lseek,19
+.equ SYS_utime,30
+.equ SYS_kill,37
+.equ SYS_rename,38
+.equ SYS_pipe,42
+.equ SYS_brk,45
+.equ SYS_ioctl,54
+.equ SYS_dup2,63
+.equ SYS_sigaction,67
+.equ SYS_readlink,85
+.equ SYS_fchmod,94
+.equ SYS_fchown,95
+.equ SYS_fstat,108
+.equ SYS_wait4,114
+.equ SYS_select,142
+.ifndef ARMCPU
+.else
+.struct 0
+utimbuf_struc.actime:
+.struct 4
+utimbuf_struc.modtime:
+.struct 8
+.equ utimbuf_struc_size,8
+.endif
+.ifdef CRIPLED_ELF
+.endif
+.ifdef UTF8
+.equ NEW_CURSOR_MGNT,1 @(no value known)
+.purgem CURSORMGNT
+.else
+.endif
+.equ SIGCONT,18
+.equ SIGSTOP,19
+.equ CAPTURE_STDERR,1 @(no value known)
+.ifdef EX
+.else
+.purgem USE_EX_NO_SED
+.ifndef PERLPIPE
+.equ SEDPATH,0
+.else
+.endif
+.endif
+.equ MAXERRNO,32
+.equ ERRNOMEM,12
+.equ ERRNOIO,5
+.equ ERRNOEXEC,31
+.macro errortext
+.ascii "Op not permitted"
+.byte 10
+.ascii "No such file|directory"
+.byte 10
+.byte 10
+.byte 10
+.ascii "Input/output"
+.byte 10
+.ascii "No such device"
+.byte 10
+.byte 10
+.byte 10
+.ascii "Bad file descriptor"
+.byte 10
+.ascii "No child processes"
+.byte 10
+.byte 10
+.ascii "Memory exhausted"
+.byte 10
+.ascii "Permission denied"
+.byte 10
+.byte 10
+.byte 10
+.ascii "Device|resource busy"
+.byte 10
+.ascii "File exists"
+.byte 10
+.byte 10
+.ascii "No such device"
+.byte 10
+.byte 10
+.ascii "Is a directory"
+.byte 10
+.ascii "Invalid argument"
+.byte 10
+.ascii "Too many open files"
+.byte 10
+.ascii "Too many open files"
+.byte 10
+.ascii "Inappropriate ioctl"
+.byte 10
+.ascii "Text file busy"
+.byte 10
+.ascii "File too large"
+.byte 10
+.ascii "No space on device"
+.byte 10
+.ascii "Illegal seek"
+.byte 10
+.ascii "R/O file system"
+.byte 10
+.ascii "Can't exec "
+.ifdef USE_EX_NO_SED
+.else
+.byte '/','b','i','n','/','s','e','d',10
+.endif
+.ascii "Broken pipe"
+.byte 10
+.endm
+.ifdef LIBC
+.endif
+.ifdef ARMCPU
+.purgem USE_MATH
+.purgem USE_UNDO
+.purgem USE_PIPE
+.endif
+.else
+.ifdef FREEBSD
+.ifndef OPENBSD
+.endif
+.ifndef OPENBSD
+.endif
+.ifdef EX
+.else
+.ifndef PERLPIPE
+.else
+.endif
+.endif
+.ifdef USE_EX_NO_SED
+.else
+.endif
+.ifdef LIBC
+.endif
+.else
+.ifdef W32
+.else
+.endif
+.endif
+.endif
+.endif
+.endif
+.endif
+.ifdef TERMIOS_SET
+.ifdef ARMCPU
+.struct 0
+termios_struc.c_iflag:
+.struct 4
+termios_struc.c_oflag:
+.struct 8
+termios_struc.c_cflag:
+.struct 12
+termios_struc.c_lflag:
+.struct 16
+termios_struc.c_line:
+.struct 17
+termios_struc.c_cc:
+.struct 36
+.equ termios_struc_size,36
+.else
+.ifdef speed_t1
+.endif
+.ifdef speed_t2
+.endif
+.ifdef speed_t3
+.endif
+.endif
+.struct 0
+winsize_struc.ws_row:
+.struct 2
+winsize_struc.ws_col:
+.struct 4
+winsize_struc.ws_xpixel:
+.struct 6
+winsize_struc.ws_ypixel:
+.struct 8
+.equ winsize_struc_size,8
+.ifndef IXON
+.endif
+.endif
+.ifndef LINUX
+.endif
+.equ stdtxtlen,10
+.ifdef FREEBSD
+.else
+.ifdef QNX
+.else
+.equ O_WRONLY_CREAT_TRUNC,577
+.endif
+.endif
+.equ O_RDONLY,0
+.equ PERMS,420
+.equ stdin,0
+.equ stdout,1
+.equ optslen,124
+.equ TAB,8
+.equ TABCHAR,9
+.equ SPACECHAR,32
+.equ CHANGED,42
+.equ UNCHANGED,SPACECHAR
+.equ LINEFEED,10
+.equ NEWLINE,LINEFEED
+.equ RETURN,13
+.equ SEDBLOCK,4096
+.ifdef CRIPLED_ELF
+.endif
+.ifndef ARMCPU
+.ifdef USE_SPECIAL_HEADER
+.ifdef TINLINK
+.else
+.endif
+.else
+.endif
+.endif
+.ifdef DYN
+.endif
+.ifdef AMD64
+.else
+.macro PUSH_ALL
+ stmfd r13!,{r0-r6}
+.endm
+.macro POP_ALL
+ ldmfd r13!,{r0-r6}
+.endm
+.endif
+ @@ ************ END include ************
+.text
+.code 32
+ORGheader:
+
+.global _start
+_start: CALL SetTermStruc
+.ifdef SELFTEST
+.else
+.ifdef W32
+.else
+.ifdef BEOS
+.else
+.ifdef DYN
+.else
+.ifdef SYS_sigaction
+ CALL SetSigHandler
+.endif
+.ifdef ATHEOS
+.endif
+ ldmfd r13!,{r3}
+ ldmfd r13!,{r5}
+ mov r7,#+1
+prog: ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,r0
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ orrs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ bne prog
+.ifdef AMD64
+.else
+ mov r9,r5
+ mov r10,#0x5
+ sub r9,r9,r10
+ mov r5,R9
+.endif
+ CALL SetEditMode
+ beq prog1
+ ldr r11,= DEFAULT_MODE
+ strB r11,[r0]
+prog1:
+ ldmfd r13!,{r5}
+.ifdef NEW_CURSOR_MGNT
+ CALL SetCursorBlock
+.endif
+.endif
+.endif
+.endif
+.endif
+.ifdef CURSORMGNT
+.ifndef ARMCPU
+.else
+.endif
+.endif
+.ifdef UTF8RTS
+.endif
+ReStart:
+ CALL NewFile
+ blo E3exit
+MainCharLoop:
+ CALL ChkCursPos
+ CALL IsViMode
+ bne MCL
+ A_DR r12,blockbegin
+ ldr r2,[r12]
+ cmp r2,#0
+ beq MCL
+ stmfd r13!,{r4}
+ mov r4,r2
+ CALL KeyEnd
+ A_DR r12,blockende
+ str r4,[r12]
+ ldmfd r13!,{r4}
+ CALL ShowBl1
+MCL: CALL DispNewScreen
+ CALL RestoreStatusLine
+ CALL HandleChar
+.ifdef W32LF
+.endif
+ A_DR r1,endeedit
+ mov r11,#0x0
+ ldrB r10,[r1]
+ cmp r10,r11
+ beq MainCharLoop
+ eors r5,r5,r5
+ mov r11,#0x2
+ ldrB r10,[r1]
+ cmp r10,r11
+ beq ReStart
+E3exit: CALL KursorStatusLine
+.ifdef W32
+.endif
+ A_DR r2,text
+ CALL WriteFile00
+.ifdef NEW_CURSOR_MGNT
+ CALL SetCursorNormal
+.endif
+ A_DR r1,tempfile2
+ CALL Unlink
+.ifdef W32
+.else
+ ldr r2,= TERMIOS_SET
+
+ CALL IOctlTerminal0
+ b Exit
+.endif
+HandleChar:
+ CALL ReadChar
+ mov r12,#0xff
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne ExtAscii
+ A_DR r5,mode
+ mov r11,#0x6
+ ldrB r10,[r5]
+ tst r10,r11
+ beq NO_EM01
+ mov r12,#0xb
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq IsCtrlK
+ A_DR r12,EmaCtrlK
+ mov r11,#0x0
+ strB r11,[r12]
+IsCtrlK:
+ mov r12,#0x13
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq IsCtrlS
+ mov r12,#0x12
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq IsCtrlS
+ A_DR r12,EmaCtrlS
+ mov r11,#0x0
+ strB r11,[r12]
+IsCtrlS:
+
+NO_EM01:
+ ldr r11,= VI
+ ldrB r10,[r5]
+ cmp r10,r11
+ beq ISVI1
+ mov r12,#0x20
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhs NormChar
+ mov r12,r0
+ and r12,r12,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r12
+ ldr r12,= jumps1
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ ldr r11,= WS
+ ldrB r10,[r5]
+ cmp r10,r11
+ beq CJump
+ mov r12,#0x20
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ ldr r11,= EM
+ ldrB r10,[r5]
+ cmp r10,r11
+ beq CJump
+ mov r12,#0x20
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ ldr r11,= PI
+ ldrB r10,[r5]
+ cmp r10,r11
+ beq CJump
+ mov r12,#0x20
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+CJump: b CompJump2
+ISVI1:
+ mov r12,#0x7
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KeyDel
+ mov r12,#0x8
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KeyDell
+ ldr r12,= RETURN
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KeyRet
+NormChar:
+ A_DR r12,mode
+ mov r11,#0x6
+ ldrB r10,[r12]
+ tst r10,r11
+ beq NOEM0
+ CALL ShowBl0
+NOEM0:
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ mov r12,r0
+ and r12,r12,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r12
+ mov r12,#0xc0
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ mov r12,#0x80
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq NormCh2
+noUTF_A:
+
+.endif
+ CALL CheckMode
+.ifdef USE_UNDO
+.else
+ bne OverWriteChar
+.endif
+NormCh2:
+ stmfd r13!,{r0}
+.ifdef W32LF
+.endif
+ CALL Insert1Byte
+ ldmfd r13!,{r0}
+ blo InsWriteEnd
+OverWriteChar:
+ mov r7,#+1
+ strb r0,[r4]
+ add r4,r4,r7
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ eors r0,r0,r0
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+OWCloopUTF8:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mov r9,r4
+ add r9,r9,r0
+ ldrB r12,[R9]
+ bic r1,r1,#0xFF
+ orr r1,r1,r12
+ mov r12,#0xc0
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ mov r12,#0x80
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq OWCloopUTF8
+ CALL DeleteByte
+noUTF_B:
+
+.endif
+SetChg: A_DR r12,changed
+ ldr r11,= CHANGED
+ strB r11,[r12]
+InsWriteEnd:
+ RET
+KeyVICmdr:
+ CALL ReadOneChar
+ ldr r11,= NEWLINE
+ ldrB r10,[r4]
+ cmp r10,r11
+ beq InsWriteEnd
+ ldr r12,= RETURN
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne KeyVICmdr1
+ ldr r12,= NEWLINE
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+KeyVICmdr1:
+
+.ifdef USE_UNDO
+.endif
+KeyVICmdr2:
+ strB r0,[r4]
+ b SetChg
+KeyEmaCtrlQ:
+ A_DR r5,asknumber
+ CALL GetOctalToInteger
+ bls InsWriteEnd
+ mov r12,r2
+ mov r2,r0
+ mov r0,r12
+ mov r11,#0x0
+ mov r8,#0x1
+ add r11,r11,r8,lsl #8
+ cmp r0,r11
+ blo NormCh2
+ RET
+CtrlKMenu:
+ A_DR r1,Ktable
+ mov r12,#0x4b
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b Menu
+CtrlQMenu:
+ A_DR r1,Qtable
+ b PicoQM
+PicoJMenu:
+ A_DR r1,PicoJtable
+ mov r12,#0x4a
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b Menu
+PicoQMenu:
+ A_DR r1,PicoQtable
+PicoQM: mov r12,#0x51
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b Menu
+CtrlXMenu:
+ A_DR r1,Xtable
+ mov r12,#0x58
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+Menu: mov r2,#0x5e
+ mov r8,#0x20
+ add r2,r2,r8,lsl #8
+ mov r8,#0x20
+ add r2,r2,r8,lsl #16
+ mov r8,#0x20
+ add r2,r2,r8,lsl #24
+
+ mov r12,r0
+ and r12,r12,#0xFF
+ bic r2,r2,#0xFF00
+ orr r2,r2,r12,lsl #8
+MakeScanCode:
+ CALL WriteTwo
+ stmfd r13!,{r1}
+ CALL GetChar
+ ldmfd r13!,{r1}
+ mov r12,#0x1f
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ ldr r12,= Ktable_size
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhs InsWriteEnd
+ and r12,r0,#0xFF
+ ldrB r12,[r1,r12]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,r0
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF00
+ orr r0,r0,r12,lsl #8
+ExtAscii:
+ mov r12,r0,lsr #8
+ and r12,r12,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r12
+ ldr r12,= jumps1
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhs InsWriteEnd
+ eors r0,r0,r0
+ A_DR r12,EmaCtrl
+ str r0,[r12]
+CompJump2:
+ mov r12,#0x0
+ bic r1,r1,#0xFF00
+ orr r1,r1,r12,lsl #8
+.ifdef YASM
+.else
+ mov r1,r1
+ mov r1,r1,lsl #16
+ mov r1,r1,lsr #16
+.endif
+ mov r9,r1
+ mov r10,#0x2
+ mov r8,r9
+ mul r9,r8,r10
+ A_DR r10,jumptab1
+ add r9,r9,r10
+ ldrH r1,[R9]
+ A_DR r11,_start
+ adds r1,r1,r11
+
+ stmfd r13!,{r14}
+ add r14,pc,#4
+ mov pc,r1
+ mov r0,r0
+ mov r1,r1
+ mov r2,r2
+ mov r3,r3
+ ldmfd r13!,{r14}
+ A_DR r12,numeriere
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne BZNret
+ stmfd r13!,{r4}
+ A_DR r5,sot
+ mov r12,r4
+ mov r4,r5
+ mov r5,r12
+ eors r3,r3,r3
+BZNLoop:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ CALL LookForward
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ cmp r4,r5
+ bls BZNLoop
+ A_DR r12,linenr
+ str r3,[r12]
+ ldmfd r13!,{r4}
+ A_DR r12,numeriere
+ mov r11,#0x0
+ strB r11,[r12]
+BZNret: RET
+KeyRetNoInd:
+ eors r0,r0,r0
+ b KeyRetNInd
+KeyRet:
+.ifndef NO_AUTO_INDENT
+.ifdef SELFTEST
+.else
+ CALL CheckMode
+ bne OvrRet
+ CALL CountToLineBegin
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ orrs r0,r0,r0
+ beq KeyRetNInd
+ mov r1,r0
+ eors r0,r0,r0
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+KeyRetSrch:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ cmp r0,r1
+ bhs KeyRetNInd
+ mov r9,r5
+ add r9,r9,r0
+ ldr r11,= SPACECHAR
+ ldrB r10,[R9]
+ cmp r10,r11
+ beq KeyRetSrch
+ mov r9,r5
+ add r9,r9,r0
+ ldr r11,= TABCHAR
+ ldrB r10,[R9]
+ cmp r10,r11
+ beq KeyRetSrch
+.endif
+.else
+.endif
+KeyRetNInd:
+ stmfd r13!,{r5}
+ stmfd r13!,{r0}
+ CALL GoDown
+ ldmfd r13!,{r0}
+ stmfd r13!,{r0}
+.ifdef W32LF
+.endif
+ CALL InsertByte0
+ ldmfd r13!,{r2}
+ ldmfd r13!,{r5}
+ blo SimpleRet
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ A_DR r12,linenr
+ mov r11,#0x1
+ ldr r10,[r12]
+ adds r10,r10,r11
+ str r10,[r12]
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mov r7,#+1
+.ifdef W32LF
+.else
+ ldr r12,= NEWLINE
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+.endif
+ cmp r2,#0
+ beq SimpleRet
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+SimpleRet:
+ RET
+OvrRet: eors r0,r0,r0
+ A_DR r12,ch2linebeg
+ str r0,[r12]
+ b DownRet
+KeyDown:
+ CALL CountColToLineBeginVis
+DownRet:
+ CALL GoDown
+ CALL LookLineDown
+ b JmpSC
+KeyUp: CALL GoUp
+ CALL CountColToLineBeginVis
+ CALL LookLineUp
+ b JmpSC
+KeyHalfPgUp:
+ CALL CountColToLineBeginVis
+ CALL LookHalfPgUp
+ b SetColumn
+KeyHalfPgDn:
+ CALL CountColToLineBeginVis
+ CALL LookHalfPgDn
+ b SetColumn
+KeyScrollUp:
+ CALL CountColToLineBeginVis
+ CALL LookScrUp
+ b SetColumn
+KeyScrollDn:
+ CALL CountColToLineBeginVis
+ CALL LookScrDn
+ b SetColumn
+KeyPgUp:
+ CALL CountColToLineBeginVis
+ CALL LookPageUp
+JmpSC: b SetColumn
+KeyPgDn:
+ CALL CountColToLineBeginVis
+ CALL LookPgDown
+SetColumn:
+ A_DR r12,ch2linebeg
+ ldr r2,[r12]
+ eors r3,r3,r3
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+SCloop: mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ ldrB r12,[r4]
+ bic r1,r1,#0xFF
+ orr r1,r1,r12
+ mov r12,#0xc0
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ mov r12,#0x80
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq SCloop
+noUTF_C:
+
+.endif
+ cmp r3,r2
+ bhs SCret
+ ldr r11,= NEWLINE
+ ldrB r10,[r4]
+ cmp r10,r11
+ beq SCret
+ ldr r11,= TABCHAR
+ ldrB r10,[r4]
+ cmp r10,r11
+ beq SCtab
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b SCloop
+SCtab: CALL SpacesForTab
+ mov r12,r0,lsr #8
+ and r12,r12,#0xFF
+ mov r11,r3,lsl #24
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r3,r3,#0xFF
+ orr r3,r3,r11
+ cmp r3,r2
+ bls SCloop
+SCret: RET
+VIsetMarker:
+ cmp r4,r2
+ bhi Marker_above_cursor
+ A_DR r12,blockende
+ ldr r2,[r12]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ cmp r2,r6
+ blo Mbel
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+Mbel: A_DR r12,EmaMark
+ str r2,[r12]
+KeyHome:
+ CALL CountToLineBegin
+ subs r4,r4,r0
+ RET
+Marker_above_cursor:
+
+ A_DR r12,EmaMark
+ str r2,[r12]
+ CALL KeyEnd
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ cmp r4,r6
+ blo Mret
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+Mret: RET
+KeyIns: A_DR r12,insstat
+ ldrB r11,[r12]
+ mvns r11,r11
+ strB r11,[r12]
+ eors r0,r0,r0
+ CALL IsViMode
+ bne KeyIns2
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ A_DR r12,VICmdMode
+ ldrB r10,[r12]
+ mov r11,r0
+ and r11,r11,#0xFF
+ cmp r10,r11
+ bne KeyIns2
+ A_DR r12,insstat
+ strB r0,[r12]
+ CALL KeyVImode0
+KeyIns2:
+ CALL IsEmMode
+ bne KeyIns3
+ A_DR r12,showblock
+ strB r0,[r12]
+KeyIns3:
+
+.ifdef NEW_CURSOR_MGNT
+ A_DR r12,insstat
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne SetCursorNormal
+ b SetCursorBlock
+.endif
+ RET
+KeyVICmdJ:
+ CALL KeyEnd
+ b KeyDel
+KeyDell:
+ CALL KeyLeft
+ beq KeyDell2
+KeyDel: cmp r4,r6
+ bhs KeyIns3
+ eors r0,r0,r0
+KDloopUTF8:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ mov r9,r4
+ add r9,r9,r0
+ ldrB r12,[R9]
+ bic r1,r1,#0xFF
+ orr r1,r1,r12
+ mov r12,#0xc0
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ mov r12,#0x80
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KDloopUTF8
+noUTF_D:
+
+.endif
+.ifdef W32LF
+.endif
+ CALL IsViMode
+ bne DeleteByte
+ mov r5,r4
+ A_DR r12,VInolinebased
+ mov r11,#0x1
+ strB r11,[r12]
+ CALL KeyEmaAltW2
+ b DeleteByte
+KeyDell2:
+ A_DR r11,sot
+ cmp r4,r11
+ bls KeyIns3
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ A_DR r12,linenr
+ mov r11,#0x1
+ ldr r10,[r12]
+ subs r10,r10,r11
+ str r10,[r12]
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b KeyCtrlT1
+KeyEmaCtrlT:
+
+.ifdef UTF8
+ RET
+.else
+.ifdef USE_UNDO
+.endif
+.endif
+KeyRight:
+
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ ldrB r12,[r4]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KeyRight
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+noUTF_E:
+
+.endif
+ ldr r11,= NEWLINE
+ ldrB r10,[r4]
+ cmp r10,r11
+ bne KeyRNoMargin
+ CALL CheckEof
+ bhs KeyRightEnd
+ CALL IsViMode
+ beq KeyRightEnd
+ CALL GoDown
+KeyRNoMargin:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+KeyRightEnd:
+ RET
+KeyCLeft3:
+ A_DR r11,sot
+ cmp r4,r11
+ bls KeyCLEnd
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+KeyCtrlQW:
+ mov r9,r4
+ mov r10,#0x1
+ sub r9,r9,r10
+ ldr r11,= NEWLINE
+ ldrB r10,[R9]
+ cmp r10,r11
+ beq KeyCLeft3
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mov r11,#0x2f
+ ldrB r10,[r4]
+ cmp r10,r11
+ bls KeyCtrlQW
+ mov r9,r4
+ mov r10,#0x1
+ sub r9,r9,r10
+ mov r11,#0x2f
+ ldrB r10,[R9]
+ cmp r10,r11
+ bhi KeyCtrlQW
+KeyCLEnd:
+ RET
+KeyCRight3:
+ CALL CheckEof
+ bhs KeyCREnd
+ b KQZ1
+KeyCtrlQZ:
+ mov r12,#0x2f
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ ldr r11,= NEWLINE
+ ldrB r10,[r4]
+ cmp r10,r11
+ beq KeyCRight3
+KQZ1: mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ CALL IsEmMode
+ beq ISEM2
+ ldrB r10,[r4]
+ mov r11,r0
+ and r11,r11,#0xFF
+ cmp r10,r11
+ bls KeyCtrlQZ
+ mov r9,r4
+ mov r10,#0x1
+ sub r9,r9,r10
+ ldrB r10,[R9]
+ mov r11,r0
+ and r11,r11,#0xFF
+ cmp r10,r11
+ b ISEM22
+ISEM2: mov r9,r4
+ mov r10,#0x1
+ sub r9,r9,r10
+ ldrB r10,[R9]
+ mov r11,r0
+ and r11,r11,#0xFF
+ cmp r10,r11
+ bls KeyCtrlQZ
+ ldrB r10,[r4]
+ mov r11,r0
+ and r11,r11,#0xFF
+ cmp r10,r11
+ISEM22: bhi KeyCtrlQZ
+KeyCREnd:
+ RET
+KeyVIcmde3:
+ CALL CheckEof
+ bhs KeyCREnd
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+KeyVIcmde:
+ ldr r11,= NEWLINE
+ ldrB r10,[r4]
+ cmp r10,r11
+ beq KeyVIcmde3
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mov r11,#0x2f
+ ldrB r10,[r4]
+ cmp r10,r11
+ bls KeyVIcmde
+ mov r9,r4
+ mov r10,#0x1
+ add r9,r9,r10
+ mov r11,#0x2f
+ ldrB r10,[R9]
+ cmp r10,r11
+ bhi KeyVIcmde
+ RET
+KeyEmaCtrlO:
+ CALL Insert1Byte
+ blo KeyRightEnd
+ ldr r12,= NEWLINE
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strB r0,[r4]
+ RET
+KeyCtrlQE:
+ CALL LookPgBegin
+ CALL KursorFirstLine
+ b KCtKV1
+KeyCtrlQX:
+ CALL LookPgEnd
+ CALL KeyEnd
+ CALL KursorLastLine
+ b KCtKV1
+KeyCtrlQV:
+ A_DR r12,bereitsges
+ mov r11,#0x0
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq KeyCREnd
+ A_DR r12,oldQFpos
+ ldr r4,[r12]
+KCtKV1: b CQFNum
+KeyVIbsearch:
+ mov r12,#0xff
+ mov r8,#0xff
+ add r12,r12,r8,lsl #8
+ mov r8,#0xff
+ add r12,r12,r8,lsl #16
+ mov r8,#0xff
+ add r12,r12,r8,lsl #24
+ stmfd r13!,{r12}
+ b KVIf
+KeyVIfsearch:
+ mov r12,#0x1
+ stmfd r13!,{r12}
+KVIf: A_DR r12,grossklein
+ mov r11,#0xff
+ strB r11,[r12]
+ b KeyECtS1
+PicoCtrlTpico:
+ A_DR r12,PicoSearch
+ str r4,[r12]
+KeyEmaAltPer:
+ mov r12,#0x1
+ stmfd r13!,{r12}
+ ldmfd r13!,{r12}
+ A_DR r11,vorwarts
+ str r12,[r11]
+ A_DR r12,grossklein
+ mov r11,#0xdf
+ strB r11,[r12]
+KeyCtrlQA:
+ A_DR r12,bereitsges
+ mov r11,#0x2
+ strB r11,[r12]
+ CALL AskForReplace
+ blo SimpleRet9
+CQACtrlL:
+ stmfd r13!,{r4}
+ CALL FindText
+ bhs CQACL2
+ ldmfd r13!,{r4}
+SimpleRet9:
+ RET
+CQACL2: A_DR r12,suchlaenge
+ ldr r0,[r12]
+ CALL DeleteByte
+ A_DR r12,repllaenge
+ ldr r0,[r12]
+ CALL InsertByte
+ A_DR r5,replacetext
+ CALL MoveBlock
+ b CQFFound
+KeyPiCtrlJT:
+ A_DR r12,bereitsges
+ mov r11,#0x2
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq CQACtrlL
+ RET
+KeyEmaCtrlR:
+ mov r12,#0xff
+ mov r8,#0xff
+ add r12,r12,r8,lsl #8
+ mov r8,#0xff
+ add r12,r12,r8,lsl #16
+ mov r8,#0xff
+ add r12,r12,r8,lsl #24
+ stmfd r13!,{r12}
+ b KECS
+KeyEmaCtrlS:
+ mov r12,#0x1
+ stmfd r13!,{r12}
+KECS: A_DR r12,grossklein
+ mov r11,#0xdf
+ strB r11,[r12]
+KeyECtS1:
+ ldmfd r13!,{r12}
+ A_DR r11,vorwarts
+ str r12,[r11]
+ A_DR r12,EmaMark
+ str r4,[r12]
+ CALL ShowBl0
+KeyCtrlQF:
+ CALL IsEmMode
+ bne NO_EM04
+ A_DR r12,EmaCtrlS
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq KeyCtrlL
+NO_EM04:
+ A_DR r12,suchtext
+ ldr r12,[r12]
+ stmfd r13!,{r12}
+ A_DR r12,bereitsges
+ mov r11,#0x1
+ strB r11,[r12]
+ CALL AskForFind
+ ldmfd r13!,{r1}
+ mrs r12, CPSR
+ stmfd r13!,{r7,r12}
+ A_DR r12,mode
+ mov r11,#0xc
+ ldrB r10,[r12]
+ tst r10,r11
+ beq NO_VIPI01
+ ldmfd r13!,{r7,r12}
+ msr CPSR_f,r12
+ orrs r0,r0,r0
+ bne QFpico
+ mov r12,r1
+ and r12,r12,#0xFF
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ orrs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ beq CtrlQFEnd
+ A_DR r12,suchtext
+ strB r1,[r12]
+QFpico: A_DR r12,PicoSearch
+ str r4,[r12]
+ b CQFCtrlL
+NO_VIPI01:
+ ldmfd r13!,{r7,r12}
+ msr CPSR_f,r12
+ blo CtrlQFEnd
+CQFCtrlL:
+ stmfd r13!,{r4}
+ CALL FindText
+ A_DR r12,EmaCtrlS
+ mov r11,#0x1
+ strB r11,[r12]
+ blo CtrlQFNotFound
+CQFFound:
+ A_DR r12,oldQFpos
+ str r4,[r12]
+ ldmfd r13!,{r5}
+CQFNum: b CheckENum
+CtrlQFNotFound:
+ ldmfd r13!,{r4}
+CtrlQFEnd:
+ RET
+KeyCtrlL:
+ A_DR r12,bereitsges
+ ldr r0,[r12]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ beq CQFCtrlL
+ A_DR r12,mode
+ mov r11,#0x15
+ ldrB r10,[r12]
+ tst r10,r11
+ beq SimpleRet4
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ beq CQACtrlL
+SimpleRet4:
+ RET
+KeyVIcmd1:
+ CALL ReadOneChar
+ mov r12,#0x47
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KeyCtrlQR
+ RET
+ViSpecial:
+ cmp r2,#0
+ beq KeyCtrlQR
+ b KCQI
+KeyNedCtrlA:
+ A_DR r12,EmaMark
+ str r6,[r12]
+ CALL ShowBl1
+KeyCtrlQR:
+ A_DR r4,sot
+ b CQFNum
+KeyCtrlQP:
+ A_DR r12,veryold
+ ldr r2,[r12]
+ cmp r2,r6
+ bhi SimpleRet4
+ mov r4,r2
+JmpCQFN3:
+ b CQFNum
+KeyCtrlQB:
+ mov r12,r4
+ mov r4,r0
+ mov r0,r12
+ A_DR r12,blockbegin
+ ldr r4,[r12]
+CtrlQB2:
+ orrs r4,r4,r4
+ bne CQFNum
+ mov r12,r0
+ mov r0,r4
+ mov r4,r12
+ RET
+KeyCtrlQK:
+ mov r12,r4
+ mov r4,r0
+ mov r0,r12
+ A_DR r12,blockende
+ ldr r4,[r12]
+ b CtrlQB2
+KeyCtrlQI:
+ A_DR r5,asklineno
+ CALL GetAsciiToInteger
+ bls CtrlQFEnd
+KCQI: A_DR r4,sot
+ CALL LookPD2
+JmpCQFN:
+ b JmpCQFN3
+KeyCtrlQDel:
+ CALL KeyLeft
+ CALL CountToLineBegin
+ subs r4,r4,r0
+ b KCY
+KeyVICmdD:
+ A_DR r12,VInolinebased
+ mov r11,#0x1
+ strB r11,[r12]
+KeyCtrlQY:
+ CALL CountToLineEnd
+.ifdef W32LF
+.endif
+ CALL IsViMode
+ bne CtrlTEnd1
+ CALL CtrlTEnd1
+ b KeyLeft
+KeyCmddw:
+ CALL CountToWordBeginVIstyle
+ b NO_EM05
+KeyCtrlY:
+ CALL CountToLineBegin
+ subs r4,r4,r0
+ CALL CountToLineEnd
+ A_DR r12,mode
+ ldr r11,= WS
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne NO_WS01
+KCY: CALL DeleteByteCheckMarker
+ b KeyCtrlT1
+NO_WS01:
+ A_DR r12,mode
+ mov r11,#0xc
+ ldrB r10,[r12]
+ tst r10,r11
+ beq KeyCtrlT
+ mov r9,r4
+ add r9,r9,r0
+ mov r2,R9
+ cmp r2,r6
+ beq CtrlTEnd1
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b CtrlTEnd1
+KeyCtrlT:
+ CALL CountToWordBegin
+ CALL IsEmMode
+ bne NO_EM05
+KeyEmaCtrlK:
+ CALL CountToLineEnd
+NO_EM05:
+ ldr r11,= NEWLINE
+ ldrB r10,[r4]
+ cmp r10,r11
+ bne CtrlTEnd1
+KeyCtrlT1:
+ eors r0,r0,r0
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef W32LF
+.endif
+CtrlTEnd1:
+ CALL CheckEof
+ beq SimpleRet3
+ A_DR r12,mode
+ ldr r11,= WS
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq DeleteByteCheckMarker
+ mov r5,r4
+ CALL KeyEmaAltW2
+ b DelBjmp
+KeyEmaCtrlW:
+ A_DR r12,showblock
+ ldr r2,[r12]
+ A_DR r12,mode
+ ldr r11,= PI
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne NOPI1
+KECW:
+.ifndef YASM
+ cmp r2,#0
+ beq KeyCtrlY
+.else
+.endif
+ A_DR r12,EmaMark
+ ldr r2,[r12]
+ cmp r2,#0
+ beq KECW
+ b NOPI2
+NOPI1: cmp r2,#0
+ beq SimpleRet3
+ A_DR r12,EmaMark
+ ldr r2,[r12]
+ cmp r2,#0
+ beq SimpleRet3
+NOPI2: CALL KeyEmaAltW
+ A_DR r12,EmaKiSrc
+ ldr r4,[r12]
+ A_DR r12,EmaKiSize
+ ldr r0,[r12]
+DelBjmp:
+ b DeleteByte
+KeyCtrlKY:
+ CALL CheckBlock
+ blo SimpleRet3
+ A_DR r12,blockende
+ ldr r0,[r12]
+ mov r4,r5
+ subs r0,r0,r5
+ CALL DeleteByte
+ mov r12,r2
+ mov r2,r0
+ mov r0,r12
+ CALL InitSV2
+JmpCQFN2:
+ b JmpCQFN
+KeyCtrlKH:
+ A_DR r12,showblock
+ mov r11,#0x1
+ ldrB r10,[r12]
+ eors r10,r10,r11
+ strB r10,[r12]
+SimpleRet3:
+ RET
+KeyCtrlKK:
+
+ A_DR r12,blockende
+ str r4,[r12]
+ b ShowBl1
+KeyCtrlKC:
+ CALL CopyBlock
+ blo SimpleRet2
+CtrlKC2:
+ A_DR r12,blockbegin
+ str r4,[r12]
+ adds r0,r0,r4
+ b InitSV3
+KeyCtrlXX:
+ A_DR r12,EmaMark
+ ldr r2,[r12]
+ cmp r2,#0
+ beq SimpleRet3
+ CALL KeyEmaMark
+ mov r4,r2
+ CALL KeyEmaCtrlL
+KeyCXX: b JmpCQFN2
+KeyCtrlKV:
+ CALL CopyBlock
+ blo SimpleRet2
+ stmfd r13!,{r4}
+ A_DR r12,blockbegin
+ ldr r10,[r12]
+ cmp r4,r10
+ mrs r12, CPSR
+ stmfd r13!,{r7,r12}
+ A_DR r12,blockbegin
+ ldr r4,[r12]
+ CALL DeleteByte
+ rsbs r0,r0,#0
+ ldmfd r13!,{r7,r12}
+ msr CPSR_f,r12
+ ldmfd r13!,{r4}
+ blo CtrlKC2
+ A_DR r12,blockende
+ str r4,[r12]
+ subs r4,r4,r0
+KeyCtrlKB:
+ A_DR r12,blockbegin
+ str r4,[r12]
+ShowBl1:
+ A_DR r12,showblock
+ mov r11,#0x1
+ strB r11,[r12]
+SimpleRet2:
+ RET
+ShowBl0:
+ A_DR r12,showblock
+ mov r11,#0x0
+ strB r11,[r12]
+ RET
+KeyVICmdm:
+ CALL ReadOneChar
+ mov r12,#0x61
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne SimpleRet2
+ stmfd r13!,{r4}
+ CALL KeyHome
+ A_DR r12,blockbegin
+ str r4,[r12]
+ ldmfd r13!,{r4}
+ RET
+KeyVICmdJmpM:
+ CALL ReadOneChar
+ mov r12,#0x61
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne SimpleRet2
+ A_DR r12,blockbegin
+ ldr r2,[r12]
+ cmp r2,#0
+ beq SimpleRet2
+ mov r4,r2
+ b KeyCXX
+KeyEmaMark:
+ A_DR r12,EmaMark
+ str r4,[r12]
+ b ShowBl1
+KeyCtrlKR:
+ CALL ReadBlock
+ blo CtrlKREnd
+ CALL KeyCtrlKB
+ adds r2,r2,r4
+ A_DR r12,blockende
+ str r2,[r12]
+ A_DR r12,mode
+ mov r11,#0x12
+ ldrB r10,[r12]
+ tst r10,r11
+ beq NO_EM03
+ A_DR r12,EmaMark
+ str r2,[r12]
+ CALL ShowBl0
+NO_EM03:
+ A_DR r12,mode
+ ldr r11,= PI
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne CtrlKREnd
+ mov r4,r2
+CtrlKREnd:
+ b RestKursPos
+KeyCtrlKW:
+ CALL CheckBlock
+ blo CtrlKSEnd
+ CALL SaveBlock
+ b CtrlKREnd
+KeyEmaCtrlXF:
+ A_DR r12,changed
+ ldr r11,= UNCHANGED
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq KECF
+ A_DR r5,asksave2
+ CALL DE1
+ CALL RestKursPos
+ CALL CheckUserAbort
+ beq CtrlKSEnd
+ mov r12,#0xdf
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x4e
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+KECF: beq KCKD2
+ b KeyCtrlKD
+KeyEmaCtrlXW:
+ CALL GetBlockName
+ blo CtrlKSEnd
+ A_DR r5,blockpath
+XW1: mov r7,#+1
+ PUSH_ALL @(is a macro)
+ A_DR r4,filepath
+XW0: ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+ mov r12,r0
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ orrs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ bne XW0
+ strb r0,[r4]
+ add r4,r4,r7
+ POP_ALL @(is a macro)
+KeyCtrlKS0:
+ CALL SetChg
+KeyCtrlKS:
+ CALL SaveFile
+ mrs r12, CPSR
+ stmfd r13!,{r7,r12}
+ CALL RestKursPos
+ ldmfd r13!,{r7,r12}
+ msr CPSR_f,r12
+ blo CtrlKSEnd
+Unchg: A_DR r12,changed
+ ldr r11,= UNCHANGED
+ strB r11,[r12]
+CtrlKSEnd:
+ RET
+KeyCtrlKD:
+ CALL KeyCtrlKS
+ blo KeyKXend
+KCKD2: A_DR r12,endeedit
+ mov r11,#0x2
+ strB r11,[r12]
+ RET
+KeyCtrlKQ:
+ A_DR r12,changed
+ ldr r11,= UNCHANGED
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq KCKXend
+ A_DR r5,asksave
+ CALL DE1
+ CALL RestKursPos
+ CALL CheckUserAbort
+ beq CtrlKSEnd
+ mov r12,#0xdf
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x4e
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KCKXend
+ mov r12,#0x4c
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne KeyCtrlKX
+ CALL KCKXend
+KeyCtrlKX:
+ CALL KeyCtrlKS
+ blo CtrlKSEnd
+KCKXend:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ A_DR r12,endeedit
+ mov r11,#0x1
+ ldrB r10,[r12]
+ adds r10,r10,r11
+ strB r10,[r12]
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+KeyKXend:
+ RET
+KeyVICmdW:
+ mov r9,r2
+ mov r10,#0x2
+ add r9,r9,r10
+ mov r5,R9
+ ldr r11,= SPACECHAR
+ ldrB r10,[r5]
+ cmp r10,r11
+ bhi XW1
+ RET
+VINoLineCmd:
+ ldr r0,[r2]
+ mov r12,#0x77
+ mov r8,#0x21
+ add r12,r12,r8,lsl #8
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #16
+ cmp r11,r12
+ beq KeyCtrlKS0
+ mov r12,#0x77
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #16
+ cmp r11,r12
+ beq KeyCtrlKS
+ mov r12,#0x78
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #16
+ cmp r11,r12
+ beq KeyCtrlKX
+ mov r12,#0x24
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #16
+ cmp r11,r12
+ bne KVI_KX0
+KeyCtrlQC:
+ mov r4,r6
+ b CQFNum
+KVI_KX0:
+ mov r12,#0x77
+ mov r8,#0x71
+ add r12,r12,r8,lsl #8
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #16
+ cmp r11,r12
+KVI_KX: beq KeyCtrlKX
+ mov r12,#0x77
+ mov r8,#0x20
+ add r12,r12,r8,lsl #8
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #16
+ cmp r11,r12
+ beq KeyVICmdW
+ mov r12,#0x71
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #16
+ cmp r11,r12
+ beq KeyCtrlKQ
+ mov r12,#0x71
+ mov r8,#0x21
+ add r12,r12,r8,lsl #8
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #16
+ cmp r11,r12
+ beq KCKXend
+ mov r12,#0x65
+ mov r8,#0x20
+ add r12,r12,r8,lsl #8
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #16
+ cmp r11,r12
+ beq KeyVICmdE
+ mov r12,#0x68
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #16
+ cmp r11,r12
+ beq KeyHelp
+.ifndef USE_PIPE
+ RET
+.else
+.endif
+KeyVICmdZ:
+ CALL ReadOneChar
+ mov r12,#0x5a
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KVI_KX
+ RET
+KeyVI1Char:
+ CALL KeyHome
+ ldr r11,= SPACECHAR
+ ldrB r10,[r4]
+ cmp r10,r11
+ bhi KFC2
+KFC1: ldr r11,= NEWLINE
+ ldrB r10,[r4]
+ cmp r10,r11
+ beq KFC2
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ ldr r11,= SPACECHAR
+ ldrB r10,[r4]
+ cmp r10,r11
+ bls KFC1
+ mov r9,r4
+ mov r10,#0x1
+ sub r9,r9,r10
+ ldr r11,= SPACECHAR
+ ldrB r10,[R9]
+ cmp r10,r11
+ bhi KFC1
+KFC2: RET
+KeyVICmdS:
+ CALL KeyHome
+ CALL KeyEmaCtrlK
+ A_DR r12,VInolinebased
+ mov r11,#0x1
+ strB r11,[r12]
+ b KeyVICmdI
+KeyVICmdd:
+ CALL ReadOneChar
+ mov r12,#0x77
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ A_DR r12,VInolinebased
+ mov r11,#0x1
+ strB r11,[r12]
+ beq KeyCmddw
+ mov r12,#0x64
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ A_DR r12,VInolinebased
+ mov r11,#0x0
+ strB r11,[r12]
+ beq KeyCtrlY
+ mov r12,#0x27
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne KFC2
+ CALL ReadOneChar
+ mov r12,#0x61
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne KFC2
+ A_DR r12,blockbegin
+ ldr r2,[r12]
+ cmp r2,#0
+ beq KFC2
+ CALL VIsetMarker
+callKECW:
+ CALL KeyEmaCtrlW
+ eors r0,r0,r0
+ A_DR r12,blockbegin
+ str r0,[r12]
+ b JmpCQFn
+KeyVICmdI:
+ CALL KeyVI1Char
+ b KeyVImode0
+KeyVICmdp:
+ A_DR r12,EmaKiSize
+ ldr r2,[r12]
+jmpKFC2:
+
+.ifdef YASM
+.else
+ cmp r2,#0
+ beq KFC2
+.endif
+ A_DR r12,VInolinebased
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq KeyVICmdpnLB
+ CALL OvrRet
+KeyVICmdP:
+ A_DR r12,EmaKiSize
+ ldr r2,[r12]
+ cmp r2,#0
+ beq jmpKFC2
+ A_DR r12,VInolinebased
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq KeyVICmdPnLB
+ CALL KeyHome
+KeyVICP2:
+ stmfd r13!,{r4}
+ CALL KeyEmaCtrlY
+ ldmfd r13!,{r4}
+JmpCQFn:
+ b CQFNum
+KeyVICmdR:
+ A_DR r12,insstat
+ mov r11,#0xfe
+ strB r11,[r12]
+ b KeyVImode0
+KeyVICmdO:
+ CALL KeyHome
+ CALL KeyRet
+ CALL KeyUp
+ b KeyVImode0
+KeyVICmdo:
+ CALL KeyEnd
+ CALL KeyRet
+ b KeyVImode0
+KeyVICmdA:
+ CALL KeyEnd
+ b KeyVImode0
+KeyVIcmda:
+ CALL KeyRight
+KeyVIcmdi:
+ A_DR r12,insstat
+ mov r11,#0x1
+ strB r11,[r12]
+KeyVImode0:
+ mov r12,#0x0
+ stmfd r13!,{r12}
+ b KVim1
+KeyVICmdC:
+ CALL KeyEmaCtrlK
+ A_DR r12,VInolinebased
+ mov r11,#0x1
+ strB r11,[r12]
+ b KeyVImode0
+KeyVICmdpnLB:
+ CALL KeyRight
+KeyVICmdPnLB:
+ CALL KeyVICP2
+ A_DR r12,EmaKiSize
+ ldr r10,[r12]
+ adds r4,r4,r10
+KeyLeft:
+
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ ldrB r12,[r4]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KeyLeft
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+noUTF_F:
+
+.endif
+ mov r9,r4
+ mov r10,#0x1
+ sub r9,r9,r10
+ ldr r11,= NEWLINE
+ ldrB r10,[R9]
+ cmp r10,r11
+ bne KeyLNoMargin
+ A_DR r11,sot
+ cmp r4,r11
+ beq KeyLeftEnd
+ CALL IsViMode
+ beq KeyLeftEnd
+ CALL GoUp
+KeyLNoMargin:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef W32LF
+.endif
+KeyLeftEnd:
+ RET
+KeyEnd: CALL CountToLineEnd
+ adds r4,r4,r0
+ RET
+KeyVImode1:
+ mov r12,#0x1
+ stmfd r13!,{r12}
+KVim1: ldmfd r13!,{r0}
+ A_DR r12,VICmdMode
+ strB r0,[r12]
+ RET
+KeyVIex:
+ CALL InputStringWithMessage0
+ mrs r12, CPSR
+ stmfd r13!,{r7,r12}
+ CALL RestKursPos
+ ldmfd r13!,{r7,r12}
+ msr CPSR_f,r12
+ blo Kviex
+ A_DR r5,optbuffer
+ eors r3,r3,r3
+ mov r2,r0
+ cmp r2,#0
+ beq Kviex
+ stmfd r13!,{r5}
+ mov r7,#+1
+CheckDig:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0x30
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhs CD1
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+CD1: mov r12,#0x3a
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ blo CD2
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+CD2: subs r2,r2,#1
+ bne CheckDig
+ ldmfd r13!,{r2}
+ orrs r3,r3,r3
+ bne VINoLineCmd
+ CALL GetAsciiToInteger
+ b ViSpecial
+IsViMode:
+ A_DR r12,mode
+ ldr r11,= VI
+ ldrB r10,[r12]
+ cmp r10,r11
+ RET
+IsEmMode:
+ A_DR r12,mode
+ ldr r11,= EM
+ ldrB r10,[r12]
+ cmp r10,r11
+Kviex: RET
+DispNewScreen:
+ A_DR r12,mode
+ mov r11,#0x16
+ ldrB r10,[r12]
+ tst r10,r11
+ beq NoEmBlock
+ A_DR r12,showblock
+ ldr r2,[r12]
+ cmp r2,#0
+ beq NoEmBlock
+ A_DR r12,EmaMark
+ ldr r2,[r12]
+ cmp r2,#0
+ beq NoEmBlock
+ mov r0,r4
+ cmp r2,r0
+ blo EmBlock
+ mov r12,r2
+ mov r2,r0
+ mov r0,r12
+EmBlock:
+ A_DR r12,blockbegin
+ str r2,[r12]
+ A_DR r12,blockende
+ str r0,[r12]
+NoEmBlock:
+ CALL GetEditScreenSize
+ eors r0,r0,r0
+ A_DR r12,isbold
+ strB r0,[r12]
+ A_DR r12,inverse
+ strB r0,[r12]
+ A_DR r12,zloffst
+ str r0,[r12]
+ A_DR r12,columne
+ str r0,[r12]
+ A_DR r12,fileptr
+ str r4,[r12]
+ stmfd r13!,{r4}
+ CALL CountColToLineBeginVis
+ A_DR r12,columns
+ ldr r1,[r12]
+ mov r9,r1
+ mov r10,#0x4
+ sub r9,r9,r10
+ mov r1,R9
+ cmp r0,r1
+ blo DispShortLine
+ subs r0,r0,r1
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ A_DR r12,zloffst
+ str r0,[r12]
+DispShortLine:
+ CALL LookPgBegin
+ mov r5,r4
+ A_DR r12,lines
+ ldr r2,[r12]
+.ifndef YASM
+ cmp r2,#0
+ beq Kviex
+.else
+.endif
+ mov r7,#+1
+ mov r12,#0xff
+ bic r1,r1,#0xFF00
+ orr r1,r1,r12,lsl #8
+DispNewLine:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r12,#0x1
+ mov r11,r1,lsl #16
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF00
+ orr r1,r1,r11,lsl #8
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ A_DR r4,screenline
+ eors r3,r3,r3
+ mov r12,#0x0
+ bic r1,r1,#0xFF
+ orr r1,r1,r12
+.ifdef LESSWRITEOPS
+ CALL SetColor2
+.endif
+DispCharLoop:
+
+ A_DR r12,fileptr
+ ldr r10,[r12]
+ cmp r5,r10
+ bne DispCharL1
+ A_DR r12,tabcnt
+ mov r11,#0x0
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne DispCharL1
+ A_DR r12,kurspos
+ str r1,[r12]
+ A_DR r12,columne
+ strB r1,[r12]
+ A_DR r12,zloffst
+ ldr r0,[r12]
+ A_DR r12,columne
+ ldr r10,[r12]
+ adds r10,r10,r0
+ str r10,[r12]
+.ifdef CURSORMGNT
+.endif
+DispCharL1:
+ CALL SetColor
+DispEndLine:
+ cmp r5,r6
+ bhi FillLine
+ A_DR r12,tabcnt
+ mov r11,#0x0
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq ELZ
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ A_DR r12,tabcnt
+ mov r11,#0x1
+ ldrB r10,[r12]
+ subs r10,r10,r11
+ strB r10,[r12]
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b ELZ2
+ELZ: cmp r5,r6
+ bne ELZ6
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b ELZ2
+ELZ6: ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ ldr r12,= TABCHAR
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne ELZ3
+ CALL SpacesForTab
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r12,#0x1
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #24
+ subs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF00
+ orr r0,r0,r11,lsl #8
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ A_DR r12,tabcnt
+ mov r11,r0,lsr #8
+ strB r11,[r12]
+ELZ2: ldr r12,= SPACECHAR
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ELZ3: ldr r12,= NEWLINE
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq FillLine
+.ifdef W32LF
+.endif
+ ldr r12,= SPACECHAR
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhs ELZ9
+ mov r12,#0x2e
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ELZ9:
+.ifndef W32
+ mov r12,#0x7f
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ blo ELZ7
+.ifndef UTF8
+.endif
+ELZ7:
+.endif
+ A_DR r10,columns
+ ldrB r12,[r10]
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhs DispEndLine
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ stmfd r13!,{r0}
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ ldmfd r13!,{r0}
+ beq ELUTF8
+noUTF_G:
+
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ELUTF8:
+.else
+.endif
+ A_DR r12,zloffst
+ ldr r10,[r12]
+ cmp r3,r10
+ bls ELZ5
+ strb r0,[r4]
+ add r4,r4,r7
+.ifdef CURSORMGNT
+.endif
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ stmfd r13!,{r0}
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ ldmfd r13!,{r0}
+ beq ELZ5
+noUTF_H:
+
+.endif
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r12,#0x1
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ELZ5: b DispCharLoop
+FillLine:
+ stmfd r13!,{r2}
+ A_DR r12,columns
+ ldr r2,[r12]
+ mov r12,r1
+ and r12,r12,#0xFF
+ mov r11,r2,lsl #24
+ mov r11,r11,lsr #24
+ subs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r2,r2,#0xFF
+ orr r2,r2,r11
+ ldr r12,= SPACECHAR
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ cmp r2,#0
+ beq FillLine2
+ A_DR r12,inverse
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne FillLine1
+ strb r0,[r4]
+ add r4,r4,r7
+.ifdef CURSORMGNT
+.endif
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ beq FillLine2
+FillLine1:
+
+@reploop:
+ strb r0,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#20 @rep stosb
+FillLine2:
+ ldmfd r13!,{r2}
+ mov r11,#0x0
+ strB r11,[r4]
+ CALL ScreenLineShow
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ bne DispNewLine
+ ldmfd r13!,{r4}
+ b RestKursPos
+.ifdef CURSORMGNT
+.endif
+.ifdef W32
+.else
+SIS6: A_DR r12,isbold
+ mov r11,#0x0
+ strB r11,[r12]
+SIS5: A_DR r5,bold0
+SIS2: ldr r12,= boldlen
+ stmfd r13!,{r12}
+ ldmfd r13!,{r2}
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+SIS3: mrs r12, CPSR
+ orr r12,r12,#0x20000000
+ msr CPSR_f,r12
+SIS4: ldmfd r13!,{r5}
+ ldmfd r13!,{r2}
+ RET
+SetColor:
+ stmfd r13!,{r2}
+ stmfd r13!,{r5}
+ CALL IsShowBlock
+ bhs SCEsc1
+ A_DR r12,isbold
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq SIS4
+ A_DR r12,isbold
+ mov r11,#0x1
+ strB r11,[r12]
+SCEsc2: A_DR r5,bold1
+ b SIS2
+SCEsc1: A_DR r12,isbold
+ mov r11,#0x0
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq SIS4
+ b SIS6
+.ifdef LESSWRITEOPS
+SetColor2:
+
+ stmfd r13!,{r2}
+ stmfd r13!,{r5}
+ CALL IsShowBlock
+ bhs SIS5
+ b SCEsc2
+.endif
+.endif
+IsShowBlock:
+ A_DR r12,showblock
+ mov r11,#0x0
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq SBlock
+ A_DR r12,blockbegin
+ mov r11,#0x0
+ ldr r10,[r12]
+ cmp r10,r11
+ beq SBlock
+ A_DR r12,blockbegin
+ ldr r10,[r12]
+ cmp r10,r5
+ bhi SBlock
+ A_DR r12,blockende
+ ldr r10,[r12]
+ cmp r5,r10
+ blo SB_ret
+SBlock: mrs r12, CPSR
+ orr r12,r12,#0x20000000
+ msr CPSR_f,r12
+SB_ret: RET
+GetEditScreenSize:
+
+.ifdef W32
+.else
+ ldr r2,= TERMIOS_WSIZE
+
+ A_DR r3,winsize
+ CALL IOctlTerminal
+ ldr r0,[r3]
+ mov r11,#0xff
+ mov r8,#0xff
+ add r11,r11,r8,lsl #8
+ cmp r0,r11
+ blo iserr
+ orrs r0,r0,r0
+ bne noerr
+iserr: mov r0,#0x18
+ mov r8,#0x0
+ add r0,r0,r8,lsl #8
+ mov r8,#0x50
+ add r0,r0,r8,lsl #16
+
+noerr: mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ A_DR r12,lines
+ strB r0,[r12]
+ mov r0,r0,lsr #16
+ A_DR r12,columns
+ strB r0,[r12]
+ RET
+.endif
+WriteTwo:
+ A_DR r12,screenline
+ str r2,[r12]
+StatusLineShow:
+
+.ifdef W32
+.endif
+ eors r2,r2,r2
+ScreenLineShow:
+ PUSH_ALL @(is a macro)
+.ifdef LESSWRITEOPS
+.ifdef W32
+.else
+ eors r1,r1,r1
+.endif
+ A_DR r12,columns
+ ldr r0,[r12]
+ mov r9,r0
+ mov r10,#0x20
+ add r9,r9,r10
+ mov r0,R9
+ mul r12,r0,r2
+ mov r0,r12
+ mov r3,#0
+ mov r9,r0
+ A_DR r10,screenbuffer
+ add r9,r9,r10
+ mov r4,R9
+.else
+.endif
+ mov r7,#+1
+ A_DR r5,screenline
+sl3: ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef LESSWRITEOPS
+ A_DR r11,screenbuffer_end
+ cmp r4,r11
+ bhs sl5
+ ldrB r12,[r4]
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq sl4
+ strB r0,[r4]
+sl5: mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r1,r1,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+sl4: mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.endif
+ mov r12,r0
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ orrs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ bne sl3
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef LESSWRITEOPS
+ orrs r1,r1,r1
+ beq NoWrite
+.endif
+ stmfd r13!,{r3}
+ eors r3,r3,r3
+ A_DR r10,lines
+ ldrB r12,[r10]
+ bic r3,r3,#0xFF00
+ orr r3,r3,r12,lsl #8
+ mov r12,r2
+ and r12,r12,#0xFF
+ mov r11,r3,lsl #16
+ mov r11,r11,lsr #24
+ subs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r3,r3,#0xFF00
+ orr r3,r3,r11,lsl #8
+.ifdef W32_EXTENDED_IO
+.else
+ CALL sys_writeKP
+ ldmfd r13!,{r3}
+ stmfd r13!,{r2}
+ A_DR r0,screencolors1
+ CALL sys_writeSLColors
+ A_DR r2,screenline
+ CALL WriteFile0
+ ldmfd r13!,{r2}
+ A_DR r0,screencolors0
+ CALL sys_writeSLColors
+ A_DR r12,kurspos2
+ ldr r3,[r12]
+ CALL sys_writeKP
+.endif
+NoWrite:
+ POP_ALL @(is a macro)
+ RET
+sys_writeSLColors:
+
+.ifndef W32
+ cmp r2,#0
+ beq syswSL
+ RET
+syswSL: PUSH_ALL @(is a macro)
+ mov r12,r2
+ mov r2,r0
+ mov r0,r12
+ ldr r12,= scolorslen
+ stmfd r13!,{r12}
+ ldmfd r13!,{r3}
+ CALL WriteFile0
+ POP_ALL @(is a macro)
+.endif
+ RET
+InputStringWithMessage0:
+ A_DR r5,extext
+InputStringWithMessage:
+ CALL WriteMess9MakeLine
+ A_DR r2,optbuffer
+ ldr r12,= optslen
+ stmfd r13!,{r12}
+ ldmfd r13!,{r3}
+ b InputString
+InputString00:
+ A_DR r2,suchtext
+InputString0:
+ CALL WriteMess9MakeLine
+ ldr r3,= maxfilenamelen
+
+InputString:
+ stmfd r13!,{r2}
+ stmfd r13!,{r4}
+ mov r12,#0x2
+ stmfd r13!,{r12}
+ ldmfd r13!,{r0}
+ A_DR r12,VICmdMode
+ ldr r10,[r12]
+ str r0,[r12]
+ mov r0,r10
+ stmfd r13!,{r0}
+ A_DR r12,kurspos2
+ ldr r12,[r12]
+ stmfd r13!,{r12}
+ A_DR r12,columns
+ ldr r1,[r12]
+.ifndef LINUX
+.endif
+ mov r9,r1
+ ldr r10,= stdtxtlen
+ sub r9,r9,r10
+ mov r1,R9
+ cmp r3,r1
+ blo IS8
+ mov r3,r1
+IS8: eors r1,r1,r1
+ mov r4,r2
+IS0: stmfd r13!,{r1}
+ stmfd r13!,{r3}
+ stmfd r13!,{r2}
+ PUSH_ALL @(is a macro)
+ mov r5,r2
+ A_DR r4,screenline+stdtxtlen
+ mov r2,r1
+ mov r7,#+1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ mov r2,r3
+ subs r2,r2,r1
+ mov r12,#0x20
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+@reploop:
+ strb r0,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#20 @rep stosb
+ POP_ALL @(is a macro)
+ mov r1,r4
+ subs r1,r1,r2
+ ldr r12,= stdtxtlen
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ mov r5,r2
+ISloopUTF8:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne ISdncUTF8
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r12,#0x1
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ subs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ISdncUTF8:
+ cmp r5,r4
+ blo ISloopUTF8
+noUTF_I:
+
+.endif
+ A_DR r10,lines
+ ldrB r12,[r10]
+ bic r1,r1,#0xFF00
+ orr r1,r1,r12,lsl #8
+ A_DR r12,kurspos2
+ str r1,[r12]
+.ifdef LESSWRITEOPS
+ A_DR r12,screenbuffer
+ mov r11,#0x0
+ strB r11,[r12]
+.endif
+ CALL StatusLineShow
+ CALL GetChar
+ ldmfd r13!,{r2}
+ ldmfd r13!,{r3}
+ ldmfd r13!,{r1}
+ mov r7,#+1
+ CALL IsViMode
+ bne NO_VI01
+ mov r12,#0x0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq ISA
+NO_VI01:
+ CALL CheckUserAbort
+ bne IS9
+ISA: eors r1,r1,r1
+IS1j: b IS1
+IS9: ldr r12,= RETURN
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq IS1j
+ mov r12,#0x8
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne IS2
+DNHloopUTF8:
+
+ cmp r4,r2
+ beq IS0
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ ldrB r12,[r4]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq DNHloopUTF8
+noUTF_J:
+
+ b Delete1
+.else
+.endif
+IS2: mov r12,#0x0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NoSpecialKey
+ mov r12,#0x5
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NotEnd
+ mov r9,r2
+ add r9,r9,r1
+ mov r4,R9
+IS0j:
+.ifdef UTF8
+ b IS0
+.else
+.endif
+NotEnd: mov r12,#0x0
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NotHome
+ mov r4,r2
+ b IS0j
+NotHome:
+ mov r12,#0x3
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NotLeft
+NHloopUTF8:
+
+ cmp r4,r2
+ beq IS0j
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ ldrB r12,[r4]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq NHloopUTF8
+noUTF_K:
+
+.endif
+ b IS0j
+NotLeft:
+ mov r12,#0x4
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NotRight
+ mov r9,r2
+ add r9,r9,r1
+ mov r5,R9
+NLloopUTF8:
+
+ cmp r4,r5
+ beq IS0j
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ ldrB r12,[r4]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq NLloopUTF8
+noUTF_L:
+
+.endif
+IS0jj: b IS0j
+NotRight:
+ mov r12,#0x8
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NotIns
+ A_DR r12,insstat
+ ldrB r11,[r12]
+ mvns r11,r11
+ strB r11,[r12]
+.ifdef NEW_CURSOR_MGNT
+ A_DR r12,insstat
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne NCM
+ CALL SetCursorBlock
+ b IS0j
+NCM: CALL SetCursorNormal
+.endif
+ b IS0j
+NotIns: mov r12,#0x9
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NoSpecialKey
+Delete1:
+ mov r9,r2
+ add r9,r9,r1
+ mov r5,R9
+ cmp r4,r5
+ beq IS0jj
+.ifdef UTF8
+ stmfd r13!,{r2}
+ stmfd r13!,{r4}
+ stmfd r13!,{r5}
+ mov r2,r1
+ mov r9,r4
+ mov r10,#0x1
+ add r9,r9,r10
+ mov r5,R9
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r1,r1,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+DeloopUTF8:
+
+.ifdef UTF8RTS
+.endif
+ ldrB r12,[r5]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne DeUTF8
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r1,r1,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b DeloopUTF8
+noUTF_M:
+
+DeUTF8: mov r7,#+1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ ldmfd r13!,{r5}
+ ldmfd r13!,{r4}
+ ldmfd r13!,{r2}
+.else
+.endif
+ b IS0jj
+NoSpecialKey:
+
+ ldr r12,= SPACECHAR
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ blo IS0jj
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ stmfd r13!,{r1}
+ mov r12,r0
+ and r12,r12,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r12
+ mov r12,#0xc0
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ mov r12,#0x80
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ ldmfd r13!,{r1}
+ beq INSrt
+noUTF_N:
+
+.endif
+ A_DR r12,insstat
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq INSrt
+ mov r9,r2
+ add r9,r9,r1
+ mov r5,R9
+ cmp r4,r5
+ bne NO_INSERT
+INSrt: PUSH_ALL @(is a macro)
+ mov r0,r4
+ mov r9,r2
+ add r9,r9,r3
+ mov r10,#0x1
+ add r9,r9,r10
+ mov r4,R9
+ mov r9,r4
+ mov r10,#0x1
+ sub r9,r9,r10
+ mov r5,R9
+ mov r2,r4
+ subs r2,r2,r0
+ mov r7,#-1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ POP_ALL @(is a macro)
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r1,r1,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+NO_INSERT:
+ mov r7,#+1
+ strb r0,[r4]
+ add r4,r4,r7
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ mov r5,r4
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+NI_loopUTF8:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ ldrB r12,[r5]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq NI_loopUTF8
+ cmp r5,r4
+ beq NI_UTF8rdy
+ PUSH_ALL @(is a macro)
+ mov r2,r1
+ mov r7,#+1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ POP_ALL @(is a macro)
+noUTF_O:
+
+NI_UTF8rdy:
+
+.endif
+ cmp r1,r3
+ blo IS0j
+IS1: eors r0,r0,r0
+ mov r9,r2
+ add r9,r9,r1
+ strB r0,[R9]
+ ldmfd r13!,{r12}
+ A_DR r11,kurspos2
+ str r12,[r11]
+ ldmfd r13!,{r12}
+ A_DR r11,VICmdMode
+ str r12,[r11]
+ ldmfd r13!,{r4}
+ ldmfd r13!,{r2}
+ mov r12,r1
+ mov r1,r0
+ mov r0,r12
+ mov r12,#0x1
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ISready:
+ RET
+ReadChar:
+ mov r0,r4
+ A_DR r12,old
+ ldr r10,[r12]
+ str r0,[r12]
+ mov r0,r10
+ A_DR r12,veryold
+ str r0,[r12]
+GetChar:
+ CALL ReadOneChar
+.ifdef W32
+.endif
+ mov r12,#0x7f
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne RC_No7F
+.ifndef FREEBSD
+ mov r12,#0x8
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+.else
+.endif
+RC_No7F:
+
+.equ DoNo,10
+ CALL IsViMode
+ beq ISVI7
+ mov r12,#0x1b
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne ISready
+ CALL ReadOneChar
+ b NOVI7
+ISVI7: A_DR r12,VICmdMode
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne NoCMDmode
+ mov r12,#0x1b
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq ESCpressed
+ ldr r12,= VIsize
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhi Other
+ A_DR r1,VIcmdTable
+ b RCready_0
+ESCpressed:
+ CALL ReadOneChar
+ mov r12,#0x5b
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq Other
+ b NoCursorKey
+NoCMDmode:
+ mov r12,#0x1b
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne ISready
+ CALL KeyVImode1
+.ifdef BEOS
+.else
+.ifdef SYS_select
+ PUSH_ALL @(is a macro)
+ CALL Select
+ POP_ALL @(is a macro)
+ beq isSingleEscape
+.endif
+.endif
+ CALL ReadOneChar
+ mov r12,#0x5b
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq IsCursorKey
+NoCursorKey:
+ A_DR r12,VIbufch
+ strB r0,[r12]
+ ldr r12,= DoNo
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b JmpRCready
+isSingleEscape:
+ mov r12,#0x3
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b JmpRCready
+IsCursorKey:
+ CALL KeyVImode0
+NOVI7: A_DR r12,mode
+ ldr r11,= NE
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne NONE7
+ mov r12,#0x69
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NOi
+ mov r12,#0x10
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b JmpRCready
+NOi: mov r12,#0x49
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NONE7
+ mov r12,#0x10
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b JmpRCready
+NONE7: CALL IsEmMode
+ bne NOEM7
+ mov r12,#0x25
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NoAltPer
+ mov r12,#0x28
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+JmpRCready:
+ b RCready_1
+NoAltPer:
+ mov r12,#0x3c
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NoAltLt
+ mov r12,#0xe
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b RCready_1
+NoAltLt:
+ mov r12,#0x3e
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne NoAltGt
+ mov r12,#0xf
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b RCready_1
+NoAltGt:
+ mov r12,#0x5f
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x42
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ subs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ bmi Other
+ ldr r12,= ATsize
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhi Other
+ A_DR r1,EmaAltTable
+ b RCready_0
+NOEM7: mov r12,#0x5f
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x48
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne Other
+ mov r12,#0x3d
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b RCready_1
+Other:
+.ifdef W32
+.else
+ CALL ReadOneChar
+ mov r12,#0x38
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhi NoNumber
+ stmfd r13!,{r0}
+ CALL ReadOneChar
+ mov r12,r1
+ mov r1,r0
+ mov r0,r12
+ ldmfd r13!,{r0}
+ mov r12,#0x7e
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne GetCharJmp
+NoNumber:
+ mov r12,#0x30
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ subs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x9
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ blo IsNumber
+.ifdef QNX
+.else
+ mov r12,#0x8
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ subs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+.endif
+ mov r12,#0x9
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ blo GetCharJmp
+ ldr r12,= STsize
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhi GetCharJmp
+IsNumber:
+ A_DR r1,ScanTable
+.endif
+RCready_0:
+ and r12,r0,#0xFF
+ ldrB r12,[r1,r12]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+RCready_1:
+ mov r0,r0,lsl #8
+ RET
+GetCharJmp:
+ b GetChar
+ReadOneChar:
+ CALL IsViMode
+ bne NOVI4
+ eors r0,r0,r0
+ A_DR r12,VIbufch
+ ldr r10,[r12]
+ str r0,[r12]
+ mov r0,r10
+ orrs r0,r0,r0
+ bne RoneC
+NOVI4: A_DR r2,read_b
+ eors r3,r3,r3
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ CALL ReadFile0
+.ifdef SELFTEST
+.endif
+ ldr r0,[r2]
+.ifdef W32_EXTENDED_IO
+.endif
+RoneC: mov r12,#0xff
+ bic r0,r0,#0xFF00
+ orr r0,r0,r12,lsl #8
+ RET
+LookBackward:
+
+ stmfd r13!,{r2}
+ stmfd r13!,{r1}
+ eors r1,r1,r1
+ mov r9,r4
+ mov r10,#0x1
+ sub r9,r9,r10
+ ldr r11,= NEWLINE
+ ldrB r10,[R9]
+ cmp r10,r11
+ beq LBa3
+ ldr r11,= NEWLINE
+ ldrB r10,[r4]
+ cmp r10,r11
+ bne LBa1
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r1,r1,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+LBa1: mov r2,#0x9f
+ mov r8,#0x86
+ add r2,r2,r8,lsl #8
+ mov r8,#0x1
+ add r2,r2,r8,lsl #16
+
+ ldr r12,= NEWLINE
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r7,#-1
+ and r11,r0,#0xFF
+@reploop:
+ ldrb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ cmpne r12,r11
+ subne pc,pc,#24 @rep scasb
+ mov r9,r1
+ mov r10,#0x9d
+ mov r8,#0x86
+ add r10,r10,r8,lsl #8
+ mov r8,#0x1
+ add r10,r10,r8,lsl #16
+ add r9,r9,r10
+ mov r0,R9
+ subs r0,r0,r2
+LBa5: ldmfd r13!,{r1}
+ ldmfd r13!,{r2}
+ b CheckBof
+LBa3: eors r0,r0,r0
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b LBa5
+LookForward:
+
+ stmfd r13!,{r2}
+ mov r2,#0x9f
+ mov r8,#0x86
+ add r2,r2,r8,lsl #8
+ mov r8,#0x1
+ add r2,r2,r8,lsl #16
+
+ ldr r12,= NEWLINE
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r7,#+1
+ and r11,r0,#0xFF
+@reploop:
+ ldrb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ cmpne r12,r11
+ subne pc,pc,#24 @rep scasb
+ mov r0,#0x9e
+ mov r8,#0x86
+ add r0,r0,r8,lsl #8
+ mov r8,#0x1
+ add r0,r0,r8,lsl #16
+
+ subs r0,r0,r2
+ ldmfd r13!,{r2}
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+CheckEof:
+ cmp r4,r6
+ bne CheckEnd
+ b CheckENum
+CheckBof:
+ A_DR r11,sot-1
+ cmp r4,r11
+ bhi CheckEnd
+CheckENum:
+ A_DR r12,numeriere
+ mov r11,#0x1
+ strB r11,[r12]
+CheckEnd:
+ RET
+LookPgBegin:
+ A_DR r12,kurspos2
+ ldr r3,[r12]
+ mov r2,r3,lsl #16
+ mov r2,r2,lsr #24
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b LookPU2
+LookPgEnd:
+ A_DR r12,kurspos2
+ ldr r3,[r12]
+ A_DR r12,lines
+ ldr r2,[r12]
+ mov r12,r3,lsr #8
+ and r12,r12,#0xFF
+ mov r11,r2,lsl #24
+ mov r11,r11,lsr #24
+ subs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r2,r2,#0xFF
+ orr r2,r2,r11
+ b LookPD2
+LookLineUp:
+ mov r12,#0x2
+ stmfd r13!,{r12}
+ ldmfd r13!,{r2}
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ A_DR r12,linenr
+ mov r11,#0x1
+ ldr r10,[r12]
+ subs r10,r10,r11
+ str r10,[r12]
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b LookPU2
+LookLineDown:
+ mov r12,#0x2
+ stmfd r13!,{r12}
+ ldmfd r13!,{r2}
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ A_DR r12,linenr
+ mov r11,#0x1
+ ldr r10,[r12]
+ adds r10,r10,r11
+ str r10,[r12]
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b LookPD2
+LookPageUp:
+ A_DR r12,lines
+ ldr r2,[r12]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+LookPU1:
+ A_DR r12,linenr
+ ldr r10,[r12]
+ subs r10,r10,r2
+ str r10,[r12]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+LookPU2:
+ CALL LookBackward
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ blo LookPUEnd
+ subs r2,r2,#1
+ bne LookPU2
+LookPUEnd:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ RET
+LookScrDn:
+ eors r2,r2,r2
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b LookPD1
+LookScrUp:
+ eors r2,r2,r2
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b LookPU1
+LookHalfPgUp:
+ A_DR r12,lines
+ ldr r2,[r12]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mov r2,r2,lsr #1
+ b LookPU1
+LookHalfPgDn:
+ A_DR r12,lines
+ ldr r2,[r12]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mov r2,r2,lsr #1
+ b LookPD1
+LookPgDown:
+ A_DR r12,lines
+ ldr r2,[r12]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+LookPD1:
+ A_DR r12,linenr
+ ldr r10,[r12]
+ adds r10,r10,r2
+ str r10,[r12]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+LookPD2:
+ CALL LookForward
+ beq LookPDEnd
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ subs r2,r2,#1
+ bne LookPD2
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+LookPDEnd:
+ subs r4,r4,r0
+ RET
+CheckBlock:
+ A_DR r12,showblock
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ blo CheckBlockEnd
+ A_DR r12,blockende
+ ldr r5,[r12]
+ A_DR r11,sot
+ cmp r5,r11
+ blo CheckBlockEnd
+ A_DR r12,blockbegin
+ ldr r5,[r12]
+ A_DR r11,sot
+ cmp r5,r11
+ blo CheckBlockEnd
+ A_DR r12,blockende
+ ldr r10,[r12]
+ cmp r10,r5
+CheckBlockEnd:
+ RET
+CheckImBlock:
+ A_DR r12,blockbegin
+ ldr r10,[r12]
+ cmp r10,r4
+ bhi CImBlockEnd
+ A_DR r12,blockende
+ ldr r10,[r12]
+ cmp r4,r10
+CImBlockEnd:
+ RET
+CheckMode:
+ ldr r11,= NEWLINE
+ ldrB r10,[r4]
+ cmp r10,r11
+ beq ChModeEnd
+ A_DR r12,insstat
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ChModeEnd:
+ RET
+CheckMarker:
+
+ cmp r4,r3
+ bhi CMEnd
+ cmp r1,r3
+ blo CMEnd
+ mov r3,r4
+CMEnd: RET
+CountToLineEnd:
+ stmfd r13!,{r4}
+ CALL LookForward
+ ldmfd r13!,{r4}
+ RET
+CountColToLineBeginVis:
+
+ CALL CountToLineBegin
+ stmfd r13!,{r5}
+ eors r3,r3,r3
+ mov r5,r4
+ subs r5,r5,r0
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+CCV1: mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ cmp r5,r4
+ bhs CCVend
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+ ldrB r12,[r5]
+ bic r1,r1,#0xFF
+ orr r1,r1,r12
+ mov r12,#0xc0
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r1,r1,#0xFF
+ orr r1,r1,r11
+ mov r12,#0x80
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq CCV1
+noUTF_P:
+
+.endif
+ ldr r11,= TABCHAR
+ ldrB r10,[r5]
+ cmp r10,r11
+ beq CCVTab
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ b CCV1
+CCVTab: CALL SpacesForTab
+ mov r12,r0,lsr #8
+ and r12,r12,#0xFF
+ mov r11,r3,lsl #24
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r3,r3,#0xFF
+ orr r3,r3,r11
+ b CCV1
+CCVend: A_DR r12,ch2linebeg
+ str r3,[r12]
+ mov r0,r3
+ ldmfd r13!,{r5}
+.ifdef W32LF
+.endif
+ RET
+CountToLineBegin:
+ stmfd r13!,{r4}
+ CALL LookBackward
+ mov r5,r4
+ ldmfd r13!,{r4}
+ RET
+CountToWordBeginVIstyle:
+
+ mov r5,r4
+ ldr r11,= SPACECHAR
+ ldrB r10,[r5]
+ cmp r10,r11
+ bhi CtWviStyle
+CountToWordBegin:
+
+ mov r5,r4
+CountNLoop:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef W32LF
+.else
+ ldr r11,= NEWLINE
+ ldrB r10,[r5]
+ cmp r10,r11
+.endif
+ beq CTWend
+ ldr r11,= SPACECHAR
+ ldrB r10,[r5]
+ cmp r10,r11
+ bls CountNLoop
+ mov r9,r5
+ mov r10,#0x1
+ sub r9,r9,r10
+ mov r11,#0x2f
+ ldrB r10,[R9]
+ cmp r10,r11
+ bhi CountNLoop
+CTWend: mov r0,r5
+ subs r0,r0,r4
+Goret: RET
+CtWviStyle:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef W32LF
+.else
+ ldr r11,= NEWLINE
+ ldrB r10,[r5]
+ cmp r10,r11
+.endif
+ beq CTWend
+ mov r11,#0x2f
+ ldrB r10,[r5]
+ cmp r10,r11
+ bhi CtWviStyle
+ b CountNLoop
+KeyHelp:
+
+.ifdef USE_BUILTINHELP
+ A_DR r12,kurspos
+ ldr r12,[r12]
+ stmfd r13!,{r12}
+ PUSH_ALL @(is a macro)
+ eors r0,r0,r0
+ A_DR r12,showblock
+ ldr r10,[r12]
+ str r0,[r12]
+ mov r0,r10
+ stmfd r13!,{r0}
+ mov r7,#+1
+ A_DR r5,sot
+ A_DR r4,buffercopy
+ ldr r2,= buffercopysize
+
+ stmfd r13!,{r4}
+ stmfd r13!,{r2}
+ stmfd r13!,{r5}
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ CALL GetHelpText
+ ldmfd r13!,{r4}
+ stmfd r13!,{r4}
+ stmfd r13!,{r4}
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ A_DR r5,helpfoot
+ ldr r12,= helpfootsize
+ stmfd r13!,{r12}
+ ldmfd r13!,{r2}
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ mov r6,r4
+ ldmfd r13!,{r4}
+ CALL DispNewScreen
+ CALL ReadOneChar
+ ldmfd r13!,{r4}
+ ldmfd r13!,{r2}
+ ldmfd r13!,{r5}
+ mov r7,#+1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ ldmfd r13!,{r12}
+ A_DR r11,showblock
+ str r12,[r11]
+ POP_ALL @(is a macro)
+ ldmfd r13!,{r3}
+ b SetKursPos
+.else
+.endif
+GoUp: eors r0,r0,r0
+ b UpDown
+GoDown: A_DR r10,lines
+ ldrB r12,[r10]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mov r12,#0xff
+ bic r0,r0,#0xFF00
+ orr r0,r0,r12,lsl #8
+UpDown: A_DR r12,kurspos2
+ ldr r3,[r12]
+ mov r12,r3,lsr #8
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq Goret
+ mov r12,r0,lsr #8
+ and r12,r12,#0xFF
+ mov r11,r3,lsl #16
+ mov r11,r11,lsr #24
+ sbcs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r3,r3,#0xFF00
+ orr r3,r3,r11,lsl #8
+ b SetKursPos
+KeyVICmdz:
+ CALL ReadOneChar
+ mov r12,#0x2e
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KeyEmaCtrlL
+ RET
+KeyVI_M:
+ CALL LookPgBegin
+ CALL LookHalfPgDn
+ A_DR r12,lines
+ mov r11,#0x1
+ ldrB r10,[r12]
+ tst r10,r11
+ bne KeyEmaCtrlL
+ CALL LookLineDown
+KeyEmaCtrlL:
+ CALL CountToLineBegin
+ A_DR r10,lines
+ ldrB r12,[r10]
+ bic r3,r3,#0xFF00
+ orr r3,r3,r12,lsl #8
+ mov r12,r3
+ and r12,r12,#0xFF
+ mov r12,r12,lsr #1
+ and r12,r12,#0xFF
+ bic r3,r3,#0xFF00
+ orr r3,r3,r12,lsl #8
+ mov r12,r0
+ and r12,r12,#0xFF
+ bic r3,r3,#0xFF
+ orr r3,r3,r12
+ b SetKursPos
+KursorFirstLine:
+ eors r3,r3,r3
+ b SetKursPos
+KursorLastLine:
+ A_DR r10,lines
+ ldrB r12,[r10]
+ bic r3,r3,#0xFF00
+ orr r3,r3,r12,lsl #8
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r12,#0x1
+ mov r11,r3,lsl #16
+ mov r11,r11,lsr #24
+ subs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r3,r3,#0xFF00
+ orr r3,r3,r11,lsl #8
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mov r12,#0x0
+ bic r3,r3,#0xFF
+ orr r3,r3,r12
+ b SetKursPos
+KursorStatusLine:
+ A_DR r10,lines
+ ldrB r12,[r10]
+ bic r3,r3,#0xFF00
+ orr r3,r3,r12,lsl #8
+ ldr r12,= stdtxtlen
+ bic r3,r3,#0xFF
+ orr r3,r3,r12
+ b SetKursPos
+RestKursPos:
+ A_DR r12,kurspos
+ ldr r3,[r12]
+SetKursPos:
+ A_DR r12,kurspos2
+ str r3,[r12]
+sys_writeKP:
+ PUSH_ALL @(is a macro)
+.ifdef W32
+.else
+ CALL make_KPstr
+ A_DR r2,setkp
+ ldr r12,= setkplen
+ stmfd r13!,{r12}
+ ldmfd r13!,{r3}
+ CALL WriteFile0
+.endif
+ POP_ALL @(is a macro)
+ RET
+.ifndef W32
+make_KPstr:
+ mov r7,#+1
+ A_DR r4,setkp
+ mov r12,#0x1b
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+.ifndef ARMCPU
+.else
+ mov r12,#0x5b
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+ mov r12,#0x30
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+ strb r0,[r4]
+ add r4,r4,r7
+ strb r0,[r4]
+ add r4,r4,r7
+ mov r12,#0x3b
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+ mov r12,#0x30
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+ strb r0,[r4]
+ add r4,r4,r7
+ strb r0,[r4]
+ add r4,r4,r7
+.endif
+ mov r12,#0x48
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+ mov r9,r4
+ mov r10,#0x6
+ sub r9,r9,r10
+ mov r4,R9
+ mov r0,r3,lsl #16
+ mov r0,r0,lsr #24
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ stmfd r13!,{r3}
+ CALL IntegerToAscii
+ ldmfd r13!,{r3}
+ A_DR r4,setkp+1+3+4
+ mov r0,r3,lsl #24
+ mov r0,r0,lsr #24
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.endif
+IntegerToAscii:
+
+ orrs r0,r0,r0
+ bpl ItoA1
+ eors r0,r0,r0
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ItoA1: mov r12,#0xa
+ stmfd r13!,{r12}
+ ldmfd r13!,{r2}
+ mov r7,#-1
+ mov r12,r1
+ mov r1,r0
+ mov r0,r12
+Connum1:
+ mov r12,r1
+ mov r1,r0
+ mov r0,r12
+ orrs r0,r0,r0
+ movpl r3,#0
+ submi r3,r0,#1
+ mov r9,r0
+ mov r10,r2
+ stmfd r13!,{r14}
+ bl _DIV
+ ldmfd r13!,{r14}
+ mov r3,r9
+ mov r0,r12
+
+ mov r12,r1
+ mov r1,r0
+ mov r0,r12
+ mov r12,r3
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0xf
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x30
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ strb r0,[r4]
+ add r4,r4,r7
+ orrs r1,r1,r1
+ bne Connum1
+ mov r7,#+1
+ITAret: RET
+DeleteByteCheckMarker:
+
+ A_DR r12,mode
+ mov r11,#0x9
+ ldrB r10,[r12]
+ tst r10,r11
+ beq DeleteByte
+ mov r9,r4
+ add r9,r9,r0
+ mov r1,R9
+ A_DR r12,blockbegin
+ ldr r3,[r12]
+ CALL CheckMarker
+ A_DR r12,blockbegin
+ str r3,[r12]
+ A_DR r12,blockende
+ ldr r3,[r12]
+ CALL CheckMarker
+ A_DR r12,blockende
+ str r3,[r12]
+DeleteByte:
+ orrs r0,r0,r0
+ beq ITAret
+.ifdef USE_UNDO
+.endif
+ stmfd r13!,{r4}
+ mov r2,r6
+ subs r2,r2,r4
+ mov r9,r4
+ add r9,r9,r0
+ mov r5,R9
+ subs r2,r2,r0
+ A_DR r12,mode
+ ldr r11,= WS
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq No_WS8
+ A_DR r12,EmaKiSize
+ ldr r10,[r12]
+ adds r2,r2,r10
+No_WS8: mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r2,r2,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mov r7,#+1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ rsbs r0,r0,#0
+ b Ins0
+Insert1Byte:
+ eors r0,r0,r0
+InsertByte0:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+InsertByte:
+ orrs r0,r0,r0
+ beq ITAret
+ A_DR r12,maxlen
+ ldr r2,[r12]
+ A_DR r11,sot
+ adds r2,r2,r11
+
+ subs r2,r2,r6
+ A_DR r12,EmaKiSize
+ ldr r3,[r12]
+ subs r2,r2,r3
+ cmp r2,r0
+ bhs SpaceAva
+ ldr r12,= ERRNOMEM
+ stmfd r13!,{r12}
+ ldmfd r13!,{r12}
+ A_DR r11,ErrNr
+ str r12,[r11]
+ CALL OSerror
+ CALL RestKursPos
+ mrs r12, CPSR
+ and r12,r12,#0xDFFFFFFF
+ msr CPSR_f,r12
+ RET
+SpaceAva:
+ stmfd r13!,{r4}
+.ifdef USE_UNDO
+.endif
+ mov r5,r6
+ mov r9,r6
+ mov r10,#0x1
+ add r9,r9,r10
+ mov r2,R9
+ subs r2,r2,r4
+ mov r9,r6
+ add r9,r9,r0
+ mov r4,R9
+ A_DR r12,mode
+ ldr r11,= WS
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq ISWS8
+ adds r2,r2,r3
+ adds r4,r4,r3
+ adds r5,r5,r3
+ISWS8: mov r7,#-1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+Ins0: ldmfd r13!,{r4}
+ CALL SetChg
+ adds r6,r6,r0
+ A_DR r12,mode
+ mov r11,#0x9
+ ldrB r10,[r12]
+ tst r10,r11
+ beq NOWS8
+ A_DR r12,blockende
+ ldr r10,[r12]
+ cmp r4,r10
+ bhs Ins1
+ A_DR r12,blockende
+ ldr r10,[r12]
+ adds r10,r10,r0
+ str r10,[r12]
+Ins1: A_DR r12,blockbegin
+ ldr r10,[r12]
+ cmp r4,r10
+ bhs Ins2
+ A_DR r12,blockbegin
+ ldr r10,[r12]
+ adds r10,r10,r0
+ str r10,[r12]
+NOWS8:
+ A_DR r12,mode
+ mov r11,#0x6
+ ldrB r10,[r12]
+ tst r10,r11
+ beq NO_EM02
+ A_DR r12,EmaMark
+ ldr r10,[r12]
+ cmp r4,r10
+ bhs Ins2
+ A_DR r12,EmaMark
+ ldr r10,[r12]
+ adds r10,r10,r0
+ str r10,[r12]
+NO_EM02:
+
+Ins2: mrs r12, CPSR
+ orr r12,r12,#0x20000000
+ msr CPSR_f,r12
+ RET
+CopyBlock:
+ CALL CheckBlock
+ blo MoveBlEnd
+ CALL CheckImBlock
+ blo MoveBlEnd
+ A_DR r12,blockende
+ ldr r0,[r12]
+ subs r0,r0,r5
+ CALL InsertByte
+ blo MoveBlEnd
+ A_DR r12,blockbegin
+ ldr r5,[r12]
+MoveBlock:
+ stmfd r13!,{r4}
+ mov r2,r0
+ mov r7,#+1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ ldmfd r13!,{r4}
+ mrs r12, CPSR
+ orr r12,r12,#0x20000000
+ msr CPSR_f,r12
+MoveBlEnd:
+ RET
+KeyVICmdyy:
+ stmfd r13!,{r4}
+ CALL KeyHome
+ A_DR r12,EmaMark
+ str r4,[r12]
+ CALL KeyEnd
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ CALL KeyEmaAltW
+ ldmfd r13!,{r4}
+KviRet: RET
+KeyVICmdy:
+ CALL ReadOneChar
+ mov r12,#0x79
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq KeyVICmdyy
+ mov r12,#0x27
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne MoveBlEnd
+ CALL ReadOneChar
+ mov r12,#0x61
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne MoveBlEnd
+ A_DR r12,blockbegin
+ ldr r2,[r12]
+ cmp r2,#0
+ beq MoveBlEnd
+ CALL VIsetMarker
+ CALL KeyEmaAltW
+ A_DR r12,blockbegin
+ ldr r4,[r12]
+.ifdef W32
+.else
+ b ISVI9
+.endif
+KeyEmaCtrlY:
+
+.ifdef W32
+.endif
+ A_DR r12,EmaKiSize
+ ldr r2,[r12]
+.ifdef YASM
+.else
+ cmp r2,#0
+ beq KeawRet
+.endif
+ mov r12,r2
+ mov r2,r0
+ mov r0,r12
+ stmfd r13!,{r0}
+ CALL InsertByte
+ ldmfd r13!,{r2}
+ blo KeawRet
+ mov r5,r6
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r5,r5,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ A_DR r12,EmaMark
+ str r4,[r12]
+ mov r7,#+1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ CALL ShowBl0
+ CALL IsViMode
+ beq ISVI9
+ CALL KeyEmaCtrlL
+ISVI9: b CQFNum
+KeyEmaAltW2:
+ PUSH_ALL @(is a macro)
+ mov r4,r6
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ CALL IsViMode
+ beq KEW
+ A_DR r12,EmaCtrlK
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne KEW
+ A_DR r12,EmaKiSize
+ ldr r10,[r12]
+ adds r4,r4,r10
+ A_DR r12,EmaKiSize
+ ldr r10,[r12]
+ adds r10,r10,r0
+ str r10,[r12]
+ b KE2
+KEW: A_DR r12,EmaKiSize
+ str r0,[r12]
+ A_DR r12,EmaKiSrc
+ str r5,[r12]
+KE2: mov r2,r0
+ mov r7,#+1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ CALL ShowBl0
+Keaw2: A_DR r12,EmaCtrlK
+ mov r11,#0x1
+ strB r11,[r12]
+ POP_ALL @(is a macro)
+KeawRet:
+ RET
+KeyEmaAltW:
+ A_DR r12,VInolinebased
+ mov r11,#0x0
+ strB r11,[r12]
+ PUSH_ALL @(is a macro)
+ A_DR r12,showblock
+ ldr r2,[r12]
+ cmp r2,#0
+ beq Keaw2
+ A_DR r12,EmaMark
+ ldr r2,[r12]
+ cmp r2,#0
+ beq Keaw2
+ mov r0,r4
+ cmp r2,r0
+ blo KEAW
+ mov r12,r2
+ mov r2,r0
+ mov r0,r12
+KEAW: subs r0,r0,r2
+ mov r5,r2
+ mov r4,r6
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ A_DR r12,EmaKiSize
+ str r0,[r12]
+ A_DR r12,EmaKiSrc
+ str r5,[r12]
+ mov r12,r2
+ mov r2,r0
+ mov r0,r12
+ mov r7,#+1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ CALL IsViMode
+ beq KEAW3
+ CALL ShowBl0
+KEAW3:
+.ifdef W32
+.endif
+ POP_ALL @(is a macro)
+KeaWRet:
+ RET
+NFnoarg:
+ A_DR r5,helptext
+ A_DR r4,sot
+ ldr r12,= helptextsize
+ stmfd r13!,{r12}
+ ldmfd r13!,{r2}
+ stmfd r13!,{r4}
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ CALL GetHelpText
+ mov r9,r2
+ A_DR r10,sot
+ add r9,r9,r10
+ ldr r10,= helptextsize
+ add r9,r9,r10
+ mov r6,R9
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+ ldmfd r13!,{r4}
+ CALL DispNewScreen
+ A_DR r5,filename
+ A_DR r2,filepath
+ CALL InputString0
+ bhs GetFile
+ RET
+KeyVICmdE:
+ mov r9,r2
+ mov r10,#0x2
+ add r9,r9,r10
+ mov r5,R9
+ ldr r11,= SPACECHAR
+ ldrB r10,[r5]
+ cmp r10,r11
+ beq KeaWRet
+ PUSH_ALL @(is a macro)
+ CALL SaveFile
+ POP_ALL @(is a macro)
+NewFile:
+ mov r7,#+1
+ CALL InitVars
+.ifdef AMD64
+.else
+ orrs r5,r5,r5
+.endif
+ beq NFnoarg
+ A_DR r4,filepath
+NF1:
+.ifdef W32
+.else
+ ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+.endif
+NF2: mov r12,r0
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ orrs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ bne NF1
+GetFile:
+
+.ifdef BEOS
+.else
+ A_DR r1,filepath
+.endif
+ CALL OpenFile0
+ A_DR r4,sot
+ mov r6,r4
+ bmi NewFileEnd
+.ifdef SYS_brk
+ CALL Seek
+ PUSH_ALL @(is a macro)
+ mov r9,r0
+ add r9,r9,r0
+ mov r10,#0x0
+ mov r8,#0x90
+ add r10,r10,r8,lsl #8
+ mov r8,#0x1
+ add r10,r10,r8,lsl #16
+ add r9,r9,r10
+ mov r1,R9
+ A_DR r12,maxlen
+ str r1,[r12]
+ A_DR r11,text
+ adds r1,r1,r11
+
+ CALL SysBrk
+ POP_ALL @(is a macro)
+ bmi OSejmp1
+.else
+.endif
+.ifdef SYS_fstat
+ CALL Fstat
+ bmi OSejmp1
+ A_DR r12,fstatbuf+stat_struc.st_mode
+ ldr r0,[r12]
+.ifdef FREEBSD
+.endif
+ mov r11,#0xff
+ mov r8,#0x1
+ add r11,r11,r8,lsl #8
+ ands r0,r0,r11
+ A_DR r12,perms
+ str r0,[r12]
+.ifdef SYS_utime
+ A_DR r12,fstatbuf+stat_struc.st_mtime
+ ldr r0,[r12]
+ A_DR r12,accesstime+utimbuf_struc.modtime
+ str r0,[r12]
+.endif
+.endif
+OldFile1:
+ A_DR r12,maxlen
+ ldr r3,[r12]
+ mov r2,r4
+ CALL Read_File
+ mov r12,r0
+ mov r0,r3
+ mov r3,r12
+ bmi OSejmp0
+ CALL CloseFile
+OSejmp1:
+ bmi OSejmp0
+ mov r9,r3
+ A_DR r10,sot
+ add r9,r9,r10
+ mov r6,R9
+NewFileEnd:
+ ldr r11,= NEWLINE
+ strB r11,[r6]
+ mrs r12, CPSR
+ orr r12,r12,#0x20000000
+ msr CPSR_f,r12
+NFEnd2: RET
+SaveFile:
+ A_DR r12,changed
+ ldr r11,= UNCHANGED
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq NFEnd2
+ A_DR r5,filesave
+ CALL WriteMess9
+ A_DR r5,filepath
+ stmfd r13!,{r4}
+ A_DR r4,bakpath
+ mov r1,r5
+ mov r2,r4
+ mov r7,#+1
+SF0: ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+ mov r12,r0
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ orrs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ bne SF0
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mov r12,#0x7e
+ stmfd r13!,{r12}
+ ldmfd r13!,{r0}
+.ifdef ARMCPU
+ strb r0,[r4]
+ add r4,r4,r7
+ mov r0,r0,lsr #8
+ strb r0,[r4]
+ add r4,r4,r7
+ mov r0,r0,lsr #8
+ strb r0,[r4]
+ add r4,r4,r7
+ mov r0,r0,lsr #8
+ strb r0,[r4]
+ add r4,r4,r7
+.else
+.endif
+ ldmfd r13!,{r4}
+.ifdef BEOS
+.endif
+.ifdef MAKE_BACKUP
+ mov r11,#0x2f
+ mov r8,#0x74
+ add r11,r11,r8,lsl #8
+ mov r8,#0x6d
+ add r11,r11,r8,lsl #16
+ mov r8,#0x70
+ add r11,r11,r8,lsl #24
+ ldr r10,[r2]
+ cmp r10,r11
+ beq no_ren
+.ifdef SYS_readlink
+ PUSH_ALL @(is a macro)
+ A_DR r2,linkbuffer
+ ldr r12,= linkbuffersize
+ stmfd r13!,{r12}
+ ldmfd r13!,{r3}
+ CALL ReadLink
+ POP_ALL @(is a macro)
+ bpl CopyBAK
+ CALL RenameFile
+ b no_ren
+CopyBAK:
+ CALL CopyToBackup
+.else
+.endif
+no_ren:
+.endif
+.ifdef BEOS
+.endif
+.ifdef W32
+.else
+.ifdef BEOS
+.else
+ ldr r2,= O_WRONLY_CREAT_TRUNC
+
+ A_DR r12,perms
+ ldr r3,[r12]
+.endif
+.endif
+ CALL OpenFile
+OSejmp0:
+ bmi OSejmp9
+ mov r12,r0
+ mov r0,r1
+ mov r1,r12
+.ifdef SYS_fchown
+ A_DR r12,perms
+ ldr r2,[r12]
+ CALL Fchmod
+.endif
+.ifdef SYS_fstat
+ A_DR r12,fstatbuf+stat_struc.st_uid
+ ldr r2,[r12]
+.ifdef UIDGID_WORD
+ mov r3,r2
+ mov r3,r3,lsr #16
+ mov r2,r2,lsl #16
+ mov r2,r2,lsr #16
+.else
+.endif
+ CALL ChownFile
+.endif
+ A_DR r2,sot
+ mov r3,r6
+SaveFile2:
+ subs r3,r3,r2
+ CALL IsViMode
+ bne NoAddNL
+ mov r9,r6
+ mov r10,#0x1
+ sub r9,r9,r10
+ ldr r11,= NEWLINE
+ ldrB r10,[R9]
+ cmp r10,r11
+ beq NoAddNL
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+NoAddNL:
+ CALL Write_File
+OSejmp9:
+ bmi OSejmp
+ ldr r12,= ERRNOIO
+ stmfd r13!,{r12}
+ ldmfd r13!,{r12}
+ A_DR r11,ErrNr
+ str r12,[r11]
+ cmp r0,r3
+.ifdef BEOS
+.else
+ bne OSerror
+.endif
+ CALL CloseFile
+ bmi OSejmp
+SaveFile3:
+ RET
+SaveBlock:
+ CALL GetBlockName
+ blo jcDE2
+SaveBl2:
+
+.ifdef W32
+.else
+.ifdef BEOS
+.else
+ A_DR r1,blockpath
+SaveBl3:
+ ldr r2,= O_WRONLY_CREAT_TRUNC
+
+ ldr r3,= PERMS
+
+.endif
+.endif
+ CALL OpenFile
+ bmi OSejmp
+ mov r2,r5
+ A_DR r12,blockende
+ ldr r3,[r12]
+ mov r12,r0
+ mov r0,r1
+ mov r1,r12
+ b SaveFile2
+ReadBlock:
+ CALL GetBlockName
+jcDE2: blo DE2
+ReadBlock2:
+
+.ifdef BEOS
+.else
+ A_DR r1,blockpath
+.endif
+ CALL OpenFile0
+OSejmp: bmi OSerror
+ CALL Seek
+ bmi OSerror
+ stmfd r13!,{r0}
+ CALL InsertByte
+ ldmfd r13!,{r3}
+ blo SaveFile3
+ mov r2,r4
+ CALL Read_File
+ bmi preOSerror
+ mov r2,r0
+ CALL CloseFile
+ bmi OSerror
+ ldr r12,= ERRNOIO
+ stmfd r13!,{r12}
+ ldmfd r13!,{r12}
+ A_DR r11,ErrNr
+ str r12,[r11]
+ cmp r3,r2
+ bne OSerror
+ RET
+preOSerror:
+ mov r0,r3
+ CALL DeleteByte
+OSerror:
+ stmfd r13!,{r4}
+ A_DR r4,error+8
+ A_DR r12,ErrNr
+ ldr r0,[r12]
+ stmfd r13!,{r0}
+ CALL IntegerToAscii
+ ldmfd r13!,{r2}
+ ldr r11,= MAXERRNO
+ cmp r2,r11
+ bhi DE0
+ A_DR r4,errmsgs
+ CALL LookPD2
+ mov r5,r4
+ A_DR r4,error+9
+ mov r12,#0x20
+ mov r8,#0x3a
+ add r12,r12,r8,lsl #8
+ mov r0,r0,lsr #16
+ mov r0,r0,lsl #16
+ orr r0,r0,r12
+.ifdef ARMCPU
+ strb r0,[r4]
+ add r4,r4,r7
+.else
+.endif
+ mov r12,#0x50
+ stmfd r13!,{r12}
+ ldmfd r13!,{r2}
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+DE0: A_DR r5,error
+ ldmfd r13!,{r4}
+DE1: CALL WriteMess9
+ CALL ReadOneChar
+DE2:
+RestoreStatusLine:
+ PUSH_ALL @(is a macro)
+ CALL InitStatusLine
+ A_DR r5,mode
+ A_DR r12,columns
+ ldr r2,[r12]
+ mov r12,#0x20
+ mov r11,r2,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+.ifdef ARMCPU
+ mov r11,#0xfc
+ mov r8,#0xff
+ add r11,r11,r8,lsl #8
+ mov r8,#0xff
+ add r11,r11,r8,lsl #16
+ mov r8,#0xff
+ add r11,r11,r8,lsl #24
+ ands r2,r2,r11
+.endif
+ blo RSno_lineNr
+ A_DR r10,changed
+ ldrB r12,[r10]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ A_DR r12,screenline+1
+ strB r0,[r12]
+.ifndef LINUX
+.else
+ mov r9,r2
+ mov r10,#0xc
+ sub r9,r9,r10
+ A_DR r10,screenline
+ add r9,r9,r10
+ mov r0,R9
+.endif
+ mov r9,r0
+ mov r10,#0x8
+ add r9,r9,r10
+ mov r11,#0x76
+ mov r8,#0x69
+ add r11,r11,r8,lsl #8
+ strH r11,[R9]
+ ldr r11,= VI
+ ldrB r10,[r5]
+ cmp r10,r11
+ bne RSL0
+ A_DR r12,VICmdMode
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne NOVI0
+ mov r1,#0x43
+ mov r8,#0x4d
+ add r1,r1,r8,lsl #8
+ mov r8,#0x44
+ add r1,r1,r8,lsl #16
+ mov r8,#0x20
+ add r1,r1,r8,lsl #24
+
+ b RSL1
+RSL0: mov r11,#0x61
+ mov r8,#0x6c
+ add r11,r11,r8,lsl #8
+ mov r8,#0x74
+ add r11,r11,r8,lsl #16
+ mov r8,#0x48
+ add r11,r11,r8,lsl #24
+ str r11,[r0]
+ mov r9,r0
+ mov r10,#0x4
+ add r9,r9,r10
+ mov r11,#0x3d
+ mov r8,#0x68
+ add r11,r11,r8,lsl #8
+ mov r8,#0x65
+ add r11,r11,r8,lsl #16
+ mov r8,#0x6c
+ add r11,r11,r8,lsl #24
+ str r11,[R9]
+ A_DR r1,editmode
+ ldr r3,[r1]
+ ldr r11,= PI
+ ldrB r10,[r5]
+ cmp r10,r11
+ bne No_PI1
+ mov r9,r1
+ mov r10,#0x4
+ add r9,r9,r10
+ ldr r3,[R9]
+No_PI1: ldr r11,= EM
+ ldrB r10,[r5]
+ cmp r10,r11
+ bne No_Em1
+ mov r9,r1
+ mov r10,#0x8
+ add r9,r9,r10
+ ldr r3,[R9]
+No_Em1: ldr r11,= NE
+ ldrB r10,[r5]
+ cmp r10,r11
+ bne No_Ne1
+ mov r9,r1
+ mov r10,#0xc
+ add r9,r9,r10
+ ldr r3,[R9]
+No_Ne1: mov r9,r0
+ mov r10,#0x8
+ add r9,r9,r10
+ str r3,[R9]
+NOVI0: mov r1,#0x49
+ mov r8,#0x4e
+ add r1,r1,r8,lsl #8
+ mov r8,#0x53
+ add r1,r1,r8,lsl #16
+ mov r8,#0x20
+ add r1,r1,r8,lsl #24
+
+ A_DR r12,insstat
+ mov r11,#0x1
+ ldrB r10,[r12]
+ cmp r10,r11
+ beq RSL1
+ mov r1,#0x4f
+ mov r8,#0x56
+ add r1,r1,r8,lsl #8
+ mov r8,#0x52
+ add r1,r1,r8,lsl #16
+ mov r8,#0x20
+ add r1,r1,r8,lsl #24
+
+RSL1: A_DR r12,screenline+4
+ str r1,[r12]
+ A_DR r4,screenline+stdtxtlen
+ mov r9,r2
+ mov r10,#0x1e
+ sub r9,r9,r10
+ mov r2,R9
+ A_DR r5,filepath
+RSL2: ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,r0
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ orrs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ beq RSL4
+ strb r0,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ bne RSL2
+RSL4: A_DR r4,screenline-15
+ A_DR r12,columns
+ ldr r10,[r12]
+ adds r4,r4,r10
+ A_DR r12,columne
+ ldr r0,[r12]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ CALL IntegerToAscii
+ mov r11,#0x3a
+ strB r11,[r4]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ A_DR r12,linenr
+ ldr r0,[r12]
+ CALL IntegerToAscii
+RSno_lineNr:
+ CALL StatusLineShow
+ POP_ALL @(is a macro)
+ mrs r12, CPSR
+ and r12,r12,#0xDFFFFFFF
+ msr CPSR_f,r12
+ RET
+WriteMess9MakeLine:
+ CALL InitStatusLine
+WriteMess9:
+ PUSH_ALL @(is a macro)
+ A_DR r4,screenline
+ mov r7,#+1
+WriteMLoop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ ldr r12,= LINEFEED
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bls WriteMEnd
+ strb r0,[r4]
+ add r4,r4,r7
+ b WriteMLoop
+WriteMEnd:
+ CALL StatusLineShow
+ POP_ALL @(is a macro)
+ b KursorStatusLine
+InitStatusLine:
+ PUSH_ALL @(is a macro)
+ A_DR r4,screenline
+ ldr r12,= SPACECHAR
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ A_DR r12,columns
+ ldr r2,[r12]
+.ifndef LINUX
+.endif
+ mov r7,#+1
+@reploop:
+ strb r0,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#20 @rep stosb
+ mov r12,#0x0
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ strb r0,[r4]
+ add r4,r4,r7
+ISL: POP_ALL @(is a macro)
+ RET
+GetBlockName:
+ PUSH_ALL @(is a macro)
+ A_DR r5,block
+ A_DR r2,blockpath
+ CALL InputString0
+ mrs r12, CPSR
+ stmfd r13!,{r7,r12}
+ CALL RestKursPos
+ ldmfd r13!,{r7,r12}
+ msr CPSR_f,r12
+ POP_ALL @(is a macro)
+ RET
+InitVars:
+ A_DR r12,text
+ ldr r11,= NEWLINE
+ strB r11,[r12]
+ CALL Unchg
+ CALL InitSomeVars
+ A_DR r12,old
+ A_DR r11,sot
+ str r11,[r12]
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ A_DR r12,VICmdMode
+ strB r0,[r12]
+ A_DR r12,linenr
+ str r0,[r12]
+ A_DR r12,insstat
+ strB r0,[r12]
+ A_DR r12,maxlen
+ ldr r11,= max
+ str r11,[r12]
+ A_DR r12,error
+ mov r11,#0x45
+ mov r8,#0x52
+ add r11,r11,r8,lsl #8
+ mov r8,#0x52
+ add r11,r11,r8,lsl #16
+ mov r8,#0x4f
+ add r11,r11,r8,lsl #24
+ str r11,[r12]
+ A_DR r12,error+4
+ mov r11,#0x52
+ mov r8,#0x20
+ add r11,r11,r8,lsl #8
+ mov r8,#0x20
+ add r11,r11,r8,lsl #16
+ mov r8,#0x20
+ add r11,r11,r8,lsl #24
+ str r11,[r12]
+ A_DR r12,perms
+ ldr r11,= PERMS
+ str r11,[r12]
+.ifdef SYS_fstat
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r0,r0,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef UIDGID_WORD
+ A_DR r12,fstatbuf+stat_struc.st_uid
+ str r0,[r12]
+.else
+.endif
+.endif
+ b ShowBl1
+InitSomeVars:
+
+ eors r0,r0,r0
+.ifdef USE_UNDO
+.endif
+ A_DR r12,EmaMark
+ str r0,[r12]
+ A_DR r12,oldQFpos
+ str r0,[r12]
+ A_DR r12,bereitsges
+ strB r0,[r12]
+ A_DR r12,endeedit
+ strB r0,[r12]
+InitSV1:
+ A_DR r12,EmaKiSize
+ str r0,[r12]
+InitSV2:
+ A_DR r12,blockbegin
+ str r0,[r12]
+InitSV3:
+ A_DR r12,blockende
+ str r0,[r12]
+ RET
+Seek: mov r12,r0
+ mov r0,r1
+ mov r1,r12
+ mov r12,#0x2
+ stmfd r13!,{r12}
+ ldmfd r13!,{r3}
+ CALL SeekFile
+ bmi SeekRet
+ eors r3,r3,r3
+ stmfd r13!,{r0}
+ CALL SeekFile
+ ldmfd r13!,{r0}
+SeekRet:
+ RET
+AskForReplace:
+ A_DR r5,askreplace1
+ CALL InputString00
+ blo AskFor_Ex
+ A_DR r12,suchlaenge
+ str r0,[r12]
+ A_DR r5,askreplace2
+ A_DR r2,replacetext
+ CALL InputString0
+ b GetOptions
+AskForFind:
+ A_DR r5,askfind
+ CALL InputString00
+ blo AskFor_Ex
+GetOptions:
+ A_DR r12,repllaenge
+ str r0,[r12]
+ A_DR r12,mode
+ mov r11,#0x11
+ ldrB r10,[r12]
+ tst r10,r11
+ beq GetOpt2
+ A_DR r5,optiontext
+ CALL InputStringWithMessage
+ CALL ParseOptions
+GetOpt2:
+ mrs r12, CPSR
+ orr r12,r12,#0x20000000
+ msr CPSR_f,r12
+AskFor_Ex:
+ bhs AFE2
+ A_DR r12,bereitsges
+ mov r11,#0x0
+ strB r11,[r12]
+AFE2: mrs r12, CPSR
+ stmfd r13!,{r7,r12}
+ CALL RestKursPos
+ ldmfd r13!,{r7,r12}
+ msr CPSR_f,r12
+ RET
+ParseOptions:
+ stmfd r13!,{r5}
+ mov r7,#+1
+ A_DR r5,optbuffer
+ mov r12,#0x1
+ stmfd r13!,{r12}
+ ldmfd r13!,{r12}
+ A_DR r11,vorwarts
+ str r12,[r11]
+ A_DR r12,grossklein
+ mov r11,#0xdf
+ strB r11,[r12]
+Scan1: ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0x5f
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x43
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne notCopt
+ A_DR r12,grossklein
+ mov r11,#0x20
+ ldrB r10,[r12]
+ eors r10,r10,r11
+ strB r10,[r12]
+notCopt:
+ mov r12,#0x42
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bne notBopt
+ A_DR r12,vorwarts
+ ldr r11,[r12]
+ rsbs r11,r11,#0
+ str r11,[r12]
+notBopt:
+ mov r12,r0
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ orrs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ bne Scan1
+ ldmfd r13!,{r5}
+ RET
+find2: mov r1,r4
+find3: ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,r0
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ orrs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ beq found
+ mov r12,#0x41
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ blo find7
+ mov r12,r2,lsr #8
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+find7: mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ ldrB r12,[r4]
+ bic r2,r2,#0xFF
+ orr r2,r2,r12
+ mov r12,#0x41
+ mov r11,r2,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ blo find10
+ mov r12,r2,lsr #8
+ and r12,r12,#0xFF
+ mov r11,r2,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r2,r2,#0xFF
+ orr r2,r2,r11
+find10: mov r12,r2
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq find3
+ mov r4,r1
+FindText:
+ A_DR r10,grossklein
+ ldrB r12,[r10]
+ bic r2,r2,#0xFF00
+ orr r2,r2,r12,lsl #8
+ A_DR r5,suchtext
+ mov r7,#+1
+ ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0x41
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ blo find1
+ mov r12,r2,lsr #8
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+find1: A_DR r12,vorwarts
+ ldr r10,[r12]
+ adds r4,r4,r10
+ ldrB r12,[r4]
+ bic r2,r2,#0xFF
+ orr r2,r2,r12
+ mov r12,#0x41
+ mov r11,r2,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ blo find6
+ mov r12,r2,lsr #8
+ and r12,r12,#0xFF
+ mov r11,r2,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r2,r2,#0xFF
+ orr r2,r2,r11
+find6: mov r12,r2
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq find2
+ A_DR r12,mode
+ ldr r11,= PI
+ ldrB r10,[r12]
+ cmp r10,r11
+ bne find_WS
+ A_DR r12,PicoSearch
+ ldr r10,[r12]
+ cmp r4,r10
+ beq notfound
+ cmp r4,r6
+ blo find1
+ A_DR r4,sot-1
+ b find1
+find_WS:
+ cmp r4,r6
+ bhi notfound
+find9: A_DR r11,sot
+ cmp r4,r11
+ bhs find1
+notfound:
+ mrs r12, CPSR
+ and r12,r12,#0xDFFFFFFF
+ msr CPSR_f,r12
+ RET
+found: mov r4,r1
+ mrs r12, CPSR
+ orr r12,r12,#0x20000000
+ msr CPSR_f,r12
+ RET
+GetOctalToInteger:
+ mov r12,#0x7
+ stmfd r13!,{r12}
+ b GATI2
+GetAsciiToInteger:
+ mov r12,#0x9
+ stmfd r13!,{r12}
+GATI2: CALL IsViMode
+ beq ISVI8
+ CALL InputStringWithMessage
+ CALL AskFor_Ex
+ISVI8: mov r12,#0x0
+ stmfd r13!,{r12}
+ ldmfd r13!,{r5}
+ ldmfd r13!,{r1}
+ mov r12,r5
+ mov r5,r2
+ mov r2,r12
+ blo AIexit2
+ mov r7,#+1
+AIload: ldrb r12,[r5]
+ add r5,r5,r7
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0x30
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ subs r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ bmi AIexit
+ mov r12,r1
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ bhi AIexit
+ mov r12,#0x7
+ mov r11,r1,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq GATI3
+ mov r9,r2
+ mov r10,#0x4
+ mov r8,r9
+ mul r9,r8,r10
+ add r9,r9,r2
+ mov r2,R9
+ mov r9,r2
+ mov r10,#0x2
+ mov r8,r9
+ mul r9,r8,r10
+ add r9,r9,r0
+ mov r2,R9
+ b AIload
+GATI3: mov r9,r2
+ mov r10,#0x8
+ mov r8,r9
+ mul r9,r8,r10
+ add r9,r9,r0
+ mov r2,R9
+ b AIload
+.ifdef ARMCPU
+AIexit: mov r11,#0x0
+ cmp r2,r11
+.else
+.endif
+AIexit2:
+ RET
+SpacesForTab:
+ stmfd r13!,{r2}
+ mov r0,r3
+ ldr r12,= TAB
+ bic r2,r2,#0xFF
+ orr r2,r2,r12
+ mov r12,r0,lsr #8
+ and r12,r12,#0xFF
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #24
+ eors r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF00
+ orr r0,r0,r11,lsl #8
+ mov r9,r0
+ and r10,r2,#0xFF
+ stmfd r13!,{r14}
+ bl _DIV
+ ldmfd r13!,{r14}
+ and r0,r12,#0xFF
+ and r9,r9,#0xFF
+ orr r0,r0,r9,lsl #8
+
+ mov r12,r0,lsr #8
+ and r12,r12,#0xFF
+ rsbs r12,r12,#0
+ mov r12,r12,asl #24
+ mov r12,r12,asr #24
+ and r12,r12,#0xFF
+ bic r0,r0,#0xFF00
+ orr r0,r0,r12,lsl #8
+ ldr r12,= TAB
+ mov r11,r0,lsl #16
+ mov r11,r11,lsr #24
+ adds r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF00
+ orr r0,r0,r11,lsl #8
+ ldmfd r13!,{r2}
+ RET
+GetHelpText:
+
+ A_DR r5,help_ne
+ ldr r2,= help_ws_size
+
+.ifdef USE_BUILTINHELP
+ A_DR r0,mode
+ ldr r11,= NE
+ ldrB r10,[r0]
+ cmp r10,r11
+ bne NoNe1
+ ldr r2,= help_ne_size
+
+ RET
+NoNe1: subs r5,r5,r2
+ ldr r11,= VI
+ ldrB r10,[r0]
+ cmp r10,r11
+ beq GHT
+ subs r5,r5,r2
+ ldr r11,= EM
+ ldrB r10,[r0]
+ cmp r10,r11
+ beq GHT
+ subs r5,r5,r2
+ ldr r11,= PI
+ ldrB r10,[r0]
+ cmp r10,r11
+ beq GHT
+ subs r5,r5,r2
+.endif
+GHT: RET
+CheckUserAbort:
+ A_DR r5,mode
+ ldr r11,= WS
+ ldrB r10,[r5]
+ cmp r10,r11
+ beq CUAWS
+ ldr r11,= EM
+ ldrB r10,[r5]
+ cmp r10,r11
+ beq CUAEM
+ mov r12,#0x3
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ RET
+CUAWS: mov r12,#0x15
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ RET
+CUAEM: mov r12,#0x7
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ RET
+KeyEditMode:
+
+ A_DR r5,modetxt
+ CALL InputStringWithMessage
+ CALL RestKursPos
+ A_DR r5,optbuffer
+ CALL InitSomeVars
+SetEditMode:
+ A_DR r0,mode
+.ifndef ARMCPU
+.ifdef AMD64
+.else
+.endif
+.else
+ mov r9,r5
+ mov r10,#0x3
+ add r9,r9,r10
+ ldrB r12,[R9]
+ bic r2,r2,#0xFF
+ orr r2,r2,r12
+ mov r2,r2,lsl #8
+ mov r9,r5
+ mov r10,#0x2
+ add r9,r9,r10
+ ldrB r12,[R9]
+ bic r2,r2,#0xFF
+ orr r2,r2,r12
+ mov r2,r2,lsl #8
+ mov r9,r5
+ mov r10,#0x1
+ add r9,r9,r10
+ ldrB r12,[R9]
+ bic r2,r2,#0xFF
+ orr r2,r2,r12
+ mov r2,r2,lsl #8
+ ldrB r12,[r5]
+ bic r2,r2,#0xFF
+ orr r2,r2,r12
+.endif
+.ifdef W32
+.endif
+ mov r11,#0x65
+ mov r8,#0x33
+ add r11,r11,r8,lsl #8
+ mov r8,#0x6e
+ add r11,r11,r8,lsl #16
+ mov r8,#0x65
+ add r11,r11,r8,lsl #24
+ cmp r2,r11
+ bne NoNe
+ ldr r11,= NE
+ strB r11,[r0]
+ RET
+NoNe: mov r11,#0x65
+ mov r8,#0x33
+ add r11,r11,r8,lsl #8
+ mov r8,#0x65
+ add r11,r11,r8,lsl #16
+ mov r8,#0x6d
+ add r11,r11,r8,lsl #24
+ cmp r2,r11
+ bne NoEm
+ ldr r11,= EM
+ strB r11,[r0]
+ RET
+NoEm: mov r11,#0x65
+ mov r8,#0x33
+ add r11,r11,r8,lsl #8
+ mov r8,#0x70
+ add r11,r11,r8,lsl #16
+ mov r8,#0x69
+ add r11,r11,r8,lsl #24
+ cmp r2,r11
+ bne NoPi
+ ldr r11,= PI
+ strB r11,[r0]
+ RET
+NoPi: mov r11,#0x65
+ mov r8,#0x33
+ add r11,r11,r8,lsl #8
+ mov r8,#0x76
+ add r11,r11,r8,lsl #16
+ mov r8,#0x69
+ add r11,r11,r8,lsl #24
+ cmp r2,r11
+ bne NoVi
+ ldr r11,= VI
+ strB r11,[r0]
+ RET
+NoVi: mov r11,#0x65
+ mov r8,#0x33
+ add r11,r11,r8,lsl #8
+ mov r8,#0x77
+ add r11,r11,r8,lsl #16
+ mov r8,#0x73
+ add r11,r11,r8,lsl #24
+ cmp r2,r11
+ bne modeOK
+ ldr r11,= WS
+ strB r11,[r0]
+modeOK: RET
+.ifdef USE_EXT_MOVE
+.endif
+.ifdef SYS_kill
+SigHandler:
+ CALL RestKursPos
+ A_DR r4,screenbuffer
+ ldr r2,= screenbuffer_dwords
+
+ mov r7,#+1
+@reploop:
+ str r0,[r4]
+ add r4,r4,r7, lsl #2
+ subs r2,r2,#1
+ subne pc,pc,#20 @rep stosd
+.endif
+SetTermStruc:
+
+.ifdef W32
+.else
+ ldr r2,= TERMIOS_GET
+
+ CALL IOctlTerminal0
+ mov r5,r3
+ A_DR r4,termios
+ mov r3,r4
+ ldr r12,= termios_struc_size
+ stmfd r13!,{r12}
+ ldmfd r13!,{r2}
+ mov r7,#+1
+ cmps r2,#0
+ addeq pc,pc,#16
+@reploop:
+ ldrb r12,[r5]
+ add r5,r5,r7
+ strb r12,[r4]
+ add r4,r4,r7
+ subs r2,r2,#1
+ subne pc,pc,#28 @rep movsb
+.ifdef LINUX
+ mov r9,r3
+ A_DR r10,termios_struc.c_cc
+ add r9,r9,r10
+ ldr r10,= VMIN
+ add r9,r9,r10
+ mov r11,#0x1
+ strB r11,[R9]
+.endif
+.ifdef ARMCPU
+ mov r9,r3
+ A_DR r10,termios_struc.c_lflag
+ add r9,r9,r10
+ mov r10,#0x0
+ add r9,r9,r10
+ mov r11,#0xf4
+ mov r8,#0xff
+ add r11,r11,r8,lsl #8
+ mov r8,#0xff
+ add r11,r11,r8,lsl #16
+ mov r8,#0xff
+ add r11,r11,r8,lsl #24
+ ldrB r10,[R9]
+ ands r10,r10,r11
+ strB r10,[R9]
+.else
+.endif
+ mov r9,r3
+ A_DR r10,termios_struc.c_iflag
+ add r9,r9,r10
+ mov r10,#0x1
+ add r9,r9,r10
+ mov r11,#0xfa
+ mov r8,#0xff
+ add r11,r11,r8,lsl #8
+ mov r8,#0xff
+ add r11,r11,r8,lsl #16
+ mov r8,#0xff
+ add r11,r11,r8,lsl #24
+ ldrB r10,[R9]
+ ands r10,r10,r11
+ strB r10,[R9]
+ ldr r2,= TERMIOS_SET
+
+ b IOctlTerminal
+.endif
+.ifdef NEW_CURSOR_MGNT
+SetCursorNormal:
+ PUSH_ALL @(is a macro)
+ A_DR r2,normcurs
+ ldr r12,= normcurslen
+ stmfd r13!,{r12}
+ b SCB
+SetCursorBlock:
+ PUSH_ALL @(is a macro)
+ A_DR r2,blockcurs
+ ldr r12,= blockcurslen
+ stmfd r13!,{r12}
+SCB: ldmfd r13!,{r3}
+ CALL WriteFile0
+ POP_ALL @(is a macro)
+ RET
+.endif
+.ifndef W32
+IOctlTerminal0:
+ A_DR r3,termios_orig
+IOctlTerminal:
+ ldr r1,= stdin
+
+.ifdef LIBC
+.else
+ ldr r12,= SYS_ioctl
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+ReadFile0:
+
+.ifdef W32
+.ifdef W32_EXTENDED_IO
+.else
+.endif
+.else
+ eors r1,r1,r1
+.endif
+Read_File:
+
+.ifdef W32
+.else
+.ifdef BEOS
+.else
+.ifdef LIBC
+.else
+ ldr r12,= SYS_read
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+.endif
+WriteFile00:
+ eors r3,r3,r3
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r3,r3,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+WriteFile0:
+
+.ifdef W32
+.else
+ eors r1,r1,r1
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r1,r1,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.endif
+Write_File:
+
+.ifdef W32
+.else
+.ifdef BEOS
+.else
+.ifdef LIBC
+.else
+ ldr r12,= SYS_write
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+.endif
+OpenFile0:
+
+.ifndef BEOS
+.ifdef W32
+.else
+ eors r2,r2,r2
+.endif
+.endif
+OpenFile:
+
+.ifdef W32
+.else
+.ifdef BEOS
+.else
+.ifdef LIBC
+.else
+ ldr r12,= SYS_open
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+.endif
+CloseFile:
+
+.ifdef W32
+.else
+.ifdef LIBC
+.else
+ ldr r12,= SYS_close
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+.ifdef SYS_readlink
+ReadLink:
+ ldr r12,= SYS_readlink
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.ifdef SYS_fchmod
+Fchmod:
+.ifdef LIBC
+.else
+ ldr r12,= SYS_fchmod
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+.ifdef SYS_fstat
+Fstat: A_DR r2,fstatbuf
+.ifdef LIBC
+.else
+ ldr r12,= SYS_fstat
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+ChownFile:
+
+.ifdef LIBC
+.else
+ ldr r12,= SYS_fchown
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+RenameFile:
+
+.ifdef W32
+.else
+.ifdef LIBC
+.else
+ ldr r12,= SYS_rename
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+.ifdef SYS_brk
+SysBrk: ldr r12,= SYS_brk
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.ifndef W32
+Exit: eors r1,r1,r1
+Exit2:
+.ifdef LIBC
+.else
+ ldr r12,= SYS_exit
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+SeekFile:
+ eors r2,r2,r2
+.ifdef W32
+.else
+.ifdef BEOS
+.else
+.ifdef LIBC
+.ifdef OPENBSD
+.endif
+.ifdef OPENBSD
+.endif
+.else
+ ldr r12,= SYS_lseek
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+.endif
+.endif
+.endif
+.ifndef LIBC
+.ifndef W32
+IntCall:
+ mov r12,#0x0
+ bic r0,r0,#0xFF00
+ orr r0,r0,r12,lsl #8
+IntCall2:
+ mov r0,r0,lsl #16
+ mov r0,r0,asr #16
+
+.ifdef BEOS
+.else
+.ifdef ATHEOS
+.else
+.ifdef LINUX
+ stmfd r13!,{r1-r6,r14}
+ bl _INT
+ ldmfd r13!,{r1-r6,r14}
+.else
+.endif
+AfterInt:
+ rsbs r0,r0,#0
+err: A_DR r12,ErrNr
+ str r0,[r12]
+ rsbs r0,r0,#0
+.endif
+.endif
+ RET
+.endif
+.endif
+.ifdef BEOS
+.endif
+.ifdef SYS_select
+.ifdef LIBC
+.else
+Select: eors r1,r1,r1
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r1,r1,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+ A_DR r2,readfds
+ strB r1,[r2]
+ eors r3,r3,r3
+ eors r5,r5,r5
+ A_DR r4,timevalsec
+ ldr r12,= SYS_select
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+.ifdef SYS_readlink
+Utime: ldr r12,= SYS_utime
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.ifdef USE_PIPE
+.ifdef FREEBSD
+.else
+.endif
+.endif
+Unlink:
+.ifdef W32
+.else
+.ifdef LIBC
+.else
+.ifdef BEOS
+.endif
+ ldr r12,= SYS_unlink
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b IntCall
+.endif
+.endif
+.ifdef SYS_kill
+KeySuspend:
+ CALL KursorStatusLine
+ ldr r12,= SIGSTOP
+ stmfd r13!,{r12}
+ ldmfd r13!,{r2}
+ eors r1,r1,r1
+Kill: ldr r12,= SYS_kill
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ICjmp: b IntCall
+SetSigHandler:
+
+ ldr r12,= SIGCONT
+ stmfd r13!,{r12}
+ ldmfd r13!,{r1}
+ eors r3,r3,r3
+ A_DR r2,sigaction
+ A_DR r11,SigHandler
+ str r11,[r2]
+ ldr r12,= SYS_sigaction
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ b ICjmp
+.endif
+.ifdef USE_PIPE
+.ifdef USE_UNDO
+.endif
+.ifdef CAPTURE_STDERR
+.endif
+.ifdef USE_EX_NO_SED
+.else
+.ifdef CAPTURE_STDERR
+.endif
+.ifdef CAPTURE_STDERR
+.ifdef BEEP_IN_VI
+.endif
+.endif
+.endif
+.ifdef USE_EX_NO_SED
+.else
+.ifdef CAPTURE_STDERR
+.endif
+.endif
+.endif
+ChkCursPos:
+
+.ifdef UTF8
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+CCloopUTF8:
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ subs r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+.ifdef UTF8RTS
+.endif
+ ldrB r12,[r4]
+ bic r0,r0,#0xFF
+ orr r0,r0,r12
+ mov r12,#0xc0
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ ands r11,r11,r12
+ and r11,r11,#0xFF
+ bic r0,r0,#0xFF
+ orr r0,r0,r11
+ mov r12,#0x80
+ mov r11,r0,lsl #24
+ mov r11,r11,lsr #24
+ cmp r11,r12
+ beq CCloopUTF8
+noUTF_Z:
+
+.endif
+ cmp r4,r6
+ bls CCP
+ mov r4,r6
+CCP: A_DR r11,sot
+ cmp r4,r11
+ bhs CCP2
+ A_DR r4,sot
+CCP2: RET
+.ifdef SYS_readlink
+CopyToBackup:
+ PUSH_ALL @(is a macro)
+ stmfd r13!,{r2}
+ stmfd r13!,{r2}
+ CALL OpenFile0
+ mov r12,r0
+ mov r0,r5
+ mov r5,r12
+ ldr r2,= O_WRONLY_CREAT_TRUNC
+
+ A_DR r12,perms
+ ldr r3,[r12]
+ ldmfd r13!,{r1}
+ CALL OpenFile
+ mov r12,r0
+ mov r0,r1
+ mov r1,r12
+ A_DR r12,fstatbuf+stat_struc.st_uid
+ ldr r2,[r12]
+.ifdef UIDGID_WORD
+ mov r3,r2
+ mov r3,r3,lsr #16
+ mov r2,r2,lsl #16
+ mov r2,r2,lsr #16
+.else
+.endif
+ CALL ChownFile
+ eors r4,r4,r4
+copylop:
+ stmfd r13!,{r1}
+ mov r1,r5
+ A_DR r2,screenbuffer
+ mov r3,#0x0
+ mov r8,#0x10
+ add r3,r3,r8,lsl #8
+
+ CALL Read_File
+ ldmfd r13!,{r1}
+ cmp r0,r3
+ beq notready
+ mrs r8,CPSR
+ and r8,r8,#0x20000000
+ mov r11,#0x1
+ adds r4,r4,r11
+ mrs r12,CPSR
+ orrcc r12,r12,r8
+ msr CPSR_f,r12
+notready:
+ A_DR r2,screenbuffer
+ mov r3,r0
+ CALL Write_File
+ orrs r4,r4,r4
+ beq copylop
+ CALL CloseFile
+ mov r1,r5
+ CALL CloseFile
+ ldmfd r13!,{r1}
+ A_DR r2,accesstime
+ CALL Utime
+ POP_ALL @(is a macro)
+ RET
+.endif
+KeyCtrlKN:
+
+.ifdef USE_MATH
+.endif
+.ifdef BEEP_IN_VI
+VIBeepForD:
+ PUSH_ALL @(is a macro)
+.ifdef W32
+.else
+ A_DR r2,BeepChar
+ CALL WriteFile00
+.endif
+ POP_ALL @(is a macro)
+.endif
+ RET
+.ifdef USE_MATH
+.endif
+OCret: RET
+.ifdef USE_UNDO
+.ifdef ROLLBACK
+.endif
+.ifdef ROLLBACK
+.endif
+.endif
+.ifdef USE_MATH
+.endif
+tempfile2:
+.byte 'e','3','#','#',0
+.ifdef USE_PIPE
+.ifdef USE_EX_NO_SED
+.else
+.ifndef PERLPIPE
+.else
+.endif
+.endif
+.endif
+optiontext:
+.byte 'O','P','T','?',' ','C','/','B',0
+filename:
+.byte 'F','I','L','E','N','A','M','E',':',0
+block:.byte ' ',' ',' ','N','A','M','E',':',0
+saveas:.byte 'S','A','V','E',' ','A','S',':',0
+filesave:
+.byte ' ',' ',' ','S','A','V','E',':',0
+asksave:
+.byte 'S','A','V','E','?',' ','Y','n','l',0
+asksave2:
+.byte 'S','A','V','E','?',' ','Y','n',0
+askreplace1:
+.byte 'R','E','P','L','A','C','E',':',0
+askreplace2:
+.byte 'R','E',' ','W','I','T','H',':',0
+asklineno:
+.byte 'G','O',' ','L','I','N','E',':',0
+askfind:
+.byte ' ','S','E','A','R','C','H',':',0
+asknumber:
+.byte '^','Q',' ','O','C','T','A','L',':',0
+extext:.byte 'm','o','d','e',' ','E','X',':',0
+modetxt:
+.byte 'S','E','T',' ','M','O','D','E',0
+.equ DoNo,10
+ScanTable:
+
+.ifdef W32
+.else
+.byte DoNo
+.byte 0
+.byte 8
+.byte 9
+.byte 5
+.byte 2
+.byte 7
+.byte 0
+.byte 5
+.ifdef QNX
+.endif
+.byte 1
+.byte 6
+.byte 4
+.byte 3
+.byte DoNo
+.byte 5
+.byte 7
+.byte 0
+.ifndef LINUX
+.endif
+.ifdef QNX
+.endif
+.equ STsize,( . -ScanTable)
+.endif
+EmaAltTable:
+
+.byte 18
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 19
+.byte 17
+.byte 61
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 2
+.byte 39
+.byte 62
+.equ ATsize,( . -EmaAltTable)
+.equ Beep,78
+VIcmdTable:
+.byte Beep
+.byte Beep
+.byte 2
+.byte Beep
+.byte 54
+.byte Beep
+.byte 7
+.byte Beep
+.byte 3
+.byte Beep
+.byte 6
+.byte Beep
+.byte Beep
+.byte 6
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte 55
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte 81
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte 4
+.byte Beep
+.byte Beep
+.byte 79
+.byte 5
+.byte Beep
+.byte Beep
+.byte 80
+.byte Beep
+.byte Beep
+.byte Beep
+.byte 6
+.byte Beep
+.byte 1
+.byte Beep
+.byte 57
+.byte 0
+.byte 68
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte Beep
+.byte 44
+.byte 62
+.byte Beep
+.byte Beep
+.byte Beep
+.byte 58
+.byte Beep
+.byte 46
+.byte 18
+.byte 75
+.byte 76
+.byte Beep
+.byte Beep
+.byte 15
+.byte 48
+.byte 51
+.byte 77
+.byte Beep
+.byte 49
+.byte 82
+.byte Beep
+.byte 50
+.byte 60
+.byte Beep
+.byte 52
+.byte 64
+.byte Beep
+.byte Beep
+.byte Beep
+.byte 19
+.byte 63
+.byte Beep
+.byte 65
+.byte Beep
+.byte Beep
+.byte Beep
+.byte 56
+.byte Beep
+.byte Beep
+.byte 45
+.byte 18
+.byte Beep
+.byte 53
+.byte 67
+.byte Beep
+.byte Beep
+.byte 3
+.byte 43
+.byte 6
+.byte 1
+.byte 4
+.byte 69
+.byte Beep
+.byte 47
+.byte 59
+.byte Beep
+.byte 74
+.byte Beep
+.byte Beep
+.ifdef USE_UNDO
+.else
+.byte Beep
+.endif
+.byte Beep
+.byte 19
+.byte 9
+.byte 70
+.byte 66
+.equ VIsize,( . -VIcmdTable)
+Ktable:.byte DoNo
+.byte DoNo
+.byte 36
+.byte 21
+.byte 13
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 29
+.byte DoNo
+.byte DoNo
+.byte 20
+.byte DoNo
+.byte 62
+.byte 79
+.byte DoNo
+.byte 72
+.byte 11
+.byte 16
+.byte 12
+.byte DoNo
+.byte DoNo
+.byte 35
+.byte 37
+.byte 22
+.byte 25
+.byte 81
+.equ Ktable_size, . -Ktable
+Qtable:.byte DoNo
+.byte 26
+.byte 32
+.byte 15
+.byte 5
+.byte 30
+.byte 27
+.byte DoNo
+.byte 23
+.byte 17
+.byte DoNo
+.byte 33
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 24
+.byte DoNo
+.byte 14
+.byte 0
+.byte DoNo
+.byte DoNo
+.byte 28
+.byte 18
+.byte 31
+.byte 34
+.byte 19
+Xtable:.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 11
+.byte DoNo
+.byte DoNo
+.byte 71
+.byte DoNo
+.byte 61
+.byte 16
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 79
+.byte DoNo
+.byte 72
+.byte DoNo
+.byte DoNo
+.byte 12
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 41
+.byte 38
+.byte DoNo
+.byte DoNo
+PicoJtable:
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 23
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 34
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 72
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 73
+.byte DoNo
+.byte DoNo
+.byte 42
+.byte DoNo
+.byte DoNo
+.byte DoNo
+PicoQtable:
+.byte DoNo
+.byte DoNo
+.byte 31
+.byte 79
+.byte DoNo
+.byte 15
+.byte 28
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte 17
+.byte 62
+.byte 19
+.byte DoNo
+.byte 18
+.byte DoNo
+.byte DoNo
+.byte 14
+.byte 30
+.ifdef USE_UNDO
+.else
+.byte DoNo
+.endif
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.byte DoNo
+.equ esize,2
+.ifdef ARMCPU
+.align 2
+.endif
+jumptab1:
+
+.ifndef USE_EXT_MOVE
+.short KeyHome-_start
+.else
+.endif
+.short KeyUp-_start
+.short KeyPgUp-_start
+.short KeyLeft-_start
+.short KeyRight-_start
+.ifndef USE_EXT_MOVE
+.short KeyEnd-_start
+.else
+.endif
+.short KeyDown-_start
+.short KeyPgDn-_start
+.short KeyIns-_start
+.short KeyDel-_start
+.short SimpleRet-_start
+.short KeyCtrlKQ-_start
+.short KeyCtrlKS-_start
+.short KeyCtrlKD-_start
+.ifndef USE_EXT_MOVE
+.short KeyCtrlQR-_start
+.short KeyCtrlQC-_start
+.else
+.endif
+.short KeyCtrlKR-_start
+.short KeyCtrlQI-_start
+.short KeyCtrlQW-_start
+.short KeyCtrlQZ-_start
+.short KeyCtrlKK-_start
+.short KeyCtrlKC-_start
+.short KeyCtrlKX-_start
+.short KeyCtrlQDel-_start
+.short KeyCtrlQP-_start
+.short KeyCtrlKY-_start
+.short KeyCtrlQA-_start
+.short KeyCtrlQF-_start
+.short KeyCtrlQV-_start
+.short KeyCtrlKH-_start
+.short KeyCtrlQE-_start
+.short KeyCtrlQX-_start
+.short KeyCtrlQB-_start
+.short KeyCtrlQK-_start
+.short KeyCtrlQY-_start
+.short KeyCtrlKV-_start
+.short KeyCtrlKB-_start
+.short KeyCtrlKW-_start
+.short KeyCtrlXX-_start
+.short KeyEmaAltW-_start
+.short KeyEmaAltPer-_start
+.short KeyEmaCtrlXW-_start
+.short KeyCtrlT-_start
+.short KeyVIcmdi-_start
+.short KeyVIex-_start
+.short KeyVIcmda-_start
+.short KeyVICmdA-_start
+.short KeyVICmdo-_start
+.short KeyCtrlQE-_start
+.short KeyCtrlQX-_start
+.short KeyVICmdO-_start
+.short KeyVICmdI-_start
+.short KeyVICmdR-_start
+.short KeyVICmdd-_start
+.short KeyHalfPgDn-_start
+.short KeyHalfPgUp-_start
+.short KeyVI1Char-_start
+.short KeyVIfsearch-_start
+.short KeyVIbsearch-_start
+.short KeyVICmdp-_start
+.short KeyVICmdP-_start
+.short KeyHelp-_start
+.short KeyEditMode-_start
+.short KeyDell-_start
+.short KeyVICmdS-_start
+.short KeyVICmdZ-_start
+.short KeyVICmdz-_start
+.short KeyVIcmde-_start
+.short KeyVIcmd1-_start
+.short KeyVICmdm-_start
+.short KeyVICmdy-_start
+.short KeyEmaCtrlXF-_start
+.ifdef USE_PIPE
+.else
+.short SimpleRet-_start
+.endif
+.short KeyPiCtrlJT-_start
+.short KeyVICmdr-_start
+.short KeyVICmdC-_start
+.short KeyVICmdD-_start
+.short KeyVICmdJ-_start
+.ifdef BEEP_IN_VI
+.short VIBeepForD-_start
+.else
+.endif
+.short KeyCtrlKN-_start
+.short KeyVICmdJmpM-_start
+.ifdef SYS_kill
+.short KeySuspend-_start
+.else
+.endif
+.short KeyVI_M-_start
+.ifdef USE_UNDO
+.else
+.short SimpleRet-_start
+.endif
+.equ jumps1,( . -jumptab1)/esize
+.short SimpleRet-_start
+.short KeyCtrlQW-_start
+.short SimpleRet-_start
+.short KeyPgDn-_start
+.short KeyRight-_start
+.short KeyUp-_start
+.short KeyCtrlQZ-_start
+.short KeyDel-_start
+.short KeyDell-_start
+.short NormChar-_start
+.ifdef SELFTEST
+.else
+.short KeyHelp-_start
+.endif
+.short CtrlKMenu-_start
+.short KeyCtrlL-_start
+.short KeyRet-_start
+.short SimpleRet-_start
+.short SimpleRet-_start
+.short KeyHelp-_start
+.short CtrlQMenu-_start
+.short KeyPgUp-_start
+.short KeyLeft-_start
+.short KeyCtrlT-_start
+.ifdef USE_UNDO
+.else
+.short SimpleRet-_start
+.endif
+.short KeyIns-_start
+.short KeyScrollUp-_start
+.short KeyDown-_start
+.short KeyCtrlY-_start
+.short KeyScrollDn-_start
+.short SimpleRet-_start
+.short SimpleRet-_start
+.short SimpleRet-_start
+.short SimpleRet-_start
+.ifdef ROLLBACK
+.else
+.short SimpleRet-_start
+.endif
+.short KeyEmaMark-_start
+.short KeyHome-_start
+.short KeyLeft-_start
+.short SimpleRet-_start
+.short KeyDel-_start
+.short KeyEnd-_start
+.short KeyRight-_start
+.short SimpleRet-_start
+.short KeyDell-_start
+.short NormChar-_start
+.short KeyRet-_start
+.short KeyEmaCtrlK-_start
+.short KeyEmaCtrlL-_start
+.short KeyRetNoInd-_start
+.short KeyDown-_start
+.short KeyEmaCtrlO-_start
+.short KeyUp-_start
+.short KeyEmaCtrlQ-_start
+.short KeyEmaCtrlR-_start
+.short KeyEmaCtrlS-_start
+.short KeyEmaCtrlT-_start
+.short SimpleRet-_start
+.short KeyPgDn-_start
+.short KeyEmaCtrlW-_start
+.short CtrlXMenu-_start
+.short KeyEmaCtrlY-_start
+.ifdef SYS_kill
+.short KeySuspend-_start
+.else
+.endif
+.short SimpleRet-_start
+.short SimpleRet-_start
+.short SimpleRet-_start
+.short SimpleRet-_start
+.ifdef USE_UNDO
+.else
+.short SimpleRet-_start
+.endif
+.short KeyEmaMark-_start
+.short KeyHome-_start
+.short KeyLeft-_start
+.short SimpleRet-_start
+.short KeyDel-_start
+.short KeyEnd-_start
+.short KeyRight-_start
+.short KeyHelp-_start
+.short KeyDell-_start
+.short NormChar-_start
+.short PicoJMenu-_start
+.short KeyEmaCtrlW-_start
+.short KeyEmaMark-_start
+.short KeyRet-_start
+.short KeyDown-_start
+.short KeyCtrlKS-_start
+.short KeyUp-_start
+.short PicoQMenu-_start
+.short KeyCtrlKR-_start
+.short KeyEmaCtrlXW-_start
+.short PicoCtrlTpico-_start
+.short KeyEmaCtrlY-_start
+.short KeyPgDn-_start
+.short KeyEmaCtrlS-_start
+.short KeyCtrlKQ-_start
+.short KeyPgUp-_start
+.ifdef SYS_kill
+.short KeySuspend-_start
+.else
+.endif
+.short SimpleRet-_start
+.short SimpleRet-_start
+.short SimpleRet-_start
+.short KeyEmaMark-_start
+.short SimpleRet-_start
+.short KeyEmaMark-_start
+.short KeyNedCtrlA-_start
+.short KeyIns-_start
+.short KeyEmaAltW-_start
+.short SimpleRet-_start
+.short KeyEditMode-_start
+.short KeyCtrlQF-_start
+.short KeyCtrlL-_start
+.short KeyDell-_start
+.short NormChar-_start
+.short KeyRet-_start
+.short KeyCtrlKN-_start
+.short KeyCtrlQI-_start
+.short KeyRet-_start
+.short KeyEmaCtrlXF-_start
+.short KeyEmaCtrlXF-_start
+.short SimpleRet-_start
+.short KeyCtrlKQ-_start
+.short KeyCtrlQA-_start
+.short KeyCtrlKS-_start
+.short SimpleRet-_start
+.ifdef USE_UNDO
+.else
+.short SimpleRet-_start
+.endif
+.short KeyEmaCtrlY-_start
+.short KeyEmaCtrlXW-_start
+.short KeyEmaCtrlW-_start
+.short SimpleRet-_start
+.ifdef SYS_kill
+.short KeySuspend-_start
+.else
+.endif
+.short SimpleRet-_start
+.short SimpleRet-_start
+.short SimpleRet-_start
+.short SimpleRet-_start
+.short SimpleRet-_start
+.ifdef W32
+.else
+BeepChar:
+.byte 7
+screencolors0:
+.byte 27,'[','4','0','m',27,'[','3','7','m'
+bold0:.byte 27,'[','0','m'
+screencolors1:
+.byte 27,'[','4','4','m',27,'[','3','3','m'
+reversevideoX:
+
+bold1:.byte 27,'[','1','m'
+.equ scolorslen, . -screencolors1
+.equ boldlen, . -bold1
+.ifdef LINUX
+.byte 27,'[','7','m'
+.ifdef NEW_CURSOR_MGNT
+blockcurs:
+.byte 27,'[','?','1','7',';','0',';','6','4','c'
+.equ blockcurslen, . -blockcurs
+normcurs:
+.byte 27,'[','?','2','c'
+.equ normcurslen, . -normcurs
+.endif
+.endif
+.endif
+.ifdef SELFTEST
+.endif
+.ifdef UTF8
+.ifdef UTF8RTS
+.endif
+.endif
+.ifdef ARMCPU
+.align 2
+.endif
+editmode:
+.byte 'p',' ','W','S','p',' ','P','i','p',' ','E','m','p',' ','N','E'
+helptext:
+
+.ifdef YASM
+.else
+.ascii "MicroEditor e3 v2.6.1"
+.endif
+.ifdef UTF8
+.ascii "-UTF8 GPL "
+.byte 194,169
+.ascii " 2000-04 A.Kleine <kleine@ak.sax.de>"
+.byte 10
+.else
+.endif
+.ascii "Enter filename or leave with RETURN"
+.byte 10,10
+.ifdef YASM
+.else
+.equ helptextsize, . -helptext
+.if 0
+.endif
+.endif
+helpfoot:
+.byte 10,10,10,TABCHAR,TABCHAR,TABCHAR
+.ascii "-= PRESS ANY KEY =-"
+.ifdef YASM
+.else
+.equ helpfootsize, . -helpfoot
+.if 0
+.endif
+.endif
+.ifdef USE_BUILTINHELP
+help_ws:
+
+.ascii "Key bindings in WS mode:"
+.byte 10,10
+.ascii "Files: ^KR Insert ^KS Save ^KX Save&Exit ^KQ Abort&Exit"
+.byte 10
+.ifndef USE_PIPE
+.ascii " ^KD Save&Load"
+.byte 10
+.else
+.ifdef USE_EX_NO_SED
+.else
+.endif
+.endif
+.byte 10
+.ascii "Blocks: ^KB Start ^KK End ^KC Copy ^KY Del"
+.byte 10
+.ascii " ^KV Move ^KW Write"
+.byte 10
+.byte 10
+.ascii "Search: ^QF Find ^L Repeat ^QA Srch&Repl"
+.byte 10
+.ascii "Move: ^E Up ^X Down ^S Left ^D Right"
+.byte 10
+.ascii " ^R Page Up ^C Page Dn ^W Scroll Up ^Z Scroll Dn"
+.byte 10
+.ascii "Quick- ^QE Wnd Top ^QX Wnd Bott ^QS Home ^QD End"
+.byte 10
+.ascii "-Move: ^QR BOF ^QC EOF ^QB Blk Begin ^QK Blk End"
+.byte 10
+.ascii " ^F Next Word ^A Prev Word ^QI Line# ^QV Last Find"
+.byte 10
+.byte 10
+.ascii "Delete: ^T Word ^Y Line ^H Left ^G Chr"
+.byte 10
+.ascii " ^QY Line End ^QDel,^QH Line Beg"
+.byte 10
+.ifdef USE_MATH
+.else
+.ascii "Other: ^KM Set mode"
+.endif
+.ifdef SYS_kill
+.ascii " ^KZ Suspend "
+.endif
+.ifdef USE_UNDO
+.endif
+.equ help_ws_size, . -help_ws
+help_pi:
+
+.ascii "Key bindings in PICO mode:"
+.byte 10,10
+.ascii "Files: ^XN ExitNoSave ^XY Exit+Save ^XL Save+Load New File"
+.byte 10
+.ascii " ^O Save ^S Save as ^R Read"
+.byte 10
+.byte 10
+.ascii "Move: ^P Up ^N Down ^B Left ^F Right"
+.byte 10
+.ascii " ^Y Page up ^V Page down ^QN Next word ^QP Previous word"
+.byte 10
+.ascii " ^A Home ^E End ^QS Start ^QE EOF"
+.byte 10
+.ascii " ^QT Top screen ^QB Bottom scr ^QL Line # ^QF last Find"
+.byte 10
+.byte 10
+.ascii "Search: ^W Where is ^T Search&Repl ^JT Repeat Search & Replace"
+.byte 10
+.byte 10
+.ascii "Delete: ^H Left char ^D This char ^K Kill line/region"
+.byte 10
+.ascii " ^JW Word ^JL Line end ^JH Line begin"
+.byte 10
+.byte 10
+.ascii "Other: ^U Unkill ^G Help ^^,^L,^<SPC> Mark region"
+.byte 10
+.ifndef USE_PIPE
+.ascii " ^QM Set Edit Mode "
+.byte 10
+.else
+.ifdef USE_EX_NO_SED
+.else
+.endif
+.endif
+.ifdef USE_MATH
+.else
+.ascii " "
+.endif
+.ifdef SYS_kill
+.ascii " ^Z Suspend"
+.endif
+.ifdef USE_UNDO
+.endif
+.equ help_pi_size, . -help_pi
+help_em:
+
+.ascii "Key bindings in EMACS mode:"
+.byte 10,10
+.ascii "Files: ^X^C Exit ^XI Insert ^X^S Save ^X^F Load New"
+.byte 10
+.ifndef USE_PIPE
+.ascii " ^X^W Write new ^X^H Help "
+.byte 10
+.else
+.ifdef USE_EX_NO_SED
+.else
+.endif
+.endif
+.byte 10
+.ascii "Move: ^P Up ^N Down ^B Left ^F Right"
+.byte 10
+.ascii " altV Pg up ^V Pg down altB Left word altF Right word"
+.byte 10
+.ascii " ^A Home ^E End alt< BOF alt> EOF"
+.byte 10
+.ascii " altG Go line# ^L Center Pos"
+.byte 10
+.byte 10
+.ascii "Search: ^S Find fwd ^R Find bwd alt% Search&Replace like WS"
+.byte 10
+.byte 10
+.ascii "Buffer: altW Copy ^Y Yank ^<SPC> Mark ^X^X Xchg Mark/Pt"
+.byte 10
+.byte 10
+.ascii "Delete: ^K Line ^W Region ^H Left Chr ^D This Chr"
+.byte 10
+.byte 10
+.ifdef UTF8
+.ascii "Other: ^O Open line ^I Ins Tab ^Q Quoted Ins"
+.byte 10
+.else
+.endif
+.ascii " ^M NL ^J NL+indent altX Set edit mode"
+.byte 10
+.ifdef USE_MATH
+.else
+.ascii " "
+.endif
+.ifdef SYS_kill
+.ascii " ^Z Suspend"
+.endif
+.ifdef USE_UNDO
+.endif
+.equ help_em_size, . -help_em
+help_vi:
+
+.ascii "Key bindings in vi mode:"
+.byte 10
+.byte 10
+.ascii "<ESC> enter cmd mode"
+.byte 10
+.ascii "h,j,k,l,+,-,<Ret>,<SPC> move by chars&lines"
+.byte 10
+.ascii "^B,^F,^D,^U move by [half]page"
+.byte 10
+.ascii "$,0,^,w,b,e,H,L,M,z. move in line/screen"
+.byte 10
+.ascii "/,?,G srch fwd/bwd, go EOF"
+.byte 10
+.ascii "ma,'a set/go marker a"
+.byte 10
+.ascii "x,X,<Del>,dw,D dele chr,word,EOL"
+.byte 10
+.ascii "S,C,dd,d'a,yy,y'a subst,change,dele,yank"
+.byte 10
+.ascii "p,P paste"
+.byte 10
+.ascii "A,a,I,i,<Ins>,O,o enter ins.mode"
+.byte 10
+.ascii "R,r enter ovw.mode,ovw.chr"
+.byte 10
+.ascii "J join lines"
+.byte 10
+.ifdef USE_UNDO
+.ifdef SYS_kill
+.else
+.endif
+.else
+.ifdef SYS_kill
+.ascii "ZZ,^Z save&quit,suspend"
+.byte 10
+.else
+.endif
+.endif
+.ifdef USE_MATH
+.else
+.ascii "; E3 SPECIAL:set edit mode"
+.byte 10
+.endif
+.ascii ":w,:wq,:x,:q,:q!,:e ex mode:save,quit,save_as,edit other"
+.byte 10
+.ascii ":0,:$,:<line#> ex mode:go BOF,EOF,line"
+.byte 10
+.ascii ":h ex mode:help"
+.byte 10
+.ifndef USE_PIPE
+.ascii " "
+.else
+.ifdef USE_EX_NO_SED
+.else
+.endif
+.endif
+.equ help_vi_size, . -help_vi
+help_ne:
+
+.ascii "Key bindings in NEDIT mode:"
+.byte 10
+.byte 10
+.ascii "Files: ^QN Exit_NoSave ^QY Exit&Save ^QL Save&Load new"
+.byte 10
+.ascii " ^S Save ^W WriteTo=SaveAs"
+.byte 10
+.ascii "Move: ^L Line#"
+.byte 10
+.ascii " ^F Find ^R Search&Replace (like WS)"
+.byte 10
+.ascii " ^G Go repeat last ^F,^R"
+.byte 10
+.byte 10
+.ascii "Select: ^<SPACE> begin&extend by cursor keys (like Emacs)"
+.byte 10
+.ascii " ^A All buffer"
+.byte 10
+.ascii " ^X Cut ^C Copy ^V Paste"
+.byte 10
+.byte 10
+.ascii "Other: ^E Set edit mode"
+.byte 10
+.ifdef USE_MATH
+.endif
+.ascii " altH Help"
+.ifdef SYS_kill
+.ascii " ^Z Suspend"
+.endif
+.ifdef USE_UNDO
+.endif
+.equ help_ne_size, . -help_ne
+.ifndef YASM
+.if 0
+.endif
+.endif
+.else
+.endif
+errmsgs:
+ errortext @(is a macro)
+.ifdef CRIPLED_ELF
+.endif
+.ifdef ATHEOS
+.endif
+.ifdef OPENBSD
+.endif
+.bss
+.code 32
+.align 4
+.ifdef CRIPLED_ELF
+.endif
+.equ screenbuffer_size,11904
+.equ screenbuffer_dwords,screenbuffer_size/4
+screenbuffer:
+.space screenbuffer_size
+.equ screenbuffer_end, .
+.ifdef W32
+.else
+termios:
+.space termios_struc_size
+termios_orig:
+.space termios_struc_size
+winsize:
+.space winsize_struc_size
+.equ setkplen,10
+setkp:.space setkplen
+.space 2
+revvoff:
+.space 1*4
+.endif
+.ifdef USE_UNDO
+.endif
+lines:.space 1*4
+columns:
+.space 1*4
+columne:
+.space 1*4
+zloffst:
+.space 1*4
+fileptr:
+.space 1*4
+kurspos:
+.space 1*4
+kurspos2:
+.space 1*4
+tabcnt:.space 1*4
+changed:
+.space 1*4
+oldQFpos:
+.space 1*4
+bereitsges:
+.space 1*4
+blockbegin:
+.space 1*4
+blockende:
+.space 1*4
+endeedit:
+.space 1*4
+old:.space 1*4
+veryold:
+.space 1*4
+linenr:.space 1*4
+showblock:
+.space 1*4
+suchlaenge:
+.space 1*4
+repllaenge:
+.space 1*4
+vorwarts:
+.space 1*4
+grossklein:
+.space 1*4
+ch2linebeg:
+.space 1*4
+numeriere:
+.space 1*4
+read_b:.space 1*4
+.ifdef W32
+.endif
+isbold:.space 1*4
+inverse:
+.space 1*4
+insstat:
+.space 1*4
+ErrNr:.space 1*4
+.equ errlen,100
+error:.space errlen
+maxlen:.space 1*4
+.equ maxfilenamelen,255
+filepath:
+.space maxfilenamelen+1
+bakpath:
+.space maxfilenamelen+1
+blockpath:
+.space maxfilenamelen+1
+replacetext:
+.space maxfilenamelen+1
+suchtext:
+.space maxfilenamelen+1
+suchtext2:
+.space maxfilenamelen+1
+optbuffer:
+.space optslen
+.equ linkbuffersize,4
+linkbuffer:
+.space linkbuffersize
+.ifdef AMD64
+.else
+sigaction:
+.space 40*4
+.endif
+perms:.space 1*4
+.ifdef SYS_fstat
+fstatbuf:
+.space stat_struc_size
+.endif
+.ifdef SYS_utime
+accesstime:
+.space utimbuf_struc_size
+.endif
+screenline:
+.space 256+4*scolorslen
+.ifdef W32
+.endif
+EmaKiSize:
+.space 1*4
+EmaKiSrc:
+.space 1*4
+EmaMark:
+.space 1*4
+EmaCtrl:
+
+EmaCtrlK:
+.space 1
+EmaCtrlS:
+.space 1
+.space 2
+EmaNumHelper:
+.space 1*4
+VICmdMode:
+.space 1*4
+VIbufch:
+.space 1*4
+VInolinebased:
+.space 1*4
+PicoSearch:
+.space 1*4
+.ifdef UTF8RTS
+.endif
+.ifdef USE_PIPE
+.endif
+mode:.space 1*4
+readfds:
+.space 1*4
+timevalsec:
+.space 1*4
+timevalusec:
+.space 1*4
+.equ buffercopysize,1024
+buffercopy:
+.space buffercopysize
+.ifdef USE_MATH
+.ifdef AMD64
+.else
+.endif
+.endif
+.ifdef W32
+.endif
+.ifdef SYS_brk
+.equ max,102400
+.else
+.endif
+text:.space max
+.equ sot,(text+1)
+.ifdef CRIPLED_ELF
+.endif
diff --git a/armlinux/emulayer.s b/armlinux/emulayer.s
new file mode 100644
index 0000000..8b70ff9
--- /dev/null
+++ b/armlinux/emulayer.s
@@ -0,0 +1,314 @@
+@--------------------------------------------------------------------
+@
+@ Copyright (C) 2002 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
+@ the Free Software Foundation; either version 2 of the License, or
+@ (at your option) any later version.
+@
+@ This program is distributed in the hope that it will be useful,
+@ but WITHOUT ANY WARRANTY; without even the implied warranty of
+@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+@ GNU General Public License for more details.
+@
+@ You should have received a copy of the GNU General Public License
+@ along with this program; if not, write to the Free Software
+@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+@
+@----------------------------------------------------------------------
+.text
+.global _INT
+_INT: adr r12,.table
+ cmp r0,#((.endtable-.table)/8)
+ movhi pc,r14
+ add r12,r12,r0, lsl #3
+ mov r0,r1
+ mov r1,r2
+ mov r2,r3
+ mov r3,r4
+ mov r4,r5
+ mov r5,r6
+ mov pc,r12 @ jump
+@-------
+.table: swi 0x900000;mov pc,r14
+ swi 0x900001;mov pc,r14
+ swi 0x900002;mov pc,r14
+ swi 0x900003;mov pc,r14
+ swi 0x900004;mov pc,r14
+ swi 0x900005;mov pc,r14
+ swi 0x900006;mov pc,r14
+ swi 0x900007;mov pc,r14
+ swi 0x900008;mov pc,r14
+ swi 0x900009;mov pc,r14
+ swi 0x90000a;mov pc,r14
+ swi 0x90000b;mov pc,r14
+ swi 0x90000c;mov pc,r14
+ swi 0x90000d;mov pc,r14
+ swi 0x90000e;mov pc,r14
+ swi 0x90000f;mov pc,r14
+ swi 0x900010;mov pc,r14
+ swi 0x900011;mov pc,r14
+ swi 0x900012;mov pc,r14
+ swi 0x900013;mov pc,r14
+ swi 0x900014;mov pc,r14
+ swi 0x900015;mov pc,r14
+ swi 0x900016;mov pc,r14
+ swi 0x900017;mov pc,r14
+ swi 0x900018;mov pc,r14
+ swi 0x900019;mov pc,r14
+ swi 0x90001a;mov pc,r14
+ swi 0x90001b;mov pc,r14
+ swi 0x90001c;mov pc,r14
+ swi 0x90001d;mov pc,r14
+ swi 0x90001e;mov pc,r14
+ swi 0x90001f;mov pc,r14
+ swi 0x900020;mov pc,r14
+ swi 0x900021;mov pc,r14
+ swi 0x900022;mov pc,r14
+ swi 0x900023;mov pc,r14
+ swi 0x900024;mov pc,r14
+ swi 0x900025;mov pc,r14
+ swi 0x900026;mov pc,r14
+ swi 0x900027;mov pc,r14
+ swi 0x900028;mov pc,r14
+ swi 0x900029;mov pc,r14
+ swi 0x90002a;mov pc,r14
+ swi 0x90002b;mov pc,r14
+ swi 0x90002c;mov pc,r14
+ swi 0x90002d;mov pc,r14
+ swi 0x90002e;mov pc,r14
+ swi 0x90002f;mov pc,r14
+ swi 0x900030;mov pc,r14
+ swi 0x900031;mov pc,r14
+ swi 0x900032;mov pc,r14
+ swi 0x900033;mov pc,r14
+ swi 0x900034;mov pc,r14
+ swi 0x900035;mov pc,r14
+ swi 0x900036;mov pc,r14
+ swi 0x900037;mov pc,r14
+ swi 0x900038;mov pc,r14
+ swi 0x900039;mov pc,r14
+ swi 0x90003a;mov pc,r14
+ swi 0x90003b;mov pc,r14
+ swi 0x90003c;mov pc,r14
+ swi 0x90003d;mov pc,r14
+ swi 0x90003e;mov pc,r14
+ swi 0x90003f;mov pc,r14
+ swi 0x900040;mov pc,r14
+ swi 0x900041;mov pc,r14
+ swi 0x900042;mov pc,r14
+ swi 0x900043;mov pc,r14
+ swi 0x900044;mov pc,r14
+ swi 0x900045;mov pc,r14
+ swi 0x900046;mov pc,r14
+ swi 0x900047;mov pc,r14
+ swi 0x900048;mov pc,r14
+ swi 0x900049;mov pc,r14
+ swi 0x90004a;mov pc,r14
+ swi 0x90004b;mov pc,r14
+ swi 0x90004c;mov pc,r14
+ swi 0x90004d;mov pc,r14
+ swi 0x90004e;mov pc,r14
+ swi 0x90004f;mov pc,r14
+ swi 0x900050;mov pc,r14
+ swi 0x900051;mov pc,r14
+ swi 0x900052;mov pc,r14
+ swi 0x900053;mov pc,r14
+ swi 0x900054;mov pc,r14
+ swi 0x900055;mov pc,r14
+ swi 0x900056;mov pc,r14
+ swi 0x900057;mov pc,r14
+ swi 0x900058;mov pc,r14
+ swi 0x900059;mov pc,r14
+ swi 0x90005a;mov pc,r14
+ swi 0x90005b;mov pc,r14
+ swi 0x90005c;mov pc,r14
+ swi 0x90005d;mov pc,r14
+ swi 0x90005e;mov pc,r14
+ swi 0x90005f;mov pc,r14
+ swi 0x900060;mov pc,r14
+ swi 0x900061;mov pc,r14
+ swi 0x900062;mov pc,r14
+ swi 0x900063;mov pc,r14
+ swi 0x900064;mov pc,r14
+ swi 0x900065;mov pc,r14
+ swi 0x900066;mov pc,r14
+ swi 0x900067;mov pc,r14
+ swi 0x900068;mov pc,r14
+ swi 0x900069;mov pc,r14
+ swi 0x90006a;mov pc,r14
+ swi 0x90006b;mov pc,r14
+ swi 0x90006c;mov pc,r14
+ swi 0x90006d;mov pc,r14
+ swi 0x90006e;mov pc,r14
+ swi 0x90006f;mov pc,r14
+ swi 0x900070;mov pc,r14
+ swi 0x900071;mov pc,r14
+ swi 0x900072;mov pc,r14
+ swi 0x900073;mov pc,r14
+ swi 0x900074;mov pc,r14
+ swi 0x900075;mov pc,r14
+ swi 0x900076;mov pc,r14
+ swi 0x900077;mov pc,r14
+ swi 0x900078;mov pc,r14
+ swi 0x900079;mov pc,r14
+ swi 0x90007a;mov pc,r14
+ swi 0x90007b;mov pc,r14
+ swi 0x90007c;mov pc,r14
+ swi 0x90007d;mov pc,r14
+ swi 0x90007e;mov pc,r14
+ swi 0x90007f;mov pc,r14
+ swi 0x900080;mov pc,r14
+ swi 0x900081;mov pc,r14
+ swi 0x900082;mov pc,r14
+ swi 0x900083;mov pc,r14
+ swi 0x900084;mov pc,r14
+ swi 0x900085;mov pc,r14
+ swi 0x900086;mov pc,r14
+ swi 0x900087;mov pc,r14
+ swi 0x900088;mov pc,r14
+ swi 0x900089;mov pc,r14
+ swi 0x90008a;mov pc,r14
+ swi 0x90008b;mov pc,r14
+ swi 0x90008c;mov pc,r14
+ swi 0x90008d;mov pc,r14
+ swi 0x90008e;mov pc,r14
+ swi 0x90008f;mov pc,r14
+ swi 0x900090;mov pc,r14
+ swi 0x900091;mov pc,r14
+ swi 0x900092;mov pc,r14
+ swi 0x900093;mov pc,r14
+ swi 0x900094;mov pc,r14
+ swi 0x900095;mov pc,r14
+ swi 0x900096;mov pc,r14
+ swi 0x900097;mov pc,r14
+ swi 0x900098;mov pc,r14
+ swi 0x900099;mov pc,r14
+ swi 0x90009a;mov pc,r14
+ swi 0x90009b;mov pc,r14
+ swi 0x90009c;mov pc,r14
+ swi 0x90009d;mov pc,r14
+ swi 0x90009e;mov pc,r14
+ swi 0x90009f;mov pc,r14
+ swi 0x9000a0;mov pc,r14
+ swi 0x9000a1;mov pc,r14
+ swi 0x9000a2;mov pc,r14
+ swi 0x9000a3;mov pc,r14
+ swi 0x9000a4;mov pc,r14
+ swi 0x9000a5;mov pc,r14
+ swi 0x9000a6;mov pc,r14
+ swi 0x9000a7;mov pc,r14
+ swi 0x9000a8;mov pc,r14
+ swi 0x9000a9;mov pc,r14
+ swi 0x9000aa;mov pc,r14
+ swi 0x9000ab;mov pc,r14
+ swi 0x9000ac;mov pc,r14
+ swi 0x9000ad;mov pc,r14
+ swi 0x9000ae;mov pc,r14
+ swi 0x9000af;mov pc,r14
+ swi 0x9000b0;mov pc,r14
+ swi 0x9000b1;mov pc,r14
+ swi 0x9000b2;mov pc,r14
+ swi 0x9000b3;mov pc,r14
+ swi 0x9000b4;mov pc,r14
+ swi 0x9000b5;mov pc,r14
+ swi 0x9000b6;mov pc,r14
+ swi 0x9000b7;mov pc,r14
+ swi 0x9000b8;mov pc,r14
+ swi 0x9000b9;mov pc,r14
+ swi 0x9000ba;mov pc,r14
+ swi 0x9000bb;mov pc,r14
+ swi 0x9000bc;mov pc,r14
+ swi 0x9000bd;mov pc,r14
+ swi 0x9000be;mov pc,r14
+ swi 0x9000bf;mov pc,r14
+ swi 0x9000c0;mov pc,r14
+ swi 0x9000c1;mov pc,r14
+ swi 0x9000c2;mov pc,r14
+ swi 0x9000c3;mov pc,r14
+ swi 0x9000c4;mov pc,r14
+ swi 0x9000c5;mov pc,r14
+ swi 0x9000c6;mov pc,r14
+ swi 0x9000c7;mov pc,r14
+ swi 0x9000c8;mov pc,r14
+ swi 0x9000c9;mov pc,r14
+ swi 0x9000ca;mov pc,r14
+ swi 0x9000cb;mov pc,r14
+ swi 0x9000cc;mov pc,r14
+ swi 0x9000cd;mov pc,r14
+ swi 0x9000ce;mov pc,r14
+ swi 0x9000cf;mov pc,r14
+ swi 0x9000d0;mov pc,r14
+ swi 0x9000d1;mov pc,r14
+ swi 0x9000d2;mov pc,r14
+ swi 0x9000d3;mov pc,r14
+ swi 0x9000d4;mov pc,r14
+ swi 0x9000d5;mov pc,r14
+ swi 0x9000d6;mov pc,r14
+ swi 0x9000d7;mov pc,r14
+ swi 0x9000d8;mov pc,r14
+ swi 0x9000d9;mov pc,r14
+ swi 0x9000da;mov pc,r14
+ swi 0x9000db;mov pc,r14
+ swi 0x9000dc;mov pc,r14
+ swi 0x9000dd;mov pc,r14
+ swi 0x9000de;mov pc,r14
+ swi 0x9000df;mov pc,r14
+ swi 0x9000e0;mov pc,r14
+ swi 0x9000e1;mov pc,r14
+ swi 0x9000e2;mov pc,r14
+ swi 0x9000e3;mov pc,r14
+ swi 0x9000e4;mov pc,r14
+ swi 0x9000e5;mov pc,r14
+ swi 0x9000e6;mov pc,r14
+ swi 0x9000e7;mov pc,r14
+ swi 0x9000e8;mov pc,r14
+ swi 0x9000e9;mov pc,r14
+ swi 0x9000ea;mov pc,r14
+ swi 0x9000eb;mov pc,r14
+ swi 0x9000ec;mov pc,r14
+ swi 0x9000ed;mov pc,r14
+ swi 0x9000ee;mov pc,r14
+ swi 0x9000ef;mov pc,r14
+ swi 0x9000f0;mov pc,r14
+ swi 0x9000f1;mov pc,r14
+ swi 0x9000f2;mov pc,r14
+ swi 0x9000f3;mov pc,r14
+ swi 0x9000f4;mov pc,r14
+ swi 0x9000f5;mov pc,r14
+ swi 0x9000f6;mov pc,r14
+ swi 0x9000f7;mov pc,r14
+ swi 0x9000f8;mov pc,r14
+ swi 0x9000f9;mov pc,r14
+ swi 0x9000fa;mov pc,r14
+ swi 0x9000fb;mov pc,r14
+ swi 0x9000fc;mov pc,r14
+ swi 0x9000fd;mov pc,r14
+ swi 0x9000fe;mov pc,r14
+ swi 0x9000ff;mov pc,r14
+.endtable:
+@-------
+@
+.global _DIV
+@ this code is not GPL, but free
+@ expects divisor in r10 and divident in r9
+@ returns quotient in r12 and remainder in r9
+@ uses r11
+_DIV: MOV r11,#1
+.div1: CMP r10,#0x80000000 @ shift divisor left until top bit set
+ CMPCC r10,r9 @ ...or divisor>divident
+ MOVCC r10,r10,ASL#1 @ shift divisor left if required
+ MOVCC r11,r11,ASL#1 @ shift r11 left if required
+ BCC .div1 @ repeat whilst more shifting required
+ MOV r12,#0 @ ip used to store result
+.div2: CMP r9,r10 @ test for possible subtraction
+ SUBCS r9,r9,r10 @ subtract if divident>divisor
+ ADDCS r12,r12,r11 @ put relivant bit into result
+ MOVS r11,r11,LSR#1 @ shift control bit
+ MOVNE r10,r10,LSR#1 @ halve unless finished
+ BNE .div2 @ loop if there is more to do
+ @ remainder r9
+ @ result in r12
+ mov pc,r14
+@-------
diff --git a/armlinux/macros b/armlinux/macros
new file mode 100644
index 0000000..0292484
--- /dev/null
+++ b/armlinux/macros
@@ -0,0 +1,39 @@
+@--------------------------------------------------------------------
+@
+@ Copyright (C) 2002 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
+@ the Free Software Foundation; either version 2 of the License, or
+@ (at your option) any later version.
+@
+@ This program is distributed in the hope that it will be useful,
+@ but WITHOUT ANY WARRANTY; without even the implied warranty of
+@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+@ GNU General Public License for more details.
+@
+@ You should have received a copy of the GNU General Public License
+@ along with this program; if not, write to the Free Software
+@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+@
+@----------------------------------------------------------------------
+
+.equ ARMCPU, 1
+.macro A_DR,reg,val
+ adr \reg, 0f
+ ldr \reg,[\reg]
+ b 1f
+ 0: .word \val
+1:
+.endm
+
+.macro CALL,address
+ stmfd r13!,{r14}
+ bl \address
+ ldmfd r13!,{r14}
+.endm
+
+.macro RET
+ mov pc,r14
+.pool
+.endm
diff --git a/bin/ARM_Linux/README b/bin/ARM_Linux/README
new file mode 100644
index 0000000..fdc42d5
--- /dev/null
+++ b/bin/ARM_Linux/README
@@ -0,0 +1,11 @@
+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 Z palmtop.
diff --git a/bin/ARM_Linux/e3 b/bin/ARM_Linux/e3
new file mode 100755
index 0000000..ee6569d
--- /dev/null
+++ b/bin/ARM_Linux/e3
Binary files differ
diff --git a/bin/ARM_Linux/e3_2.6.1_arm.ipk b/bin/ARM_Linux/e3_2.6.1_arm.ipk
new file mode 100644
index 0000000..bbe451d
--- /dev/null
+++ b/bin/ARM_Linux/e3_2.6.1_arm.ipk
Binary files differ
diff --git a/bin/Linux/e3_uncompressed b/bin/ARM_Linux/e3em
index 3e01419..3e01419 120000
--- a/bin/Linux/e3_uncompressed
+++ b/bin/ARM_Linux/e3em
diff --git a/bin/ARM_Linux/e3ne b/bin/ARM_Linux/e3ne
new file mode 120000
index 0000000..3e01419
--- /dev/null
+++ b/bin/ARM_Linux/e3ne
@@ -0,0 +1 @@
+e3 \ No newline at end of file
diff --git a/bin/ARM_Linux/e3pi b/bin/ARM_Linux/e3pi
new file mode 120000
index 0000000..3e01419
--- /dev/null
+++ b/bin/ARM_Linux/e3pi
@@ -0,0 +1 @@
+e3 \ No newline at end of file
diff --git a/bin/ARM_Linux/e3vi b/bin/ARM_Linux/e3vi
new file mode 120000
index 0000000..3e01419
--- /dev/null
+++ b/bin/ARM_Linux/e3vi
@@ -0,0 +1 @@
+e3 \ No newline at end of file
diff --git a/bin/ARM_Linux/e3ws b/bin/ARM_Linux/e3ws
new file mode 120000
index 0000000..3e01419
--- /dev/null
+++ b/bin/ARM_Linux/e3ws
@@ -0,0 +1 @@
+e3 \ No newline at end of file
diff --git a/bin/DOS/README b/bin/DOS/README
new file mode 100644
index 0000000..05a950d
--- /dev/null
+++ b/bin/DOS/README
@@ -0,0 +1,3 @@
+e3.exe contains 2 executables in one file,
+one for DOS (the 'stub') and one for Win9x
+
diff --git a/bin/DOS/e3-16.com b/bin/DOS/e3-16.com
deleted file mode 100755
index c1f0e91..0000000
--- a/bin/DOS/e3-16.com
+++ /dev/null
Binary files differ
diff --git a/bin/DOS/e3.exe b/bin/DOS/e3.exe
new file mode 120000
index 0000000..eaadb26
--- /dev/null
+++ b/bin/DOS/e3.exe
@@ -0,0 +1 @@
+../Win9x/e3.exe \ No newline at end of file
diff --git a/bin/ELKS/e3-16 b/bin/ELKS/e3-16
index be06236..1883f7c 100755
--- a/bin/ELKS/e3-16
+++ b/bin/ELKS/e3-16
Binary files differ
diff --git a/bin/FreeBSD/e3 b/bin/FreeBSD/e3
index 70dcb17..5cd99c3 100755
--- a/bin/FreeBSD/e3
+++ b/bin/FreeBSD/e3
Binary files differ
diff --git a/bin/Linux/README b/bin/Linux/README
new file mode 100644
index 0000000..b3397c8
--- /dev/null
+++ b/bin/Linux/README
@@ -0,0 +1,3 @@
+Compresed binaries are no more included.
+e3 is for UTF-8 consoles
+e3_noUTF8 for 'classical' consoles running 'iso-8859-x' etc- \ No newline at end of file
diff --git a/bin/Linux/e3 b/bin/Linux/e3
index e081e1e..7dfa7e2 100755
--- a/bin/Linux/e3
+++ b/bin/Linux/e3
Binary files differ
diff --git a/bin/Linux/e3_noUTF8 b/bin/Linux/e3_noUTF8
new file mode 100755
index 0000000..f910a2d
--- /dev/null
+++ b/bin/Linux/e3_noUTF8
Binary files differ
diff --git a/bin/Linux/e3_selfcompressed b/bin/Linux/e3_selfcompressed
deleted file mode 100755
index ac89eb4..0000000
--- a/bin/Linux/e3_selfcompressed
+++ /dev/null
Binary files differ
diff --git a/bin/Linux/e3_withUTF8 b/bin/Linux/e3_withUTF8
new file mode 120000
index 0000000..3e01419
--- /dev/null
+++ b/bin/Linux/e3_withUTF8
@@ -0,0 +1 @@
+e3 \ No newline at end of file
diff --git a/bin/Linux/e3_yasm b/bin/Linux/e3_yasm
new file mode 100755
index 0000000..7b020eb
--- /dev/null
+++ b/bin/Linux/e3_yasm
Binary files differ
diff --git a/bin/Linux_x86-64/e3_64 b/bin/Linux_x86-64/e3_64
new file mode 100755
index 0000000..0d61c4d
--- /dev/null
+++ b/bin/Linux_x86-64/e3_64
Binary files differ
diff --git a/bin/NetBSD/Makefile b/bin/NetBSD/Makefile
index 6cba5be..8cf2699 100644
--- a/bin/NetBSD/Makefile
+++ b/bin/NetBSD/Makefile
@@ -18,6 +18,7 @@
OS=LINUX # okay for NetBSD
#OS=BEOS
#OS=FREEBSD
+#OS=OPENBSD
#OS=QNX
#OS=W32 ** please use a separate make.bat for W9x **
diff --git a/bin/NetBSD/README b/bin/NetBSD/README
index 4bd0820..2d94a7a 100644
--- a/bin/NetBSD/README
+++ b/bin/NetBSD/README
@@ -1,4 +1,4 @@
This release does NOT carry binaries for
-NetBSD and OpenBSD. Please build your own
+NetBSD. Please build your own
using the included Makefiles. You don't
need GNU-make, so BSD-make will do the job.
diff --git a/bin/NetBSD/e3 b/bin/NetBSD/e3
new file mode 100755
index 0000000..7129ae0
--- /dev/null
+++ b/bin/NetBSD/e3
@@ -0,0 +1,11 @@
+#!/bin/sh
+clear
+cat <<MSG
+Dear e3/NetBSD user,
+
+due less of feedback e3/NetBSD binaries are no more shipped.
+Please build it yourself by running make. Sorry for inconvenience.
+
+Albrecht Kleine
+Sat Mar 16 17:06:04 MET 2002
+MSG \ No newline at end of file
diff --git a/bin/OpenBSD/Makefile b/bin/OpenBSD/Makefile
index e5d29ae..611f5be 100644
--- a/bin/OpenBSD/Makefile
+++ b/bin/OpenBSD/Makefile
@@ -6,7 +6,8 @@
#OS=LINUX
#OS=BEOS
-OS=FREEBSD # okay for OpenBSD
+#OS=FREEBSD
+OS=OPENBSD
#OS=QNX
#OS=W32 ** please use a separate make.bat for W9x **
diff --git a/bin/OpenBSD/README b/bin/OpenBSD/README
index 4bd0820..bbe8ec0 100644
--- a/bin/OpenBSD/README
+++ b/bin/OpenBSD/README
@@ -1,4 +1,2 @@
-This release does NOT carry binaries for
-NetBSD and OpenBSD. Please build your own
-using the included Makefiles. You don't
-need GNU-make, so BSD-make will do the job.
+Currently I do not have a OpenBSD system available.
+So there is no binary included. Sorry.
diff --git a/bin/Win9x/e3.exe b/bin/Win9x/e3.exe
index 31340f8..4681ee3 100755
--- a/bin/Win9x/e3.exe
+++ b/bin/Win9x/e3.exe
Binary files differ
diff --git a/contrib/e3.spec b/contrib/e3.spec
index da8b25c..8006a87 100644
--- a/contrib/e3.spec
+++ b/contrib/e3.spec
@@ -1,8 +1,8 @@
%define Name e3
-%define Version 2.3
+%define Version 2.31
%define Prefix /usr/local
Name: e3
-Version: 2.3
+Version: 2.31
Release: 1
Group: System/Utilities
Summary: e3 is tiny wordstar/emacs/pico/vi/nedit alike editor, well suited for rescue disks.
@@ -10,7 +10,7 @@ Copyright: GPL
Packager : Urs Rau <urs.rau@uk.om.org>
#Conflicts:
#Buildroot: /tmp/%{Name}-%{Version}
-Provides: editor e3 e3-2.3
+Provides: editor e3 e3-2.31
Source: %{Name}-%{Version}.tar.gz
%Description
diff --git a/debian/changelog b/debian/changelog
index 92d11ea..529be4e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,43 @@
-e3 (2.30-1) unstable; urgency=low
+e3 (1:2.61-1) unstable; urgency=low
+
+ * New upstream version
+
+ -- Pawel Wiecek <coven@debian.org> Sat, 8 Jan 2005 17:52:59 +0100
+
+e3 (1:2.50-1) unstable; urgency=low
+
+ * New upstream version
+ * Added amd64 support (closes: #249972)
+ * Updated standards version (no changes required)
+
+ -- Pawel Wiecek <coven@debian.org> Wed, 9 Jun 2004 00:12:26 +0200
+
+e3 (1:2.43-1) unstable; urgency=low
+
+ * New upstream version
+
+ -- Pawel Wiecek <coven@debian.org> Wed, 23 Apr 2003 15:11:24 +0200
+
+e3 (1:2.40-1) unstable; urgency=low
+
+ * New upstream version
+
+ -- Pawel Wiecek <coven@debian.org> Mon, 14 Oct 2002 12:14:03 +0200
+
+e3 (1:2.33-1) unstable; urgency=low
+
+ * New upstream version
+
+ -- Pawel Wiecek <coven@debian.org> Fri, 24 May 2002 13:40:06 +0200
+
+e3 (1:2.31-1) unstable; urgency=low
+
+ * New upstream version
+ * Fixed mistaken version numbering (closes: #144003)
+
+ -- Pawel Wiecek <coven@debian.org> Tue, 23 Apr 2002 11:28:47 +0200
+
+e3 (e3-2.30-1) unstable; urgency=low
* New upstream version
diff --git a/debian/control b/debian/control
index 8a85995..de5edb0 100644
--- a/debian/control
+++ b/debian/control
@@ -3,10 +3,10 @@ Section: editors
Priority: optional
Maintainer: Pawel Wiecek <coven@debian.org>
Build-Depends: debhelper (>> 3.0.0), nasm, upx-ucl
-Standards-Version: 3.5.6
+Standards-Version: 3.6.1
Package: e3
-Architecture: i386
+Architecture: i386 amd64
Depends: ${shlibs:Depends}
Description: A very small editor
This package contains an editor you can call via the following links:
diff --git a/doswin9x/make.bat b/doswin9x/make.bat
index 1dd09da..c923cf6 100644
--- a/doswin9x/make.bat
+++ b/doswin9x/make.bat
@@ -2,7 +2,7 @@
NASMW -DCOM e3-16.asm -l e3com16.lst -o e3-16.com -f bin
@rem
@rem 16 bit DOS .EXE version
-NASMW -DEXE e3-16.asm -l e3exe16.lst -o e3-16e.exe -f bin
+@rem NASMW -DEXE e3-16.asm -l e3exe16.lst -o e3-16e.exe -f bin
@rem
@rem 16 bit DOS EXE-STUB version for e3.exe
NASMW -DEXESTUB e3-16.asm -l e3stub.lst -o e3stub.obj -f obj
diff --git a/e3-16.asm b/e3-16.asm
index 0e399e5..e167632 100644
--- a/e3-16.asm
+++ b/e3-16.asm
@@ -1,6 +1,6 @@
;-------------------------------------------------------------------------
;
-; Copyright (C) 2002 Albrecht Kleine <kleine@ak.sax.de>
+; Copyright (C) 2002,03 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
@@ -18,7 +18,10 @@
;
;--------------------------------------------------------------------------
;
-; FIXME: are pusha/popa valid on the 8086 ?
+; This is e3-16, a 16 bit derived work of 32 bit micro editor e3, ...
+; ...running on ELKS (==Embeddable Linux Kernel Subset) and DOS.
+; Unlike e3 we are supporting WStar key bindings only.
+; Unlike e3 "BAK-files" (*~) are not yet created.
;
TAB equ 8
TABCHAR equ 09h ; ^I
@@ -29,23 +32,24 @@ NEWLINE equ 0ah
errlen equ 100
MAXERRNO equ 30
ERRNOMEM equ 12
+ERRNOIO equ 5
sBREITE equ 80 ;cols
sHOEHE equ 24 ;rows
MAXLEN equ 0x7FFF
maxfilenamelen equ 255
%ifdef ELKS
+ %define LESSWRITEOPS
stdin equ 0
stdout equ 1
O_WRONLY_CREAT_TRUNC equ 1101q
O_RDONLY equ 0
- permissions equ 644q
+ PERMS equ 644q
%else ;--------------
normfarbe equ 07h
kursorfarbe equ 70h
slinefarbe equ 1eh ;yellow on blue
blockfarbe equ 15
O_WRONLY_CREAT_TRUNC equ 0
- permissions equ 0
%endif
section .text
@@ -414,10 +418,10 @@ KeyCtrlQB:mov ax,di
mov di,[blockbegin]
CtrlQB2:or di,di ;exit of no marker set
jnz CQFNum
- mov di,ax
+ xchg di,ax ;old mov di,ax
ret
;-------
-KeyCtrlQK:mov ax,di
+KeyCtrlQK:xchg ax,di ;old mov ax,di
mov di,[blockende]
jmp short CtrlQB2
;-------
@@ -445,6 +449,13 @@ BisNeueZeile:call CheckEOF
mov ax,2 ;0dh,0ah
%endif
CtrlTEnd1:jmp DeleteByteCheckMarker
+;-------
+KeyCtrlQI:mov dx,asklineno
+ call GetAsciiToInteger
+ jbe CtrlQFEnd ;CY or ZR set
+ mov di,sot
+ call LookPD2
+ jmp CheckENum
;----------------------------------------------------------------------
;
; processing special Keys from Ctrl-K menu
@@ -573,6 +584,12 @@ DispNewLine:
mov di,screenline ;line display buffer
xor dx,dx ;reset char counter
mov bl,0 ;reset screen column
+%ifdef LESSWRITEOPS
+ cmp cx,1 ;not in status line
+ jz DCL0
+ call SetColor2 ;set initial character color per each line
+DCL0:
+%endif
DispCharLoop:
cmp si,[fileptr] ;display char @ cursor postion ?
jnz DispCharL1
@@ -584,14 +601,14 @@ DispCharLoop:
add [columne],ax
%ifdef ELKS
stc
- call SetzeInversStatus
+ call SetInverseStatus
jnc DispEndLine
%else
mov ah,kursorfarbe
cmp byte [insstat],1
jz DispEndLine
%endif
-DispCharL1:call SetzeFarbe
+DispCharL1:call SetColor
;-------
DispEndLine:cmp si,bp
ja FillLine ;we have passed EOF, so now fill rest of screen
@@ -629,11 +646,11 @@ ELZ8: cmp bl,byte [columns] ;screen width
jae DispEndLine ;continue reading line until end
inc dx ;also count hidden chars (left margin)
KZA6: cmp dx,[zloffset]
- jbe near DispCharLoop ;load new char (but no display)
+ jbe DispCharLoop ;load new char (but no display)
%ifdef ELKS
stosB
clc
- call SetzeInversStatus
+ call SetInverseStatus
%else
stosw
%endif
@@ -655,7 +672,7 @@ FillLine:push cx ;continue rest of line
mov al,SPACECHAR
stosB ;only 1st char with special attribute
clc
- call SetzeInversStatus
+ call SetInverseStatus
dec cx ;one char less
jz FillLine2
FillLine1:rep stosB ;store the rest blanks
@@ -672,8 +689,9 @@ FillLine2:pop cx
%endif
call ScreenLineShow
dec cx
- jnz near DispNewLine
- call RestKursPos
+ jz XX1
+ jmp DispNewLine
+XX1: call RestKursPos
mov di,[fileptr] ;restore old value
ret
;----------------------------------------------------------------------
@@ -692,7 +710,10 @@ InitVars:mov word [textX],0a0ah ;don't touch si!
mov word [error],'ER'
mov word [error+2],'RO'
mov word [error+4],'R '
- mov word [error+6],' '
+ mov word [error+6],' '
+%ifdef ELKS
+ mov word [perms],PERMS
+%endif
cld
ret
;----------------------------------------------------------------------
@@ -700,12 +721,19 @@ InitVars:mov word [textX],0a0ah ;don't touch si!
; STATUS LINE maintaining subroutines
; at first the writer of a complete line
;
-RestoreStatusLine:pusha ;important e.g. for asksave
+RestoreStatusLine: ;important e.g. for asksave
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push bp
%ifdef ELKS
mov cx,[columns] ;width
push cx
mov al,SPACECHAR ;first prepare the line buffer....
- mov di, screenline
+ mov di,screenline
cld
rep stosb
mov al,0 ;prepare ASCIIZ string
@@ -715,10 +743,10 @@ RestoreStatusLine:pusha ;important e.g. for asksave
jb no_lineNr
mov bl, byte [changed]
mov byte[screenline+1],bl ;changed status
- mov bx,'I ' ;Insert
+ mov bx,'IN' ;Insert
cmp byte [insstat],1
jz rrr1
- mov bx,'O ' ;Overwrite
+ mov bx,'OV' ;Overwrite
rrr1: mov [screenline+4],bx ;mode status
mov di,screenline+stdtxtlen
mov cx,[columns]
@@ -780,16 +808,53 @@ rrr3: lodsb
loop rrr3
%endif
no_lineNr:call StatusLineShow ;now write all at once
- popa
+ pop bp
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
ret
;-------------------------------------------------------------------------
; this function does write the line buffer to screen i.e. terminal
; at begin a special entry point for writing the STATUS line below
;
StatusLineShow:xor cx,cx ;0 for last line
-ScreenLineShow:pusha ;expecting in cx screen line counted from 0
+ScreenLineShow: ;expecting in cx screen line counted from 0
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push bp
%ifdef ELKS
- xor dx,dx
+
+%ifdef LESSWRITEOPS
+ xor bx,bx ;flag
+ mov ax,[columns]
+ add ax,32 ;estimated max ESC sequences extra bytes (i.e. boldlen*X)
+ mul cl
+ mov di,screenbuffer
+ add di,ax
+ cld
+; xor dx,dx ;counter
+ mov si,screenline
+sl_3: lodsb
+; inc dx ;count message length to write
+ cmp di,screenbuffer_end ;never read/write beyond buffer
+ jnb sl5
+ cmp al,[di]
+ jz sl4
+ mov [di],al
+sl5: inc bx ;set flag whether line need redrawing
+sl4: inc di
+ or al,al
+ jnz sl_3
+ or bx,bx ;redraw ?
+ jz NoWrite
+%endif
mov dh,byte [lines]
sub dh,cl
mov dl,0
@@ -798,6 +863,27 @@ ScreenLineShow:pusha ;expecting in cx screen line counted from 0
mov dx,[kurspos2]
call sys_writeKP ;restore cursor pos
%else
+%ifdef DO_NOT_USE_AX_1302 ;very slow (but running on some very old 1980's PC)
+ mov si,screenline
+ cld
+ mov dh,[lines]
+ sub dh,cl
+ mov dl,0
+no1302: call sys_writeKP
+ lodsw
+ mov bl,ah
+ mov bh,0
+ mov ah,09h
+ mov cx,1
+ int 10h
+ mov al,[columns]
+ dec al
+ cmp dl,al
+ inc dl
+ jb no1302
+ mov dx,[kurspos2]
+ call sys_writeKP ;restore cursor pos
+%else
mov ax,1302h
mov bx,0
mov dh,[lines]
@@ -807,7 +893,15 @@ ScreenLineShow:pusha ;expecting in cx screen line counted from 0
mov bp,screenline
int 10h
%endif
- popa
+%endif
+NoWrite:
+ pop bp
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
ret
;-----------------------------------------------------------------------
; write an answer prompt into status line
@@ -818,7 +912,13 @@ WriteMess9MachRand:
call InitStatusLine
WriteMess9:
%ifdef ELKS
- pusha
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push bp
mov di,screenline
mov si,dx
cld
@@ -830,7 +930,13 @@ WriteMLoop:lodsb
stosb
jmp short WriteMLoop
WriteMEnd:call StatusLineShow
- popa
+ pop bp
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
%else ;---------------------
push si
push di
@@ -978,6 +1084,9 @@ xDispChar:push bx ;char in al
%ifdef ELKS
;
; GetChar returns ZERO flag for non ASCII (checked in HandleChar)
+; FIXME: e3-32 bit does the IOctlTerminal only at start/end of editor...
+; ...but here we are calling IOctlTerminal each time (==useless overhead)
+; (see diff e3 release 0.1 -> 0.2)
;
ReadChar:mov ax,di
xchg ax,[old] ;fuer ^QP
@@ -988,10 +1097,8 @@ GetChar:mov cx, 0x5401 ;TCGETS asm/ioctls.h
call SaveTermStruc
push bx
mov bx,dx
- and byte [bx+12],(~2) ;icanon off
- and byte [bx+12],(~1) ;isig (^C) off
- and byte [bx+12],(~8) ;iecho off
- and word [bx+ 0],(~400h) ;ixon off
+ and byte [bx+12],(~2 & ~1 & ~8) ;icanon off, isig (^C) off, echo off
+ and byte [bx+ 1],(~4) ;ixon off was:and word [bx+ 0],(~400h)
pop bx
mov cx, 0x5402 ;TCSETS asm/ioctls.h
call IOctlTerminal ;dx is termios pointer
@@ -1000,7 +1107,7 @@ readloop:call ReadOneChar
jne No7F ; special case: remap DEL to Ctrl-H
mov al,8
No7F: cmp al,27 ; ESC ?
- jnz near ready_2
+ jnz ready_2
call ReadOneChar ;e.g. [ for ELKS vt100
mov bl,48h ;48h up - the lowest
cmp al,'A'
@@ -1061,7 +1168,7 @@ GetChar:mov ah,0
;
; helper subroutine called by DispNewScreen
;
-SetzeInversStatus:
+SetInverseStatus:
push si ; returns zero flag
push cx
mov cx,boldlen
@@ -1077,7 +1184,7 @@ SIS1: cmp byte[inverse],1
jnz SIS3
mov byte[inverse],0
mov byte[isbold],0
- mov si,bold0
+SIS_5: mov si,bold0
rep movsb
SIS3: clc
SIS4: pop cx
@@ -1087,25 +1194,16 @@ SIS4: pop cx
;-------
; another helper subroutine called by DispNewScreen
;
-SetzeFarbe:
+SetColor:
%ifdef ELKS
- cmp byte [showblock],0
- je SetzeFarbeEnde1
- cmp word [blockbegin],0
- je SetzeFarbeEnde1
- cmp [blockbegin],si
- ja SetzeFarbeEnde1
- cmp si,[blockende]
- jb SetzeFarbeESC ;cy is set
-SetzeFarbeEnde1:clc
-SetzeFarbeESC:
+ call IsShowBlock
push si ;expects cy flag:bold / nc:normal
push cx
mov cx,boldlen
jnc SFEsc1
cmp byte [isbold],1 ;never set bold if it is already bold
jz SFEsc2
- mov si,bold1
+SCEsc_2:mov si,bold1
rep movsb
mov byte [isbold],1
jmp short SFEsc2
@@ -1117,18 +1215,26 @@ SFEsc1: cmp byte [isbold],0 ;ditto
SFEsc2: pop cx
pop si
ret
+%ifdef LESSWRITEOPS
+SetColor2:push si
+ push cx
+ call IsShowBlock
+ mov cx,boldlen
+ jnc SIS_5
+ jmp short SCEsc_2
+%endif
%else ;---------------------------------
mov ah,normfarbe
cmp byte[showblock],0
- je SetzeFarbeEnde
+ je SetColorEnde
cmp word [blockbegin],0
- je SetzeFarbeEnde
+ je SetColorEnde
cmp [blockbegin],si
- ja SetzeFarbeEnde
+ ja SetColorEnde
cmp si,[blockende]
- jnb SetzeFarbeEnde
+ jnb SetColorEnde
mov ah,blockfarbe
-SetzeFarbeEnde:ret
+SetColorEnde:ret
%endif
;-----------------------------------------------------------------------
;
@@ -1147,9 +1253,10 @@ sl3: lodsb
inc dx ;count message length to write
or al,al
jnz sl3
+ dec dx ;one too much
pop si
mov bx,stdout ;first argument: file desc (stdout)
- mov cx,screenline ;second argument: pointer to message to write
+ mov cx,screenline ;second argument: pointer to message to write
call WriteFile
pop cx
or cx,cx
@@ -1158,21 +1265,35 @@ sl3: lodsb
sl2: ret
;-------
sys_writeSLColors1:
- pusha
- mov bx,stdout
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push bp
mov cx,screencolors1 ;set bold yellow on blue
- mov dx,scolorslen
- call WriteFile
- popa
- ret
+ jmp short SwSL
;-------
sys_writeSLColors0:
- pusha
- mov bx,stdout
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push bp
mov cx,screencolors0 ;reset to b/w
+SwSL: mov bx,stdout
mov dx,scolorslen
call WriteFile
- popa
+ pop bp
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
ret
%endif
;----------------------------------------------------------------------
@@ -1406,6 +1527,7 @@ KursorStatusLine:mov dh,[lines]
RestKursPos:mov dx,[kurspos]
SetKursPos:mov [kurspos2],dx ;saves reading cursor pos (0,0)
%ifndef ELKS
+sys_writeKP:
push ax
mov ah,2
mov bh,0
@@ -1413,13 +1535,26 @@ SetKursPos:mov [kurspos2],dx ;saves reading cursor pos (0,0)
pop ax
ret
%else ;---------------------------------------------------------------
-sys_writeKP:pusha
+sys_writeKP:
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push bp
call make_KPstr
mov bx,stdout ;file handle (stdout)
mov cx,setkp ;second argument: pointer to message to write
mov dx,setkplen ;third argument: message length
call WriteFile
- popa
+ pop bp
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
ret
;-------
; make ESC sequence appropriate to most important terminals
@@ -1543,7 +1678,14 @@ DeleteByteEnd:ret
; read a file name for block operations
; expecting message text ptr in dx
;
-getBlockName:pusha
+getBlockName:
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push bp
call WriteMess9MachRand
mov cx,blockpath
mov dx,maxfilenamelen
@@ -1551,7 +1693,13 @@ getBlockName:pusha
pushf
call RestKursPos
popf
- popa
+ pop bp
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
ret
;----------------------------------------------------------------------
;
@@ -1583,7 +1731,16 @@ GetFile:mov bx,filepath
mov bp,di
mov bx,ax ;file descriptor
js NewFileEnd
-OldFile:mov dx,MAXLEN
+OldFile:
+%ifdef SYS_FSTAT
+ call Fstat ;kernel returns error 38
+ js DosEjmp0
+ mov ax,[fstatbuf+8] ;better define some structure
+ and ax,777q
+ mov [perms],ax
+%endif
+;-------
+ mov dx,MAXLEN
mov cx,di ;sot
call ReadFile
mov dx,ax ;bytes read
@@ -1593,7 +1750,9 @@ OldFile:mov dx,MAXLEN
;-------
mov word [errno],ERRNOMEM
cmp dx,MAXLEN ;MAXLEN read amount is too much
- jz near DosError
+ jnz XX2
+ jmp DosError
+XX2:
;-------
mov bp,sot ;eof_ptr=filesize+start_of_text
add bp,dx
@@ -1614,8 +1773,8 @@ SaveFile:cmp byte [changed],UNCHANGED
call WriteMess9
mov cx,O_WRONLY_CREAT_TRUNC
mov bx,filepath
- mov dx,permissions
%ifdef ELKS
+ mov dx,[perms]
call OpenFile
%else
call CreateFile
@@ -1627,10 +1786,11 @@ SaveFile2:sub dx,cx ;dx=filesize= eof-bof
mov bx,ax ;file descriptor
call WriteFile
js DosEjmp ;DosError
- mov word[errno],5 ;just in case of....
+ mov word[errno],ERRNOIO ;just in case of....
cmp ax,dx ;all written?
- jnz near DosError
- call CloseFile
+ jz XX4
+ jmp DosError
+XX4: call CloseFile
js DosEjmp ;DosError
SaveFile3:ret
;------------------------------
@@ -1638,11 +1798,12 @@ SaveFile3:ret
;
SaveBlock:mov dx,blocksave
call getBlockName
- jc near DE2
- mov cx,O_WRONLY_CREAT_TRUNC
+ jnc XX3
+ jmp DE2
+XX3: mov cx,O_WRONLY_CREAT_TRUNC
mov bx,blockpath
- mov dx,permissions
%ifdef ELKS
+ mov dx,[perms]
call OpenFile
%else
call CreateFile
@@ -1654,14 +1815,11 @@ SaveBlock:mov dx,blocksave
;-------
; read a block into buffer (by ^KR)
;
-ReadBlock:
-%ifdef ELKS
- ret ;not ready due lseek
-%endif
- mov dx,blockread
+ReadBlock:mov dx,blockread
call getBlockName
- jc near DE2
- xor cx,cx ;i.e O_RDONLY
+ jnc XX5
+ jmp DE2
+XX5: xor cx,cx ;i.e O_RDONLY
mov bx,blockpath
call OpenFile
DosEjmp:js DosError
@@ -1682,7 +1840,6 @@ DosEjmp:js DosError
push ax
call InsertByte
pop dx ;file size
- mov word [errno],ERRNOMEM
jc DosError
mov cx,di ;^offset akt ptr
call ReadFile
@@ -1690,7 +1847,7 @@ DosEjmp:js DosError
mov cx,ax ;bytes read
call CloseFile
js DosError
- mov word[errno],5 ;just in case of....
+ mov word[errno],ERRNOIO ;just in case of....
cmp dx,cx ;all read?
jnz DosError
ReadBlock2:jmp NewFileEnd
@@ -1750,6 +1907,34 @@ noHex: stosb
ret
;-------
;
+; GetAsciiToInteger reads integer value from keyboard (only > 0)
+;
+GetAsciiToInteger:call WriteMess9MachRand
+ mov cx,blockpath
+ mov dx,maxfilenamelen
+ call InputString
+ call AskFor_Ex ;repair status line & set cursor pos / preserve flags
+ mov ax,0 ;preserve flags
+ mov cx,ax
+ mov bl,9 ;bl == base-1
+ jc AIexit2
+ mov si,blockpath
+ cld
+AIload: lodsb
+ sub al,'0'
+ js AIexit
+ cmp al,bl
+ ja AIexit
+ mov dx,cx
+ shl cx,3 ;* 8
+ add cx,dx ;+ 1
+ add cx,dx ;+ 1
+ add cx,ax ;+digit
+ jmp short AIload
+AIexit: or cx,cx ;ret ecx
+AIexit2:ret ;CY or ZR if error
+;-------
+;
; expects curent column in dx
; returns # spaces up to next tabulated location in AH
;
@@ -1762,6 +1947,19 @@ SpacesForTab:push cx
pop cx
ret
;-------
+; a little helper for SetColor* functions
+;
+IsShowBlock:cmp byte [showblock],0
+ je SBlock
+ cmp word [blockbegin],0
+ je SBlock
+ cmp [blockbegin],si
+ ja SBlock
+ cmp si,[blockende]
+ jb SB_ret
+SBlock: clc
+SB_ret: ret
+;-------
GetEditScreenSize:
mov al,sHOEHE-1
mov byte [lines],al
@@ -1923,17 +2121,40 @@ WriteFile:mov ax,4 ;(4==sys_write)
OpenFile:mov ax,5
jmp short IntCall ;cx mode / bx path / dx permissions (if create)
;-------
-CloseFile:pusha
+CloseFile:
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push bp
mov ax,6 ;bx is file desc
int 80h
- popa
+ pop bp
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
xor ax,ax ;always return "NO_ERROR"
ret
;-------
SeekFile:xor cx,cx ;offset
+ mov word [seekhelp],cx ;due special ELKS kernel interface
+ mov word [seekhelp+2],cx ;due special ELKS kernel interface
+ mov cx,seekhelp ;2nd arg is a ptr to long, not a long
mov ax,19 ;system call number (lseek)
+ push bx
+ int 0x80 ;bx file / dx method
+ pop bx
+ or ax,ax
+ js IC2
+ mov ax,word [seekhelp] ;seek result: file size. 32 bit Linux is different here!
+ mov dx,word [seekhelp+2]
+ ret
+;-------
IntCall:int 0x80 ;bx file / dx method
- neg ax
+IC2: neg ax
mov [errno],ax
neg ax ;set flags also
ret
@@ -1942,6 +2163,12 @@ IOctlTerminal:mov bx,stdin ;expects dx termios or winsize structure ptr
mov ax,54 ;54 == the ioctl syscall no.
int 80h ;cx TCSETS,TCGETS,TIOCGWINSZ
ret
+;-------
+%ifdef SYS_FSTAT
+Fstat: mov cx,fstatbuf
+ mov al,108 ;currently (April 2002) one gets
+ jmp short IntCall ;error code 38: Function not implemented
+%endif
%else ;---------------
;
; ******beside int 21h we have also BIOS calls:
@@ -1959,7 +2186,8 @@ Intcall:int 21h ;=ax file
mov ax,-1
NoErr: test ax,ax ;set sign flag
ret
-CreateFile:xchg bx,dx ;elks style
+CreateFile:xor dx,dx
+ xchg bx,dx ;elks style
xor cx,cx ;input bx=^path
mov ah,3ch
jmp short Intcall
@@ -2028,7 +2256,7 @@ Qtable db 45h ;^q@ ditto for ^Q menu
db 55h ;^qf
db 45h ;^qg
db 45h ;^qh
- db 45h ;^qi
+ db 4Ah ;^qi
db 45h ;^qj
db 5bh ;^qk
db 45h ;^ql
@@ -2052,7 +2280,7 @@ jumptab1: ; The associated key values originaly were BIOS scan codes...
; ... to some places shortly after 5dh (i.e. shift F10).
; Using terminals the F-keys are not supported on ELKS (but DOS only).
lowest equ 3bh
- dw KeyCtrlKV ;3bh ^KV F1 (DOS only)
+ dw SimpleRet ;3bh
dw KeyCtrlL ;3ch ^L F2 (ditto)
dw KeyCtrlKR ;3dh ^KR F3 (etc)
dw KeyCtrlKW ;3eh ^KW
@@ -2067,7 +2295,7 @@ lowest equ 3bh
dw KeyHome ;47h
dw KeyUp ;48h
dw KeyPgUp ;49h
- dw SimpleRet ;4ah ^QDel
+ dw KeyCtrlQI ;4Ah
dw KeyLeft ;4bh
dw KeyCtrlQP ;(5 no num lock)
dw KeyRight ;4dh
@@ -2079,7 +2307,7 @@ lowest equ 3bh
dw KeyDel ;53H
dw KeyCtrlQA ;54h ^QA sF1
dw KeyCtrlQF ;55h ^QF sF2
- dw SimpleRet ;56h
+ dw KeyCtrlKV ;56h ^KV
dw KeyCtrlKH ;57h
dw KeyCtrlQC ;58h
dw KeyCtrlQR ;59h
@@ -2121,6 +2349,7 @@ filesave db ' SAVE: ',0
asksave db 'SAVE? Y/n',0
blockread db '^KR NAME:',0
blocksave db '^KW NAME:',0
+asklineno db 'GO LINE :',0
askfind db '^QF FIND:',0
askreplace1 db '^QA REPL:',0
askreplace2 db '^QA WITH:',0
@@ -2245,7 +2474,7 @@ LD
newline:
db 10
help:
-db "MicroEditor e3 /16bit v0.1 GPL (C) 2002 A.Kleine <kleine@ak.sax.de>"
+db "MicroEditor e3/16bit v0.3 GPL (C) 2002,03 A.Kleine <kleine@ak.sax.de>"
LD
db "Enter filename or leave with RETURN"
LD
@@ -2273,6 +2502,8 @@ db "Quick- ^QS Home ^QD End ^QR BOF ^QC EOF"
LD
db "-Move: ^QB Blk Begin ^QK Blk End ^F Next Word ^A Prev Word"
LD
+db " ^QI Go Line#"
+LD
LD
db "Delete: ^T Word ^Y Line ^H Left ^G Chr"
LD
@@ -2304,9 +2535,20 @@ EXE_startbss:
read_b resw 1 ;buffer for GetChar
isbold resw 1 ;control of bold display of ws-blocks
inverse resw 1
+ seekhelp resd 1 ;syscall helper (for seeking more than 16 bit range)
+ perms resw 1
+%ifdef SYS_FSTAT
+ fstatbuf resb 64 ;prepared for later
+%endif
%else ;-----
zeilenangabe resb 12 ;buffer for showlinenum
%endif
+%ifdef LESSWRITEOPS
+ screenbuffer_size equ 62*(160+32) ;estimated 62 lines 160 columns, 32 byte ESC seq (ca.12k)
+ screenbuffer_dwords equ screenbuffer_size/4
+ screenbuffer resb screenbuffer_size
+ screenbuffer_end equ $ ;If you really have higher screen resolution,
+%endif
errno resw 1 ;used similar libc, but not excactly equal
error resb errlen ;reserved space for string: 'ERROR xxx:tttteeeexxxxtttt',0
columne resw 1 ;helper for display of current column
diff --git a/e3.asm b/e3.asm
index 9bb790a..0a9ce7f 100644
--- a/e3.asm
+++ b/e3.asm
@@ -1,6 +1,6 @@
;--------------------------------------------------------------------
;
-; e3.asm v2.21 Copyright (C) 2000-2002 Albrecht Kleine <kleine@ak.sax.de>
+; e3.asm v2.6.1 Copyright (C) 2000-2005 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
@@ -45,13 +45,13 @@ _start: call SetTermStruc
call GetCommandLineA ;eax points to either D:\PATH\E3.EXE args1 args2 args3...
xchg eax,esi ; or "d:\path\e3.exe"
;-- for debug only -- ; or e3.exe "args"
- ;pusha
+ ;PUSH_ALL
;push dword 0 ;single OK button
;push dword esi
;push dword esi
;push dword 0
;call MessageBoxA ;show cmd line
- ;popa
+ ;POP_ALL
;--------------------
cld
xor ebx,ebx
@@ -136,13 +136,20 @@ NoArg: mov eax,mode
prog: lodsb
or al,al
jne prog ;get program name
+%ifdef AMD64
+ lea rsi,[rsi-5]
+%else
lea esi,[esi-5]
+%endif
call SetEditMode
jz prog1
mov byte [eax],DEFAULT_MODE ;store current editor mode
prog1:
;-------
pop esi ;Linux: esi points to first arg (filename)
+%ifdef NEW_CURSOR_MGNT
+ call SetCursorBlock
+%endif
%endif
%endif
%endif
@@ -157,12 +164,45 @@ morearg:pop ecx ;arguments until NULL
;-------
moreenv:pop ecx
jecxz ReStart
+%ifndef ARMCPU
cmp dword[ecx],'TERM' ;a short test for "TERM=linux"
jnz moreenv
cmp dword[ecx+5],'linu'
+%else
+ cmp byte[ecx],'T'
+ jnz moreenv
+ cmp byte[ecx+1],'E'
+ jnz moreenv
+ cmp byte[ecx+2],'R'
+ jnz moreenv
+ cmp byte[ecx+3],'M'
+ jnz moreenv
+ cmp byte[ecx+5],'l'
+ jnz ReStart
+ cmp byte[ecx+6],'i'
+ jnz ReStart
+ cmp byte[ecx+7],'n'
+ jnz ReStart
+ cmp byte[ecx+8],'u'
+%endif
jnz ReStart
add byte[revvoff],boldlen ;special inverse cursor on linux terminals
%endif
+%ifdef UTF8RTS ;==currently unused by default
+ mov ecx,getPos ;second argument: pointer to message to write
+ push byte gPlen ;third argument: message length
+ pop edx
+ call WriteFile0
+ mov ecx,screenbuffer ;pointer to buf
+ push byte 10
+ pop edx
+ call ReadFile0
+ mov al,[ecx+eax-2] ;al == '2' @ UTF8 terminal, else al == '3'
+ cmp al,'2'
+ jne noUTFterm
+ mov byte [isUTF8],al
+noUTFterm:
+%endif
;-------
ReStart:call NewFile
jc E3exit
@@ -211,6 +251,9 @@ E3exit: call KursorStatusLine
%endif
mov ecx,text ;enter next line on terminal NEWLINE is @ byte [text]
call WriteFile00
+%ifdef NEW_CURSOR_MGNT
+ call SetCursorNormal
+%endif
;-------
mov ebx,tempfile2 ;undo info (if exist)
call Unlink
@@ -270,7 +313,19 @@ ISVI1: ;in VI: most control is done in command mode...
NormChar:test byte [mode], EM | PI
jz NOEM0
call ShowBl0 ;i.e. "mov byte [showblock],0"
-NOEM0: call CheckMode
+NOEM0:
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_A
+%endif
+ mov bl,al
+ and bl,0C0h
+ cmp bl,080h ;byte 2,3,4.. always insert
+ je NormCh2
+noUTF_A:
+%endif
+ call CheckMode
%ifdef USE_UNDO
jz NormCh2
call DataForUndoOverwrite
@@ -292,6 +347,21 @@ noEOL:
jc InsWriteEnd ;error: text buffer full
OverWriteChar:cld
stosb
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_B
+%endif
+ xor eax,eax
+ dec eax
+OWCloopUTF8:inc eax
+ mov bl,byte [edi+eax]
+ and bl,0C0h
+ cmp bl,080h ;delete byte 2,3,4,....
+ je OWCloopUTF8
+ call DeleteByte
+noUTF_B:
+%endif
SetChg: mov byte [changed],CHANGED
InsWriteEnd:ret
;-------
@@ -301,7 +371,11 @@ KeyVICmdr:call ReadOneChar ;repl one char (except newline)
cmp al,RETURN
jnz KeyVICmdr1
mov al,NEWLINE
-KeyVICmdr1:mov byte [edi],al
+KeyVICmdr1:
+%ifdef USE_UNDO
+ call DataForUndoOverwrite
+%endif
+KeyVICmdr2:mov byte [edi],al
jmp short SetChg
;-------
KeyEmaCtrlQ:mov esi,asknumber
@@ -347,7 +421,11 @@ ExtAscii:mov bl,ah ;don't use al (carries char e.g. TAB)
xor eax,eax
mov [EmaCtrl],eax
CompJump2:mov bh,0
+%ifdef YASM
+ and ebx,0ffh
+%else
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
add ebx,_start ;offset inside code
;-------
@@ -375,8 +453,10 @@ BZNret: ret
KeyRetNoInd:xor eax,eax
jmp short KeyRetNInd
KeyRet:
+;;; %define NO_AUTO_INDENT ;for Izzy
+%ifndef NO_AUTO_INDENT
%ifdef SELFTEST
-xor eax,eax
+ xor eax,eax
%else
call CheckMode
jnz OvrRet
@@ -396,6 +476,9 @@ KeyRetSrch:inc eax ;search non (SPACE or TABCHAR)
cmp byte [esi+eax],TABCHAR
je KeyRetSrch
%endif
+%else
+ xor eax,eax
+%endif
KeyRetNInd:push esi
push eax ;eax is 0 or =indented chars
call GoDown
@@ -465,6 +548,17 @@ SetColumn:mov ecx,[ch2linebeg] ;=maximal columns
xor edx,edx ;counts visible columns i.e. expand TABs
dec edi
SCloop: inc edi
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_C
+%endif
+ mov bl,byte [edi]
+ and bl,0C0h
+ cmp bl,080h ;do not count byte 2,3,4,.. for columns in UTF8 chars
+ jz SCloop
+noUTF_C:
+%endif
cmp edx,ecx ;from CountColToLineBeginVis
jae SCret
cmp byte [edi],NEWLINE ;don't go beyond line earlier line end
@@ -528,7 +622,13 @@ KeyIns: not byte [insstat]
KeyIns2:call IsEmMode
jnz KeyIns3
mov byte [showblock],al
-KeyIns3:ret
+KeyIns3:
+%ifdef NEW_CURSOR_MGNT
+ cmp byte [insstat],1
+ jne near SetCursorNormal
+ jmp SetCursorBlock
+%endif
+ ret
;-------
KeyVICmdJ:call KeyEnd
jmp short KeyDel
@@ -538,7 +638,18 @@ KeyDell:call KeyLeft
KeyDel: cmp edi,ebp
jnb KeyIns3
xor eax,eax ;delete one @ cursor
- inc eax
+KDloopUTF8:inc eax
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_D
+%endif
+ mov bl,byte [edi+eax]
+ and bl,0C0h
+ cmp bl,080h
+ je KDloopUTF8 ;delete one more at UTF-8 byte 2,3,4,....
+noUTF_D:
+%endif
%ifdef W32LF
cmp byte [edi-1],RETURN
jnz KD2
@@ -546,23 +657,53 @@ KeyDel: cmp edi,ebp
inc eax
KD2:
%endif
+;-------
+ call IsViMode
+ jne near DeleteByte
+ mov esi,edi ;make vi's x and X pasteable
+ mov byte [VInolinebased],1
+ call KeyEmaAltW2
jmp DeleteByte
+;-------
KeyDell2:cmp edi,sot ;delete newline char
jbe KeyIns3
dec dword [linenr]
dec edi
jmp KeyCtrlT1
;-------
-KeyEmaCtrlT:cmp edi,sot ;xchg 2 chars
+KeyEmaCtrlT:
+%ifdef UTF8
+ ret ;FIXME!!
+%else
+ cmp edi,sot ;xchg 2 chars
jbe KeyRightEnd
cmp byte [edi],NEWLINE
jnz KECT
dec edi
-KECT: mov al,byte [edi]
+KECT:
+%ifdef USE_UNDO
+ call DataForUndoXchange
+%endif
+ mov al,byte [edi]
xchg al,byte [edi-1]
- call KeyVICmdr1 ;mov byte [edi],al / mov byte [changed],CHANGED
+ call KeyVICmdr2 ;mov byte [edi],al / mov byte [changed],CHANGED
+%endif
;-------
-KeyRight:cmp byte [edi],NEWLINE
+KeyRight:
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_E
+%endif
+ inc edi
+ mov al,byte [edi] ;check for UTF byte 2,3,4,..
+ and al,0c0h
+ cmp al,080h
+ je KeyRight
+ dec edi ;due inc edi above
+noUTF_E:
+%endif
+ cmp byte [edi],NEWLINE
jnz KeyRNoMargin
call CheckEof
jae KeyRightEnd
@@ -644,6 +785,7 @@ KeyVIfsearch:push byte 1
KVIf: mov byte[grossklein],0ffh
jmp short KeyECtS1
;-------
+PicoCtrlTpico:mov [PicoSearch],edi ;store begin of search (because wrap around EOF)
KeyEmaAltPer:push byte 1 ;s&repl
pop dword[vorwarts]
mov byte[grossklein],0dfh
@@ -768,7 +910,13 @@ KeyCtrlQY:call CountToLineEnd
dec eax ;keep RETURN 0dh char if exist
KCQY:
%endif
- jmp short CtrlTEnd1
+ call IsViMode
+ jnz CtrlTEnd1
+ call CtrlTEnd1
+ jmp KeyLeft
+;-------
+KeyCmddw:call CountToWordBeginVIstyle
+ jmp short NO_EM05
;-------
KeyCtrlY:call CountToLineBegin
sub edi,eax ;edi at begin
@@ -811,7 +959,13 @@ CtrlTEnd1:call CheckEof
KeyEmaCtrlW:mov ecx,[showblock]
cmp byte[mode],PI
jne NOPI1
-KECW: jecxz KeyCtrlY ; changed by cov
+KECW:
+%ifndef YASM
+ jecxz KeyCtrlY
+%else
+ or ecx,ecx
+ jz near KeyCtrlY
+%endif
mov ecx,[EmaMark]
jecxz KECW
jmp short NOPI2
@@ -838,7 +992,8 @@ JmpCQFN2:jmp JmpCQFN
;-------
KeyCtrlKH:xor byte [showblock],1 ;flip flop
SimpleRet3:ret
-KeyCtrlKK:mov [blockende],edi
+KeyCtrlKK: ;UTF-8 :no special handling needed, because block end...
+ mov [blockende],edi ;... points to first byte _after_ block
jmp short ShowBl1
;-------
KeyCtrlKC:call CopyBlock
@@ -867,8 +1022,8 @@ KeyCtrlKV:call CopyBlock
jb CtrlKC2
mov [blockende],edi
sub edi,eax
-KeyCtrlKB:mov [blockbegin],edi
-ShowBl1:mov byte [showblock],1
+KeyCtrlKB:mov [blockbegin],edi ;UTF-8: no special handling needed, because block begin...
+ShowBl1:mov byte [showblock],1 ;...points to _first_ byte in block
SimpleRet2:ret
ShowBl0:mov byte [showblock],0
ret
@@ -928,14 +1083,14 @@ KeyEmaCtrlXW:call GetBlockName
jc CtrlKSEnd
mov esi,blockpath
XW1: cld
- pusha
+ PUSH_ALL
mov edi,filepath
XW0: lodsb
stosb ;copy to blockpath to filepath
or al,al
jne XW0
stosb
- popa
+ POP_ALL
KeyCtrlKS0:call SetChg ;i.e. "mov byte [changed],CHANGED" to save it really
;-------
KeyCtrlKS:call SaveFile
@@ -1030,6 +1185,9 @@ KeyVICmdS:call KeyHome
mov byte [VInolinebased],1
jmp short KeyVICmdI
KeyVICmdd:call ReadOneChar
+ cmp al,'w' ;word (greetings to ma_ko)
+ mov byte [VInolinebased],1
+ je near KeyCmddw
cmp al,'d' ;"delete"
mov byte [VInolinebased],0
je near KeyCtrlY
@@ -1050,7 +1208,13 @@ KeyVICmdI:call KeyVI1Char
jmp short KeyVImode0
;-------
KeyVICmdp:mov ecx,[EmaKiSize] ;check this before call KeyEmaCtrlY
-jmpKFC2:jecxz KFC2
+jmpKFC2:
+%ifdef YASM
+ or ecx,ecx
+ jz KFC2
+%else
+ jecxz KFC2
+%endif
cmp byte [VInolinebased],1
jz KeyVICmdpnLB
call OvrRet ;ugly
@@ -1083,15 +1247,25 @@ KeyVICmdC:call KeyEmaCtrlK
mov byte [VInolinebased],1
jmp short KeyVImode0
;-------
-KeyVICmdpnLB:call KeyVICP2
-KeyEnd: call CountToLineEnd
- add edi,eax ;points to a LINEFEED (0ah) char
- ret
-;-------
-KeyVICmdPnLB:call KeyLeft ;not_Line_Based mode
- call KeyVICmdpnLB
+KeyVICmdpnLB:call KeyRight ;not_Line_Based mode
+KeyVICmdPnLB:call KeyVICP2
+ add edi,[EmaKiSize] ;Wed Apr 10 18:11:42 MEST 2002
;------- cont
-KeyLeft:cmp byte [edi-1],NEWLINE
+KeyLeft:
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_F
+%endif
+ dec edi
+ mov al,byte [edi] ;check for UTF byte 2,3,4,..
+ and al,0c0h
+ cmp al,080h
+ je KeyLeft
+ inc edi
+noUTF_F:
+%endif
+ cmp byte [edi-1],NEWLINE
jnz KeyLNoMargin
cmp edi,sot ;i.e. CheckBof
je KeyLeftEnd
@@ -1106,6 +1280,10 @@ KeyLNoMargin:dec edi
%endif
KeyLeftEnd:ret
;-------
+KeyEnd: call CountToLineEnd
+ add edi,eax ;points to a LINEFEED (0ah) char
+ ret
+;-------
KeyVImode1:push byte 1
KVim1: pop eax
mov byte [VICmdMode],al
@@ -1187,7 +1365,12 @@ NoEmBlock:call GetEditScreenSize ;check changed tty size
DispShortLine:call LookPgBegin ;go on 1st char upper left on screen
mov esi,edi ;esi for reading chars from text
mov ecx,[lines]
+%ifndef YASM
jecxz Kviex
+%else
+ or ecx,ecx
+ jz near Kviex
+%endif
cld
mov bh,-1 ;first line
DispNewLine:inc bh ;new line
@@ -1243,14 +1426,29 @@ ELZ9:
%ifndef W32
cmp al,7fh
jb ELZ7
- cmp al,9Fh
- ja ELZ7
+%ifndef UTF8
mov al,'.'
+%endif
ELZ7:
%endif
cmp bl,byte [columns] ;screen width
jae DispEndLine ;continue reading line until end
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_G
+%endif
+ push eax
+ and al,0c0h
+ cmp al,080h
+ pop eax
+ jz ELUTF8 ;do NOT count
+noUTF_G:
+ inc edx
+ELUTF8:
+%else
inc edx ;also count hidden chars (left margin)
+%endif
cmp edx,[zloffst]
jbe ELZ5 ;load new char (but no display)
stosB
@@ -1258,6 +1456,18 @@ ELZ7:
clc
call SetInverseStatus
%endif
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_H
+%endif
+ push eax
+ and al,0c0h
+ cmp al,080h
+ pop eax
+ jz ELZ5
+noUTF_H:
+%endif
inc bl ;counts displayed chars only
ELZ5: jmp DispCharLoop
;-------
@@ -1321,10 +1531,10 @@ SIS2: mov ecx,edi
sub ecx,edx ;only current pos up to line end
rep stosw
SIS3: clc
-SIS4: popa
+SIS4: POP_ALL
ret
SetColor: ;expects cy flag:bold / nc:normal
- pusha
+ PUSH_ALL
call IsShowBlock
jnc SCEsc1
cmp byte [isbold],1 ;never set bold if it is already bold
@@ -1336,7 +1546,7 @@ SCEsc1: cmp byte [isbold],0 ;ditto
jz SIS4
jmp short SIS6
;-------
-SetColor2:pusha
+SetColor2:PUSH_ALL
call IsShowBlock
jnc SIS5
jmp short SCEsc2
@@ -1442,7 +1652,7 @@ StatusLineShow:
%endif
xor ecx,ecx ;0 for bottom line
;-------
-ScreenLineShow:pusha ;expecting in ecx screen line counted from 0
+ScreenLineShow:PUSH_ALL ;expecting in ecx screen line counted from 0
%ifdef LESSWRITEOPS
%ifdef W32 ;screen attrib caching
mov eax,[columns]
@@ -1534,7 +1744,7 @@ sl4: inc edi
mov edx,[kurspos2]
call sys_writeKP ;restore old cursor pos
%endif
-NoWrite:popa
+NoWrite:POP_ALL
ret
;-------
; a helper for ScreenLineShow
@@ -1543,12 +1753,12 @@ sys_writeSLColors:
%ifndef W32
jecxz syswSL ;do nothing if not in status line
ret
-syswSL: pusha
+syswSL: PUSH_ALL
xchg eax,ecx ;parameter points to ESC-xxx color string
push byte scolorslen
pop edx
call WriteFile0
- popa
+ POP_ALL
%endif
ret
;----------------------------------------------------------------------
@@ -1571,6 +1781,8 @@ InputString0:call WriteMess9MakeLine
; expecting max count byte in edx
; return length in eax, CY for empty string (or user abort)
;
+; *** added some more line editing (ak, Mon Apr 12 2004) ***
+;
InputString:push ecx
push edi
push byte 2
@@ -1579,22 +1791,59 @@ InputString:push ecx
push eax ;LONGER: push dword [VICmdMode], mov byte [VICmdMode],2
push dword [kurspos2]
mov ebx,[columns]
+%ifndef LINUX
+ dec ebx ;*BSD do not use lower right screen place...
+%endif ;...due some unwanted vertical scrollung
lea ebx,[ebx-stdtxtlen]
- cmp edx,ebx ;TODO enable some scrolling:
+ cmp edx,ebx ;TODO should enable some scrolling:
jb IS8 ;not yet ready, so truncate at end of line
- mov edx,ebx
-IS8: xor ebx,ebx
- mov edi,ecx
-IS0: push ebx
+ mov edx,ebx ;edx == max chars
+IS8: xor ebx,ebx ;ebx == chars in buffer
+ mov edi,ecx ;edi == pointer on current char
+;------- ;ecx == pointer to begin of readline text
+;
+IS0: push ebx ;local loop starts here
push edx
+ push ecx
+ PUSH_ALL
+ mov esi,ecx
+ lea edi,[screenline+stdtxtlen]
+ mov ecx,ebx
+ cld
+ rep movsb ;copy line buffer into screen display buffer
+ mov ecx,edx
+ sub ecx,ebx
+ mov al,32 ;fill up with blanks
+ rep stosb
+ POP_ALL
+;-------
+ mov ebx,edi ;next lines for setting cursor position
+ sub ebx,ecx
add bl,stdtxtlen ;offset+column
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_I
+%endif
+ mov esi,ecx
+ISloopUTF8:lodsb
+ and al,0C0h
+ cmp al,080h
+ jne ISdncUTF8
+ dec bl ;do not count byte 2,3,4,....
+ISdncUTF8:cmp esi,edi
+ jb ISloopUTF8
+noUTF_I:
+%endif
mov bh,byte[lines] ;line#
mov [kurspos2],ebx
+;-------
%ifdef LESSWRITEOPS
mov byte [screenbuffer],0 ;switching off usage of buffer v0.7
%endif
- call StatusLineShow
- call GetChar
+ call StatusLineShow ;show input
+ call GetChar ;read next
+ pop ecx
pop edx
pop ebx
cld
@@ -1603,33 +1852,200 @@ IS0: push ebx
jnz NO_VI01
cmp al,0
je ISA
-NO_VI01:
- call CheckUserAbort
+NO_VI01:call CheckUserAbort
jne IS9
ISA: xor ebx,ebx ;length 0 triggers CY flag
- jmp short IS1
+IS1j: jmp IS1
IS9: cmp al,RETURN
- je IS1
+ je IS1j
cmp al,8 ;^H (translated DEL)
jne IS2
- or ebx,ebx ;@left border?
- jz IS0
- dec ebx
- dec edi
- mov al,SPACECHAR
- mov byte [ebx+screenline+stdtxtlen],al
+DNHloopUTF8:
+ cmp edi,ecx ;@left border?
+ je IS0
+;-------
+ dec edi ;go 1 left
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_J
+%endif
+ mov al,byte [edi] ;check for UTF byte 2,3,4,..
+ and al,0c0h
+ cmp al,080h
+ je DNHloopUTF8
+noUTF_J:
+ jmp Delete1
+%else
+ jmp short Delete1 ;and continue at delete key
+%endif
+;-------
+IS2: cmp al,0 ;marker of cursor keys etc.
+ jne NoSpecialKey
+ cmp ah,5 ;end
+ jne NotEnd
+ lea edi,[ecx+ebx]
+IS0j:
+%ifdef UTF8
+ jmp IS0
+%else
jmp short IS0
+%endif
+NotEnd: cmp ah,0 ;home
+ jne NotHome
+ mov edi,ecx
+ jmp short IS0j
+NotHome cmp ah,3 ;left <-
+ jne NotLeft
+NHloopUTF8:
+ cmp edi,ecx
+ je IS0j
+ dec edi
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_K
+%endif
+ mov al,byte [edi]
+ and al,0c0h
+ cmp al,080h
+ je NHloopUTF8
+noUTF_K:
+%endif
+ jmp short IS0j
+NotLeft:cmp ah,4 ;right ->
+ jne NotRight
+ lea esi,[ecx+ebx]
+NLloopUTF8:
+ cmp edi,esi
+ je IS0j
+ inc edi
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_L
+%endif
+ mov al,byte [edi]
+ and al,0c0h
+ cmp al,080h
+ je NLloopUTF8
+noUTF_L:
+%endif
+IS0jj: jmp short IS0j
+NotRight:cmp ah,8 ;Insert
+ jne NotIns
+ not byte [insstat]
+%ifdef NEW_CURSOR_MGNT
+ cmp byte [insstat],1
+ jne short NCM
+ call SetCursorBlock
+ jmp short IS0j
+NCM: call SetCursorNormal
+%endif
+ jmp short IS0j
+NotIns: cmp ah,9 ;Del
+ jne NoSpecialKey
+Delete1:lea esi,[ecx+ebx] ;do not delete at last character position
+ cmp edi,esi ;...or in empty buffer...
+ je IS0jj
+%ifdef UTF8
+ push ecx
+ push edi
+ push esi
+ mov ecx,ebx ;TODO: check this
+ lea esi,[edi+1]
+ dec ebx ;decrease char count in buffer
+DeloopUTF8:
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_M
+%endif
+ mov al,byte [esi]
+ and al,0C0h
+ cmp al,080h
+ jne DeUTF8
+ inc esi ;delete one more at UTF-8 byte 2,3,4,....
+ dec ebx ;decrease char count in buffer
+ jmp short DeloopUTF8
+noUTF_M:
+DeUTF8: cld
+ rep movsb ;move all in buffer 1 char to left
+ pop esi
+ pop edi
+ pop ecx
+%else
+ PUSH_ALL
+ mov ecx,ebx ;TODO: check this
+ lea esi,[edi+1]
+ cld
+ rep movsb ;move all in buffer 1 char to left
+ POP_ALL
+ dec ebx ;decrease char count in buffer
+%endif
+ jmp short IS0jj
;-------
-IS2: cmp al,SPACECHAR
- jb IS0
- stosb
- mov byte [ebx+screenline+stdtxtlen],al ;ditto
+NoSpecialKey:
+ cmp al,SPACECHAR
+ jb short IS0jj
+
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_N
+%endif
+ push ebx
+ mov bl,al
+ and bl,0C0h
+ cmp bl,080h ;byte 2,3,4.. always insert
+ pop ebx
+ je INSrt
+noUTF_N:
+%endif
+ cmp byte [insstat],1
+ jz INSrt
+ lea esi,[ecx+ebx]
+ cmp edi,esi
+ jnz NO_INSERT
+INSrt: PUSH_ALL
+ mov eax,edi
+ lea edi,[ecx+edx+1] ;end of buffer space
+ lea esi,[edi-1]
+ mov ecx,edi
+ sub ecx,eax
+ std
+ rep movsb ;move all in buffer 1 char to right
+ POP_ALL
inc ebx
+NO_INSERT:cld
+ stosb
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_O
+%endif
+ mov esi,edi
+ dec esi
+NI_loopUTF8:inc esi
+ mov al,byte [esi]
+ and al,0C0h
+ cmp al,080h ;delete byte 2,3,4,....
+ je NI_loopUTF8
+;-------
+ cmp esi,edi
+ je NI_UTF8rdy
+ PUSH_ALL
+ mov ecx,ebx ;TODO: check this
+ cld
+ rep movsb ;move all in buffer 1 char to left
+ POP_ALL
+noUTF_O:
+NI_UTF8rdy:
+%endif
cmp ebx,edx
- jb IS0
+ jb IS0j
;-------
IS1: xor eax,eax
- stosb ;make asciz string
+ mov byte [ecx+ebx],al ;make asciz string
pop dword [kurspos2]
pop dword [VICmdMode] ;restore original vi mode
pop edi
@@ -1656,7 +2072,7 @@ GC33: cmp ah,0FDh ;ALT key
jmp short NOVI7
GC34:
%endif
- cmp al,7FH
+ cmp al,7Fh
jne short RC_No7F ;special case: remap DEL to Ctrl-H
%ifndef FREEBSD
mov al,8
@@ -1697,9 +2113,9 @@ NoCMDmode:cmp al,27 ;ESC ?
call RestoreStatusLine
%else
%ifdef SYS_select
- pusha
+ PUSH_ALL
call Select ;differ between ESC and ESC_cursor_keys
- popa
+ POP_ALL
jz isSingleEscape
%endif
%endif
@@ -1821,6 +2237,7 @@ LookBackward: ;set EDI to 1 before LINEFEED (0Ah) i.e., 2 before start of nex
jnz LBa1
dec edi ;at EOL ? start search 1 char earlier
inc ebx ;increase counter
+;-------
LBa1: mov ecx,99999
mov al,NEWLINE
std
@@ -1836,7 +2253,8 @@ LBa3: xor eax,eax
dec edi
jmp short LBa5
;-------
-LookForward:push ecx ;don't touch edx (if called by BZNLoop only)
+LookForward:
+ push ecx ;don't touch edx (if called by BZNLoop only)
mov ecx,99999
mov al,NEWLINE
cld
@@ -1966,6 +2384,17 @@ CountColToLineBeginVis: ;counts columns represented by chars in EAX
CCV1: inc esi
cmp esi,edi
jae CCVend
+%ifdef UTF8
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_P
+%endif
+ mov bl,byte [esi]
+ and bl,0C0h
+ cmp bl,080h ;do not count byte 2,3,4,.. in UTF8 chars
+ jz CCV1
+noUTF_P:
+%endif
cmp byte [esi],TABCHAR
jz CCVTab
inc edx ;count visible chars
@@ -1990,6 +2419,10 @@ CountToLineBegin:push edi ;output eax=chars up there
pop edi
ret
;-------
+CountToWordBeginVIstyle: ;output eax=chars up there
+ mov esi,edi
+ cmp byte [esi],SPACECHAR
+ ja CtWviStyle
CountToWordBegin: ;output eax=chars up there
mov esi,edi
CountNLoop:inc esi
@@ -2006,6 +2439,17 @@ CountNLoop:inc esi
CTWend: mov eax,esi
sub eax,edi ;maybe =0
Goret: ret
+;-------
+CtWviStyle:inc esi
+%ifdef W32LF
+ cmp byte [esi],RETURN
+%else
+ cmp byte [esi],NEWLINE
+%endif
+ jz CTWend
+ cmp byte [esi],2fh
+ ja CtWviStyle
+ jmp short CountNLoop
;----------------------------------------------------------------------
;
; Online Help: show the message followed by common text
@@ -2013,7 +2457,7 @@ Goret: ret
KeyHelp:
%ifdef USE_BUILTINHELP
push dword [kurspos]
- pusha
+ PUSH_ALL
xor eax,eax
xchg eax,[showblock] ;hide an blockmarker
push eax
@@ -2047,7 +2491,7 @@ KeyHelp:
cld
rep movsb ;restore textbuffer with saved patr
pop dword [showblock]
- popa
+ POP_ALL
pop edx ;cursor pos
jmp short SetKursPos
%else
@@ -2097,7 +2541,7 @@ KursorStatusLine:mov dh,byte [lines]
jmp short SetKursPos
RestKursPos:mov edx,[kurspos]
SetKursPos:mov [kurspos2],edx ;saves reading cursor pos (0,0)
-sys_writeKP:pusha
+sys_writeKP:PUSH_ALL
%ifdef W32
shl edx,8 ;linux cursorpos in dh/dl - w32 in edx 2*16bit
mov dl,dh
@@ -2112,7 +2556,7 @@ sys_writeKP:pusha
pop edx
call WriteFile0
%endif
- popa
+ POP_ALL
ret
;-------
; make ESC sequence appropriate to most important terminals
@@ -2123,10 +2567,25 @@ make_KPstr:cld
mov edi,setkp ;build cursor control esc string db 27,'[000;000H'
mov al,1Bh
stosb ;init memory
+%ifndef ARMCPU
mov eax,'[000'
stosd
mov al,';' ;i.e. load eax with ';000'
stosd
+%else
+ mov al,'['
+ stosb
+ mov al,'0'
+ stosb
+ stosb
+ stosb
+ mov al,';'
+ stosb
+ mov al,'0'
+ stosb
+ stosb
+ stosb
+%endif
mov al,'H'
stosb ;now we have written 10 chars
lea edi,[edi-6] ;old was "mov edi,setkp+1+3" now using 1+3 == 10-6
@@ -2212,7 +2671,7 @@ InsertByte:or eax,eax ;input: eax = # of bytes edi = ptr where
cmp ecx,eax ;cmp freespace - newbytes ;>= 0 ok/ NC <0 bad / CY
jnc SpaceAva
push byte ERRNOMEM
- pop dword [errno] ;(mov dword[errno],.. has 2 byte extra)
+ pop dword [ErrNr] ;(mov dword[ErrNr],.. has 2 byte extra)
call OSerror
call RestKursPos
stc
@@ -2294,7 +2753,11 @@ KeyVICmdy:call ReadOneChar
call VIsetMarker
call KeyEmaAltW
mov edi,[blockbegin]
+%ifdef W32
+ jmp ISVI9
+%else
jmp short ISVI9
+%endif
;
; some of the EM specials
;
@@ -2302,7 +2765,7 @@ KeyEmaCtrlY:
%ifdef W32
cmp byte[mode],NE ;Nedit ^V
jnz KECY
- pusha
+ PUSH_ALL
push byte 0
call OpenClipboard
or eax,eax
@@ -2332,11 +2795,16 @@ Kloop: lodsb
jnz Kloop
KECY2: mov [EmaKiSize],ebx
KECY0: call CloseClipboard
-KECY3: popa
+KECY3: POP_ALL
KECY:
%endif
mov ecx,[EmaKiSize]
+%ifdef YASM
+ or ecx,ecx
+ jmp KeawRet
+%else
jecxz KeawRet
+%endif
xchg eax,ecx ;OLD mov eax,ecx 1 byte longer
push eax
call InsertByte
@@ -2348,10 +2816,12 @@ KECY:
cld
rep movsb
call ShowBl0 ;i.e. "mov byte [showblock],0"
+ call IsViMode
+ jz ISVI9
call KeyEmaCtrlL
ISVI9: jmp CQFNum
;-------
-KeyEmaAltW2:pusha
+KeyEmaAltW2:PUSH_ALL
mov edi,ebp
inc edi
call IsViMode
@@ -2369,11 +2839,11 @@ KE2: mov ecx,eax
rep movsb
call ShowBl0 ;i.e. "mov byte [showblock],0"
Keaw2: mov byte [EmaCtrlK],1
- popa
+ POP_ALL
KeawRet:ret
;-------
KeyEmaAltW:mov byte [VInolinebased],0
- pusha
+ PUSH_ALL
mov ecx,[showblock]
jecxz Keaw2
mov ecx,[EmaMark]
@@ -2426,7 +2896,7 @@ KEAW3:
KEAW8: call HeapFree
KEAW4:
%endif
- popa
+ POP_ALL
KeaWRet:ret
;----------------------------------------------------------------------
;
@@ -2454,13 +2924,17 @@ NFnoarg:mov esi,helptext ;initial part of help
KeyVICmdE:lea esi,[ecx+2]
cmp byte [esi],SPACECHAR
je KeaWRet
- pusha ;save before load new
+ PUSH_ALL ;save before load new
call SaveFile
- popa
+ POP_ALL
;-------continue
NewFile:cld
call InitVars
+%ifdef AMD64
+ or rsi,rsi
+%else
or esi,esi
+%endif
jz NFnoarg
mov edi,filepath
NF1:
@@ -2497,12 +2971,12 @@ GetFile:
js NewFileEnd
%ifdef SYS_brk
call Seek
- pusha
+ PUSH_ALL
lea ebx,[eax+eax+102400] ;twice filesize plus reserve = space for inserts
mov [maxlen],ebx
add ebx,text
call SysBrk
- popa
+ POP_ALL
js OSejmp1 ;OSerror
%else
mov ebx,eax ;for FreeBSD memory is hard coded by maxlen
@@ -2518,7 +2992,7 @@ GetFile:
cmp ecx,8000h ;not for special files
jz regFile
push byte ERRNOREGFILE
- pop dword [errno]
+ pop dword [ErrNr]
jmp OSerror
regFile:
%endif
@@ -2562,7 +3036,17 @@ SF0: lodsb
dec edi
push byte '~' ;add BAK file extension
pop eax
+%ifdef ARMCPU
+ stosb
+ shr eax,8
+ stosb
+ shr eax,8
+ stosb
+ shr eax,8
+ stosb
+%else
stosd ;not stosb because ascii-ZERO
+%endif
pop edi
%ifdef BEOS
push edi
@@ -2575,12 +3059,12 @@ SF0: lodsb
cmp dword [ecx],'/tmp'
je no_ren
%ifdef SYS_readlink
- pusha
+ PUSH_ALL
mov ecx,linkbuffer ;we are only interested whether symlink or not
push byte linkbuffersize ;=4 byte dummy buffer
pop edx
call ReadLink
- popa
+ POP_ALL
jns CopyBAK ;no error means it's a symlink...
call RenameFile ;...but plain files are easy to rename (ecx is filepath)
jmp short no_ren ;...simlilar behave 'xemacs' and 'jed'
@@ -2612,6 +3096,10 @@ no_ren: ;...continue here...
OSejmp0:js OSejmp9 ;OSerror
xchg ebx,eax ;file descriptor (xchg is only 1 byte)
;-------
+%ifdef SYS_fchown
+ mov ecx,[perms]
+ call Fchmod
+%endif
%ifdef SYS_fstat
mov ecx,[fstatbuf+stat_struc.st_uid]
%ifdef UIDGID_WORD ;Linux special
@@ -2635,7 +3123,7 @@ SaveFile2:sub edx,ecx ;edx=fileesize= eof-bof
NoAddNL:call Write_File ;ebx=file descriptor
OSejmp9:js OSejmp ;OSerror
push byte ERRNOIO
- pop dword[errno] ;just in case of....
+ pop dword[ErrNr] ;just in case of....
cmp eax,edx ;all written?
%ifdef BEOS
jnz near OSerror
@@ -2702,7 +3190,7 @@ OSejmp: js OSerror
call CloseFile
js OSerror
push byte ERRNOIO
- pop dword[errno] ;just in case of....
+ pop dword[ErrNr] ;just in case of....
cmp edx,ecx ;all read?
jnz OSerror
ret
@@ -2710,8 +3198,8 @@ OSejmp: js OSerror
preOSerror:mov eax,edx ;count bytes
call DeleteByte ;delete space reserved for insertation
OSerror:push edi
- mov edi,error+8 ;where to store ASCII value of errno
- mov eax,[errno]
+ mov edi,error+8 ;where to store ASCII value of ErrNr
+ mov eax,[ErrNr]
push eax
call IntegerToAscii
pop ecx ;for getting error text via LookPD2
@@ -2722,7 +3210,11 @@ OSerror:push edi
mov esi,edi
mov edi,error+9
mov ax,' :'
+%ifdef ARMCPU
+ stosb ;error+9 is not aligned
+%else
stosw
+%endif
push byte 80 ;max strlen / compare errlen equ 100
pop ecx
rep movsb
@@ -2735,11 +3227,14 @@ DE2: ;continued...
;
; more STATUS LINE maintaining subroutines
;
-RestoreStatusLine:pusha ;important e.g. for asksave
+RestoreStatusLine:PUSH_ALL ;important e.g. for asksave
call InitStatusLine
mov esi,mode
mov ecx,[columns] ;width
cmp cl,stdtxtlen+15+5+2 ;this window is too small
+%ifdef ARMCPU
+ and ecx,0xFFFFFFFC ;get aligned
+%endif
jb near RSno_lineNr
mov al,byte[changed]
mov byte[screenline+1],al ;changed status
@@ -2794,7 +3289,7 @@ RSL4: mov edi,screenline-15
mov eax,[linenr]
call IntegerToAscii
RSno_lineNr:call StatusLineShow ;now write all at once
- popa
+ POP_ALL
stc ;error status only important if called via OSError
ret
;-------
@@ -2804,7 +3299,7 @@ RSno_lineNr:call StatusLineShow ;now write all at once
; expecting esi points to ASCIIZ or 0A terminated string
;
WriteMess9MakeLine:call InitStatusLine
-WriteMess9:pusha
+WriteMess9:PUSH_ALL
mov edi,screenline
cld
WriteMLoop:lodsb
@@ -2813,13 +3308,13 @@ WriteMLoop:lodsb
stosb
jmp short WriteMLoop
WriteMEnd:call StatusLineShow
- popa
+ POP_ALL
jmp KursorStatusLine
;-------
; a helper for other status line functions:
; simply init an empty line
;
-InitStatusLine:pusha ;simply init an empty line
+InitStatusLine:PUSH_ALL ;simply init an empty line
mov edi,screenline
mov al,SPACECHAR
mov ecx,[columns]
@@ -2831,19 +3326,19 @@ InitStatusLine:pusha ;simply init an empty line
rep stosb
mov al,0 ;prepare ASCIIZ string
stosb
-ISL: popa
+ISL: POP_ALL
ret
;-------
; read a file name for block operations
;
-GetBlockName:pusha
+GetBlockName:PUSH_ALL
mov esi,block
mov ecx,blockpath
call InputString0 ;cy if empty string
pushf
call RestKursPos
popf
- popa
+ POP_ALL
ret
;-------
; helper for NewFile
@@ -2970,25 +3465,26 @@ FindText:mov ch,[grossklein] ;ff or df
lodsb
cmp al,41h
jb find1
- and al,ch
-find1: add edi,[vorwarts] ;+1 or -1
+ and al,ch ;FIXME: check UTF-8 stuff !!
+;-------
+find1: add edi,[vorwarts] ;+1 or -1 (increase or decrease pointer)
mov cl,byte [edi]
cmp cl,41h
jb find6
and cl,ch
find6: cmp al,cl
je find2
- cmp byte[mode],PI
- jnz find_WS
- cmp edi,ebp
- jb foundEOF
- mov edi,sot
- cmp edi,[PicoSearch]
- je notfound
-foundEOF:jmp short find9
+ cmp byte[mode],PI ;is it Pico? (always searching forward)
+ jnz find_WS ;no, continue
+ cmp edi,[PicoSearch] ;yes, but did we search from BOF up to here?
+ je notfound ;yes, so we did not found the text
+ cmp edi,ebp ;no, but did we touch EOF?
+ jb find1 ;no, continue from here
+ mov edi,sot-1 ;yes, let's continue at BOF
+ jmp short find1 ;loop
find_WS:cmp edi,ebp
ja notfound
-find9: cmp edi,sot
+find9: cmp edi,sot ;this is needed for WStar backward option searching
jnb find1
notfound:stc
ret
@@ -3027,7 +3523,11 @@ AIload: lodsb ;eax bit 8..31 are 0
jmp short AIload
GATI3: lea ecx,[8*ecx+eax] ;mul 8 plus digit
jmp short AIload
+%ifdef ARMCPU
+AIexit: cmp ecx,0 ;ret ecx
+%else
AIexit: or ecx,ecx ;ret ecx
+%endif
AIexit2:ret ;CY or ZR if error
;-------
;
@@ -3092,7 +3592,21 @@ KeyEditMode:
call InitSomeVars
;-------
SetEditMode:mov eax,mode ;returns Z flag if the mode was changed / NZ else
+%ifndef ARMCPU
+%ifdef AMD64
+ mov ecx,dword [rsi]
+%else
mov ecx,dword [esi]
+%endif
+%else ;one never knows how aligned esi will be
+ mov cl,byte [esi+3]
+ shl ecx,8
+ mov cl,byte [esi+2]
+ shl ecx,8
+ mov cl,byte [esi+1]
+ shl ecx,8
+ mov cl,byte [esi]
+%endif
%ifdef W32
or ecx,020202020h ;convert to lower case
%endif
@@ -3172,12 +3686,30 @@ SetTermStruc:
%ifdef LINUX
mov byte [edx+termios_struc.c_cc+VMIN],1 ;set min=1 ->needed for gnome-terminal
%endif
+%ifdef ARMCPU
+ and byte [edx+termios_struc.c_lflag+0],(~ICANON & ~ISIG & ~ECHO) ;icanon off, isig (^C) off, echo off
+%else
and TSize [edx+termios_struc.c_lflag+0],(~ICANON & ~ISIG & ~ECHO) ;icanon off, isig (^C) off, echo off
+%endif
and byte [edx+termios_struc.c_iflag+1],(~(IXON>>8) & ~(ICRNL>>8)) ;ixon off, icrnl off
mov ecx,TERMIOS_SET
jmp short IOctlTerminal ;edx is termios pointer
%endif
;----------------------------------------------------------------------
+%ifdef NEW_CURSOR_MGNT
+SetCursorNormal:PUSH_ALL
+ mov ecx,normcurs
+ push byte normcurslen
+ jmp short SCB
+SetCursorBlock:PUSH_ALL
+ mov ecx,blockcurs ;second argument: pointer to message to write
+ push byte blockcurslen ;third argument: message length
+SCB: pop edx
+ call WriteFile0
+ POP_ALL
+ ret
+%endif
+;----------------------------------------------------------------------
;
; INTERFACE to OS kernel
; we differ between Linux, and and ...
@@ -3190,6 +3722,8 @@ IOctlTerminal:mov ebx,stdin ;expects EDX termios or winsize structure ptr
push ecx
push ebx
call ioctl
+ mov ebx,[errno]
+ mov [ErrNr],ebx
pop ebx
pop ecx
pop edx
@@ -3206,11 +3740,11 @@ ReadFile0:
;all API:
;- direction flag is cleared before and after call
;- preserves ebx,esi,edi,ebp
- pusha
+ PUSH_ALL
push dword 0xFFFFFFFF
push dword [hin]
call WaitForSingleObject
- popa
+ POP_ALL
%ifdef W32_EXTENDED_IO
push ecx ;destr
push edx ;destr
@@ -3228,10 +3762,10 @@ ReadFile0:
mov ebx,dword [ecx+4]
cmp ebx,1 ;is it a keydown event?
jnz ReadFile0 ;no, read new
- ;pusha
+ ;PUSH_ALL
;push dword [hin]
;call FlushConsoleInputBuffer
- ;popa
+ ;POP_ALL
;-------
mov ebx,dword [ecx+8] ;virtual key code
shr ebx,16
@@ -3289,7 +3823,7 @@ Read_File:
or eax,eax
jnz ReadFileOkay
call GetLastError
- mov [errno],eax
+ mov [ErrNr],eax
neg eax
ret
ReadFileOkay:
@@ -3306,6 +3840,8 @@ ReadFileOkay:
push ecx
push ebx
call read
+ mov ebx,[errno]
+ mov [ErrNr],ebx
pop ebx
pop ecx
pop edx
@@ -3340,7 +3876,7 @@ Write_File:
or eax,eax
jnz WriteFileOkay
call GetLastError
- mov [errno],eax
+ mov [ErrNr],eax
neg eax
ret
WriteFileOkay:
@@ -3363,6 +3899,8 @@ WFile: pop eax
push ecx
push ebx
call write
+ mov ebx,[errno]
+ mov [ErrNr],ebx
pop ebx
pop ecx
pop edx
@@ -3397,7 +3935,7 @@ OpenFile:
cmp eax,INVALID_HANDLE_VALUE
jnz OpenFileOkay
call GetLastError
- mov [errno],eax
+ mov [ErrNr],eax
neg eax
OpenFileOkay:ret
%else
@@ -3414,6 +3952,8 @@ OpenFileOkay:ret
push ecx
push ebx
call open
+ mov ebx,[errno]
+ mov [ErrNr],ebx
pop ebx
pop ecx
pop edx
@@ -3441,6 +3981,8 @@ CloseFile:
push ecx ;destr
push ebx
call close
+ mov ebx,[errno]
+ mov [ErrNr],ebx
pop ebx
pop ecx
pop edx
@@ -3457,12 +3999,32 @@ ReadLink:mov al,SYS_readlink
jmp short IntCall
%endif
;-------
+%ifdef SYS_fchmod
+Fchmod:
+%ifdef LIBC
+ push ecx
+ push ebx
+ call fchmod
+ mov ebx,[errno]
+ mov [ErrNr],ebx
+ pop ebx
+ pop ecx
+ or eax,eax
+ ret
+%else
+ mov al,SYS_fchmod
+ jmp short IntCall
+%endif
+%endif
+;-------
%ifdef SYS_fstat
Fstat: mov ecx,fstatbuf
%ifdef LIBC
push ecx
push ebx
call fstat
+ mov ebx,[errno]
+ mov [ErrNr],ebx
pop ebx
pop ecx
or eax,eax
@@ -3478,6 +4040,8 @@ ChownFile:
push ecx
push ebx
call fchown
+ mov ebx,[errno]
+ mov [ErrNr],ebx
pop ebx
pop ecx
pop edx
@@ -3503,7 +4067,7 @@ RenameFile:
or eax,eax
jnz RenameFileOkay
call GetLastError
- mov [errno],eax
+ mov [ErrNr],eax
neg eax
ret
RenameFileOkay:
@@ -3514,6 +4078,8 @@ RenameFileOkay:
push ecx
push ebx
call rename
+ mov ebx,[errno]
+ mov [ErrNr],ebx
pop ebx
pop ecx
or eax,eax
@@ -3551,7 +4117,7 @@ SeekFile:xor ecx,ecx ;ecx offset / ebx file / edx method
cmp eax,0xFFFFFFFF
jnz SeekFileOkay
call GetLastError
- mov [errno],eax
+ mov [ErrNr],eax
neg eax
SeekFileOkay:ret
%else
@@ -3568,11 +4134,19 @@ SeekFileOkay:ret
%else
%ifdef LIBC
push edx
+%ifdef OPENBSD
+ push byte 0
+%endif
push ecx
push ebx
call lseek
+ mov ebx,[errno]
+ mov [ErrNr],ebx
pop ebx
pop ecx
+%ifdef OPENBSD
+ pop edx
+%endif
pop edx
or eax,eax
ret
@@ -3601,8 +4175,8 @@ be_ret: pop ebx
pop edx
pop edi
pop edi
- mov [errno],eax
- and dword [errno],7Fh
+ mov [ErrNr],eax
+ and dword [ErrNr],7Fh
or eax,eax ;set flags also
pop edi
%else
@@ -3613,8 +4187,8 @@ be_ret: pop ebx
or eax,eax
ret
Fru: neg eax
- mov [errno],eax
- and dword [errno],7Fh
+ mov [ErrNr],eax
+ and dword [ErrNr],7Fh
neg eax ;set flags also
ret
%else
@@ -3636,8 +4210,8 @@ Fru: neg eax
pop edi
jc err
%endif
- neg eax
-err: mov [errno],eax
+AfterInt:neg eax
+err: mov [ErrNr],eax
neg eax ;set flags also
%endif
%endif
@@ -3655,12 +4229,12 @@ be_ret2:pop ebx
pop ebx
pop ecx
pop edx
- mov [errno],eax
+ mov [ErrNr],eax
pop eax
lea eax,[eax+4] ;add eax,4
push eax
- mov eax,[errno]
- and dword [errno],7Fh
+ mov eax,[ErrNr]
+ and dword [ErrNr],7Fh
or eax,eax ;set flags
ret
%endif
@@ -3677,6 +4251,10 @@ Select: push dword timevalsec
mov byte [ecx],bl
push ebx
call select
+ push ebx
+ mov ebx,[errno]
+ mov [ErrNr],ebx
+ pop ebx
add esp,20
or eax,eax
ret
@@ -3702,8 +4280,25 @@ Utime: mov al,SYS_utime
Fork: mov al,SYS_fork
jmp short IntCall
;-------
-Pipe: mov al,SYS_pipe
+Pipe:
+%ifdef FREEBSD
+ mov eax,SYS_pipe
+ push edi
+ push esi
+ push ecx
+ push ebx
+ int 80h
+ pop ebx
+ pop ecx
+ pop esi
+ pop edi
+ mov [ebx],eax
+ mov [ebx+4],edx
+ jmp short AfterInt
+%else
+ mov al,SYS_pipe
jmp short IntCall
+%endif
;-------
Dup2: mov al,SYS_dup2
jmp short IntCall
@@ -3735,6 +4330,8 @@ Unlink:
push ecx
push ebx
call unlink
+ mov ebx,[errno]
+ mov [ErrNr],ebx
pop ebx
pop ecx
pop edx
@@ -3777,12 +4374,12 @@ KeyCtrlKP:call InputStringWithMessage0 ;WS, Emacs's, Pico's access to sed|ex pip
popf
jc ExExEx
KeyVICmdtemp:call CheckENum ;i.e. mov byte [numeriere],1
- pusha
+ PUSH_ALL
mov ebx,tempfile
mov esi,sot
mov [blockende],ebp
call SaveBl3
- popa
+ POP_ALL
jnc SaveOK
ExExEx: ret ;cannot save buffer to tmp file...
SaveOK: ;...this is handled inside SaveBlock, so just return
@@ -3799,12 +4396,6 @@ SaveOK: ;...this is handled inside SaveBlock, so just return
mov ebx,sedpipeB0
call Pipe
js OSerrJmp0
-%ifdef FREEBSD
- mov [sedpipeB0],eax ;this seems to work, although...
- inc eax ;...I don't know why....?
- inc eax ;Someone can explain?
- mov [sedpipeB1],eax
-%endif
call Fork
js OSerrJmp0
or eax,eax
@@ -3837,22 +4428,24 @@ Bufloop:inc edx
lodsb
or al,al
jnz Bufloop ;count ex cmd length
- call WriteFile ;write to ex program
+ call Write_File ;write to ex program
;-------
mov ecx,wq_suffix
mov edx,wq_suffix_len
- call WriteFile ;write "wq" string to ex program
+ call Write_File ;write "wq" string to ex program
call CloseFile
OSerrJmp1:js OSerrJmp
mov ecx,optbuffer ;for return status
+ push ecx ;new in e3 2.6.1 (needed in Linux 2.6.8-24.10)
push edi
call Wait4
pop edi
+ pop ecx
js OSerrJmp
mov ecx,[ecx] ;getting return status
shr ecx,8
and ecx,0xFF
- mov [errno],ecx
+ mov [ErrNr],ecx
jnz OSerrJmp
;-------
mov ebx,tempfile
@@ -3936,15 +4529,17 @@ NoStdErrMsg:call CloseFile ;stderr pipe
%endif
call SetChg ;i.e. mov byte [changed],CHANGED (assumption only)
mov ecx,optbuffer ;for return status
+ push ecx ;new in e3 2.6.1 (needed in Linux 2.6.8-24.10)
push edi
call Wait4
pop edi
+ pop ecx ;ditto new in e3 2.6.1
js OSerrJmp
mov ebx,tempfile
call Unlink
js OSerrJmp
movzx ecx,byte[ecx+1] ;old shr ecx,8 / and ecx,0xFF
- mov [errno],ecx
+ mov [ErrNr],ecx
jecxz ChkCursPos
OSerrJmp:call ChkCursPos ;TODO: unlink helper file if exists
jmp near OSerror
@@ -3983,14 +4578,28 @@ ForkChild:mov ebx,[ebx] ;i.e. sedpipeB0
push byte ERRNOEXEC
pop ebx ;set error
FCex: jmp near Exit2 ;in case of error
-FCError:mov ebx,[errno]
+FCError:mov ebx,[ErrNr]
jmp short FCex
%endif ;USE_PIPE
;----------------------------------------------------------------------
;
; care about cursor pos
;
-ChkCursPos:cmp edi,ebp ;never let run cursor outside buffer
+ChkCursPos:
+%ifdef UTF8
+ inc edi
+CCloopUTF8:dec edi
+%ifdef UTF8RTS
+ cmp byte [isUTF8],0
+ je noUTF_Z
+%endif
+ mov al,byte [edi]
+ and al,0C0h
+ cmp al,080h
+ je CCloopUTF8
+noUTF_Z:
+%endif
+ cmp edi,ebp ;never let run cursor outside buffer
jbe CCP
mov edi,ebp
CCP: cmp edi,sot
@@ -4005,7 +4614,7 @@ CCP2: ret
; ecx==bakpath
;
%ifdef SYS_readlink
-CopyToBackup:pusha
+CopyToBackup:PUSH_ALL
push ecx ;backup file path later needed for Utime call
push ecx
call OpenFile0
@@ -4049,7 +4658,7 @@ notready:mov ecx,screenbuffer
pop ebx ;original file path
mov ecx,accesstime ;i.e. a data structure of 2* 32 bit
call Utime ;set change time
- popa
+ POP_ALL
ret
%endif
;----------------------------------------------------------------------
@@ -4240,10 +4849,11 @@ Number: FLDZ
num_ctr:call DigitHlp
jc int_end
loop num_ctr ;error if >12 digits
-isErr: mov esp,[stackptr] ;restore stack pos for math calc
+isErr:
+ mov esp,[stackptr] ;restore stack pos for math calc
%endif ;USE_MATH
%ifdef BEEP_IN_VI
-VIBeepForD:pusha
+VIBeepForD:PUSH_ALL
%ifdef W32
push byte 0
call MessageBeep
@@ -4251,7 +4861,7 @@ VIBeepForD:pusha
mov ecx,BeepChar
call WriteFile00
%endif
- popa
+ POP_ALL
%endif
ret
;-------
@@ -4366,10 +4976,10 @@ DataForUndoDelete:
cmp byte [enter_undo],1 ;do not collect undo data if within undo operation
jz OCret
cmp eax,undobuffer_size-24
- pusha
+ PUSH_ALL
jb DFok
;-------
- pusha
+ PUSH_ALL
mov ebx,[last_undo_file]
or ebx,ebx
jz noundo_info
@@ -4380,7 +4990,7 @@ noundo_info:mov esi,sot ;i.e. huge undo data
mov [blockende],ebp
mov ebx,tempfile2
call SaveBl3
- popa
+ POP_ALL
;-------
call InitUndoFrame0
mov dword [edx],0x01234567B ;2nd signature for "delete"
@@ -4409,11 +5019,20 @@ DataForUndoOverwrite:
; Data collector for "overwrite" by PUSHING data on a stack,
; growing to higher addresses, using a data structure like in DataForUndoInsert
;
- pusha
+ PUSH_ALL
call InitUndoFrame0
mov dword [edx],0x01234567A ;signature for "overwrite", later undo will restore
mov eax,[edi] ;fetch overwritten char
jmp short OVWdata
+DataForUndoXchange:
+;
+; Data collector for "Emacs ^T" by PUSHING data on a stack,
+; growing to higher addresses, using a data structure like in DataForUndoOverWrite
+;
+ PUSH_ALL
+ call InitUndoFrame0
+ mov dword [edx],0x012345677 ;signature for "xchg", later undo will restore
+ jmp short OVWdata
;------
DataForUndoInsert:
;
@@ -4433,7 +5052,7 @@ DataForUndoInsert:
;
cmp byte [enter_undo],1 ;do not collect undo data if within undo operation
jz DFUI
- pusha
+ PUSH_ALL
call InitUndoFrame0
mov dword [edx],0x012345678 ;signature for "insert", later undo will delete that data
OVWdata:mov [edx+4],edi ;where
@@ -4441,7 +5060,7 @@ OVWdata:mov [edx+4],edi ;where
mov [edx+12],edx ;this frame is the prev frame for the next one
lea eax,[edx+16] ;address of next frame
DFex: mov [undoptr],eax ;let undoptr point to next frame
- popa
+ POP_ALL
DFUI: ret
;----------------------------------------------------------------------
;
@@ -4458,7 +5077,9 @@ KeyUndo:mov byte [enter_undo],1 ;do not log dele/insert when in undo mode
xchg ecx,[edx] ;(destroying is neccessary because it's a ring buffer)
mov eax,[edx+8] ;data size or character itself
mov edi,[edx+4] ;position
- sub ecx,0x12345678
+ sub ecx,0x12345677
+ jz UndoOfXchange
+ dec ecx
jz UndoOfInsert
dec ecx
jz UndoOfDelete
@@ -4472,6 +5093,11 @@ NotAv: mov edi,ebx ;abort UNDO: no valid signature found
%endif
jmp short KUret
;-------
+UndoOfXchange:mov al,byte [edi]
+ xchg byte [edi-1],al
+ mov byte [edi],al
+ jmp short KUexit
+;-------
UndoOfDelete:lea esi,[edx+12] ;source ptr for deleted <data>
push esi
call InsertByte ;get some space.....
@@ -4486,6 +5112,7 @@ UndoOfInsert:call DeleteByte
jmp short KUexit
;-------
ReReadBuffer:lea ebp,[eax+sot] ;compute eof pointer
+ mov byte [ebp],NEWLINE ;eof-marker
push eax ;size
mov ebx,tempfile2
call OpenFile0
@@ -4545,7 +5172,9 @@ IUFret: ret
;
; CONSTANT DATA AREA
;
+%ifdef USE_MATH
factor dq 1000000.0
+%endif
tempfile2 db 'e3##',0 ;tempfile (FIXME: use PID for name)
%ifdef USE_PIPE
tempfile db 'e3$$',0 ;tempfile (FIXME: use PID for name)
@@ -4714,7 +5343,7 @@ VIcmdTable:db Beep;0
db 4 ;' ' KeyRight
db Beep ;33
db Beep ;34
- db 4fH ;35 Numerics
+ db 4fh ;35 Numerics
db 5 ;'$' KeyEnd
db Beep ;37
db Beep ;38
@@ -4797,7 +5426,7 @@ VIcmdTable:db Beep;0
db Beep ;'s'
db Beep ;'t'
%ifdef USE_UNDO
- db 53h ;'u' UNDO, experimental
+ db 53h ;'u' UNDO
%else
db Beep ;'u'
%endif
@@ -4822,7 +5451,7 @@ Ktable db DoNo ;^K@ xlatb table for making pseudo-scancode
db 14h ;^kk
db DoNo ;^kl
db 3eh ;^km Set Mode
- db 4FH ;^kn
+ db 4Fh ;^kn
db DoNo ;^ko
db 48h ;^kp Pipe thru sed
db 0bh ;^kq
@@ -4922,7 +5551,7 @@ PicoJtable db DoNo ;^j@ Junk ops for PI mode
PicoQtable db DoNo ;^q@ Quick motions for PI mode: wordstar counterparts on different keys
db DoNo ;^qa
db 1Fh ;^qb Bottom of window
- db 4FH ;^qc Calc numerics
+ db 4Fh ;^qc Calc numerics
db DoNo ;^qd
db 0fh ;^qe End of file
db 1Ch ;^qf last Find
@@ -4941,7 +5570,7 @@ PicoQtable db DoNo ;^q@ Quick motions for PI mode: wordstar counterparts on diff
db 0Eh ;^qs Start of file
db 1Eh ;^qt Top of window
%ifdef USE_UNDO
- db 53h ;^qu UNDO, experimental
+ db 53h ;^qu UNDO
%else
db DoNo ;^qu
%endif
@@ -4952,6 +5581,10 @@ PicoQtable db DoNo ;^q@ Quick motions for PI mode: wordstar counterparts on diff
db DoNo ;^qz
;----------------------------------------------------------------------
esize equ 2 ;(byte per entry)
+%ifdef ARMCPU
+align 2
+%endif
+
jumptab1: ;Storing 16 bit offsets is valid only for code less size 64 kbyte...
; ... but in assembler that should never be a problem ;)
%ifndef USE_EXT_MOVE
@@ -5074,7 +5707,7 @@ jumptab1: ;Storing 16 bit offsets is valid only for code less size 64 kbyte...
%endif
dw KeyVI_M -_start ;52h vi
%ifdef USE_UNDO
- dw KeyUndo -_start ;53h general & experimental
+ dw KeyUndo -_start ;53h general
%else
dw SimpleRet -_start ;53h
%endif
@@ -5186,7 +5819,7 @@ jumps1 equ ($-jumptab1) / esize
dw PicoQMenu -_start ;^q 11
dw KeyCtrlKR -_start ;^r 12
dw KeyEmaCtrlXW -_start ;^s 13 SAVE_AS
- dw KeyEmaAltPer -_start ;^t 14
+ dw PicoCtrlTpico-_start ;^t 14
dw KeyEmaCtrlY -_start ;^u 15
dw KeyPgDn -_start ;^v 16
dw KeyEmaCtrlS -_start ;^w 17
@@ -5225,7 +5858,7 @@ jumps1 equ ($-jumptab1) / esize
dw KeyCtrlKS -_start ;^s 13 SAVE
dw SimpleRet -_start ;^t 14
%ifdef USE_UNDO
- dw KeyUndo -_start ;^u 15 UNDO experimental
+ dw KeyUndo -_start ;^u 15 UNDO
%else
dw SimpleRet -_start ;^u 15
%endif
@@ -5260,26 +5893,60 @@ jumps1 equ ($-jumptab1) / esize
db 27,'[7m' ;good for "linux" terminal on /dev/tty (but not xterm,kvt)
;again take care length = length of boldX
;!! important: store directly after bold1 !!
+%ifdef NEW_CURSOR_MGNT
+ blockcurs db 27,'[?17;0;64c' ;see e3.h
+ blockcurslen equ $-blockcurs
+ normcurs db 27,'[?2c'
+ normcurslen equ $-normcurs
+%endif
%endif
%endif
%ifdef SELFTEST
pipein db 'PIPE_IN',0
%endif
+;-------
+%ifdef UTF8
+%ifdef UTF8RTS
+ getPos db 13, 0ceh, 94h,27,'[6n',13 ;write carriage_return, followed by 1 UTF8 char
+ gPlen equ $-getPos ;and clean up with another carriage_return
+ ;Terminal should answer ESC[<line>;<column>R
+%endif ;on UTF8 terminals should be column==2 else ==3
+%endif
;-------------------------------------------------------------------------
+%ifdef ARMCPU
+align 2
+%endif
editmode:db 'p WSp Pip Emp NE'
;
helptext:
-db "MicroEditor e3 v2.21 GPL (C) 2000-02 A.Kleine <kleine@ak.sax.de>",10
+%ifdef YASM
+db "MicroEditor e3-YASM v2.6.1"
+%else
+db "MicroEditor e3 v2.6.1"
+%endif
+%ifdef UTF8
+db "-UTF8 GPL ",0C2h,0A9h," 2000-04 A.Kleine <kleine@ak.sax.de>",10
+%else
+db " GPL (C) 2000-05 A.Kleine <kleine@ak.sax.de>",10
+%endif
db "Enter filename or leave with RETURN",10,10
+%ifdef YASM
+helptextsize equ 70h
+%else
helptextsize equ $-helptext
%if helptextsize>127
%error helptextsize
%endif
+%endif
helpfoot:db 10,10,10,TABCHAR,TABCHAR,TABCHAR,"-= PRESS ANY KEY =-" ;at least 6 wasted byte ;-)
+%ifdef YASM
+helpfootsize equ 19h
+%else
helpfootsize equ $-helpfoot
%if helpfootsize>127
%error helpfootsize
%endif
+%endif
;
%ifdef USE_BUILTINHELP
help_ws:
@@ -5382,7 +6049,12 @@ db "Buffer: altW Copy ^Y Yank ^<SPC> Mark ^X^X Xchg Mark/Pt",10
db 10
db "Delete: ^K Line ^W Region ^H Left Chr ^D This Chr",10
db 10
+%ifdef UTF8
+; FIXME: ^T
+db "Other: ^O Open line ^I Ins Tab ^Q Quoted Ins",10
+%else
db "Other: ^O Open line ^T Xchg Chr ^I Ins Tab ^Q Quoted Ins",10
+%endif
db " ^M NL ^J NL+indent altX Set edit mode",10
%ifdef USE_MATH
db " ^X^N Calculate"
@@ -5406,8 +6078,8 @@ db "^B,^F,^D,^U move by [half]page",10
db "$,0,^,w,b,e,H,L,M,z. move in line/screen",10
db "/,?,G srch fwd/bwd, go EOF",10
db "ma,'a set/go marker a",10
-db "x,X,<Del>,D delete chr, to EOL",10
-db "S,C,dd,d'a,yy,y'a subst,change,delete,yank",10
+db "x,X,<Del>,dw,D dele chr,word,EOL",10
+db "S,C,dd,d'a,yy,y'a subst,change,dele,yank",10
db "p,P paste",10
db "A,a,I,i,<Ins>,O,o enter ins.mode",10
db "R,r enter ovw.mode,ovw.chr",10
@@ -5469,7 +6141,7 @@ db " ^Z Suspend"
db " ^U Undo"
%endif
help_ne_size equ $-help_ne
-
+%ifndef YASM
%if help_ws_size != help_pi_size || help_ws_size!= help_em_size || help_ws_size!= help_pi_size || help_ws_size!= help_vi_size
%error Helptext
dw help_vi_size
@@ -5477,6 +6149,7 @@ dw help_ws_size
dw help_pi_size
dw help_em_size
%endif
+%endif
%else ;no help texts built in
help_ws:
help_pi:
@@ -5501,6 +6174,16 @@ section .data ;unused in Linux/FreeBSD/BeOS: save byte in ELF header
bits 32 ;unused in W32: save byte in PE header
%endif
;-----------------------------------------------------------------------
+%ifdef OPENBSD
+section .note.openbsd.ident
+align 4
+ dd 8
+ dd 4
+ dd 1
+ db "OpenBSD",0
+ dd 0
+%endif
+;-----------------------------------------------------------------------
section .bss
bits 32
align 4
@@ -5556,7 +6239,7 @@ suchlaenge resd 1 ;helper for ^QA,^QF
repllaenge resd 1
vorwarts resd 1
grossklein resd 1 ;helper byte for ^QF,^QA
-
+ ; ^ ^ ^ ^ TODO check UTF-8 stuff here
ch2linebeg resd 1 ;helper keeping cursor pos max at EOL (up/dn keys)
numeriere resd 1 ;byte controls re-numeration
read_b resd 1 ;buffer for getchar
@@ -5566,7 +6249,7 @@ read_b resd 1 ;buffer for getchar
isbold resd 1 ;control of bold display of ws-blocks
inverse resd 1
insstat resd 1
-errno resd 1 ;used similar libc, but not excactly equal
+ErrNr resd 1 ;used similar libc errno, but not excactly equal
errlen equ 100
error resb errlen ;reserved space for string: 'ERROR xxx:tttteeeexxxxtttt',0
@@ -5584,7 +6267,11 @@ suchtext2 resb maxfilenamelen+1 ;for PICO mode
optbuffer resb optslen ;buffer for search/replace options and for ^QI
linkbuffersize equ 4
linkbuffer resb linkbuffersize
+%ifdef AMD64
+sigaction resq 40
+%else
sigaction resd 40
+%endif
;------
perms resd 1
%ifdef SYS_fstat
@@ -5611,6 +6298,9 @@ VICmdMode resd 1
VIbufch resd 1
VInolinebased resd 1
PicoSearch resd 1 ;where search started
+%ifdef UTF8RTS
+isUTF8 resd 1
+%endif
%ifdef USE_PIPE
sedpipeB0 resd 1
sedpipeB1 resd 1
@@ -5630,7 +6320,11 @@ buffercopy resb buffercopysize
%ifdef USE_MATH
level resd 1 ;balance
ptlevel resd 1 ;parenthesis balance
+ %ifdef AMD64
+ stackptr resq 1
+ %else
stackptr resd 1 ;escape recursion
+ %endif
x87 resd 3 ;12 byte (need 10 byte for 80 bit BCD)
lastresult87 resq 4 ;8 byte
signctl resd 1
diff --git a/e3.h b/e3.h
index 6601e17..4d523db 100644
--- a/e3.h
+++ b/e3.h
@@ -1,5 +1,5 @@
;--------------------------------------------------------------------------
-; e3.asm v2.21 Copyright (C) 2000-02 Albrecht Kleine <kleine@ak.sax.de>
+; e3.asm v2.6.1 Copyright (C) 2000-05 Albrecht Kleine <kleine@ak.sax.de>
;
; see GNU copyright details in e3.asm
;--------------------------------------------------------------------------
@@ -13,6 +13,8 @@
%define MAKE_BACKUP
%define LESSWRITEOPS
;-------
+%define UTF8 ;for UTF8 console or xterm e.g. @ Suse 9.1
+;-------
%define BEEP_IN_VI ;undef if you hate beeping computers
%define USE_MATH ;undef if you don't use the numerics
%define USE_PIPE ;undef if you don't use piping through sed/ex
@@ -24,6 +26,9 @@
;
; D O N O T C H A N G E B E L O W L I N E
;----------------------------------------------------------------------
+%ifdef OPENBSD
+%define FREEBSD
+%endif
%ifdef BEOS
;posix/termios.h ;termios eq termio
%define TERMIOS_SET 8001h ;TCSETA
@@ -98,6 +103,7 @@ db "R/O file system",10 ;30
;the QNX version is linked against libc
%define LIBC
extern open,read,write,close,lseek,rename,_exit,ioctl,fstat,fchown,select,unlink
+extern errno
%undef USE_PIPE
%define SYS_fstat ;dummy
struc stat_struc
@@ -287,20 +293,40 @@ db "R/O file system",10 ;30
%define SYS_dup2 63
%define SYS_sigaction 67
%define SYS_readlink 85
+%define SYS_fchmod 94
%define SYS_fchown 95
%define SYS_fstat 108
%define SYS_wait4 114
%define SYS_select 142
+%ifndef ARMCPU
%define time_t resd
struc utimbuf_struc
.actime: time_t 1
.modtime:time_t 1
endstruc
+%else
+ struc utimbuf_struc
+.actime: resd 1
+.modtime:resd 1
+ endstruc
+%endif
%ifdef CRIPLED_ELF
%define USE_SPECIAL_HEADER ;special ELF header etc
%endif
-%define CURSORMGNT ;switch cursor depending of 'INSERT'-mode
+
+;-------
+%ifdef UTF8
+ %define NEW_CURSOR_MGNT ;switch cursor depending of 'INSERT'-mode
+ %undef CURSORMGNT ;switch cursor depending of 'INSERT'-mode
+ ;no more support of CURSORMGNT for UTF-8 thus replaced by:
+ ;8.Juni 2004: see /usr/src/linux/Documentation/VGA-softcursor.txt
+%else
+ %define CURSORMGNT ;switch cursor depending of 'INSERT'-mode
+ ;trad style
+%endif
+;--------
+
SIGCONT equ 18
SIGSTOP equ 19
@@ -321,7 +347,6 @@ MAXERRNO equ 32
ERRNOMEM equ 12
ERRNOIO equ 5
ERRNOEXEC equ 31
-
%macro errortext 0
db "Op not permitted",10 ;1
db "No such file|directory",10 ;2
@@ -362,13 +387,19 @@ db SEDPATH,10
db "Broken pipe",10 ;32
%endmacro
%ifdef LIBC
- extern open,read,write,close,lseek,rename,_exit,ioctl,fstat,fchown,select,unlink
+ extern open,read,write,close,lseek,rename,_exit,ioctl,fstat,fchown,select,unlink,fchmod
+ extern errno
%undef SYS_readlink
%undef SYS_brk
%undef SYS_kill
%undef SYS_sigaction
%undef USE_PIPE
%endif
+%ifdef ARMCPU
+ %undef USE_MATH
+ %undef USE_UNDO
+ %undef USE_PIPE
+%endif
%else
%ifdef FREEBSD ;----------------------- FREE B S D -----------------------
;sys/termios.h
@@ -420,14 +451,19 @@ db "Broken pipe",10 ;32
%define SYS_execve 59
%define SYS_lseek 19 ;also 199
%define SYS_utime 138
+%ifndef OPENBSD
%define SYS_kill 37
+%endif
%define SYS_rename 128
%define SYS_pipe 42
%define SYS_ioctl 54
%define SYS_dup2 90
+%ifndef OPENBSD
%define SYS_sigaction 46 ;also 342
+%endif
%define SYS_readlink 58
%define SYS_fchown 123
+%define SYS_fchmod 124
%define SYS_fstat 189
%define SYS_wait4 7
%define SYS_select 93
@@ -438,7 +474,7 @@ db "Broken pipe",10 ;32
.modtime:time_t 2
endstruc
-%undef CAPTURE_STDERR ;******is buggy in e3/BSD******
+%undef CAPTURE_STDERR
%ifdef EX
%define USE_EX_NO_SED
%define EX_PATH '/usr/bin/ex' ;(ex is usually a symlink to vi) [ old was /bin/ex ]
@@ -495,6 +531,15 @@ db SEDPATH,10
%endif
db "Broken pipe",10 ;32
%endmacro
+%ifdef LIBC
+ extern open,read,write,close,lseek,rename,_exit,ioctl,fstat,fchown,select,unlink,fchmod
+ extern errno
+ %undef SYS_readlink
+ %undef SYS_brk
+ %undef SYS_kill
+ %undef SYS_sigaction
+ %undef USE_PIPE
+%endif
%else
%ifdef W32 ;----------------------- W I N 32 -----------------------
@@ -586,9 +631,18 @@ db "sharing violation",10 ;32
%ifdef TERMIOS_SET
+%ifdef ARMCPU
+ struc termios_struc
+.c_iflag: resd 1
+.c_oflag: resd 1
+.c_cflag: resd 1
+.c_lflag: resd 1
+.c_line: resb 1
+.c_cc: resb NCCS
+ endstruc
+%else
%define tcflag_t resd
%define cc_t resb
-
struc termios_struc
.c_iflag: tcflag_t 1
.c_oflag: tcflag_t 1
@@ -610,7 +664,7 @@ c_ispeed speed_t3 1
c_ospeed speed_t3 1
%endif
endstruc
-
+%endif
struc winsize_struc
.ws_row:resw 1
.ws_col:resw 1
@@ -631,15 +685,9 @@ c_ospeed speed_t3 1
;-------
%ifndef LINUX
%undef CRIPLED_ELF
+ %undef UTF8
%endif
;
-%ifdef LESSWRITEOPS ;constraints
- %define LESSWRITEOPS_OR_CURSORMGNT
-%endif
-%ifdef CURSORMGNT
- %define LESSWRITEOPS_OR_CURSORMGNT
-%endif
-
stdtxtlen equ 10 ;do not move this to EOF: code size would increase
%ifdef FREEBSD
@@ -715,6 +763,7 @@ phdr2: ;another Elf32_Phdr starts here
%endmacro
%endif
;-------
+%ifndef ARMCPU
%macro ORGheader 0
%ifdef USE_SPECIAL_HEADER
%ifdef TINLINK
@@ -727,8 +776,41 @@ phdr2: ;another Elf32_Phdr starts here
;nothing
%endif
%endmacro
+%endif
;-------
%ifdef DYN ;DYN == "libc dynamic linked"
%define _start main ;call it "main", libc startup code expects this name
%endif
+
+;-------
+%ifdef AMD64
+; %undef SYS_sigaction
+; %undef SYS_kill
+
+ %macro PUSH_ALL 0
+ push rax
+ push rbx
+ push rcx
+ push rdx
+ push rsi
+ push rdi
+ push rbp
+ %endmacro
+ %macro POP_ALL 0
+ pop rbp
+ pop rdi
+ pop rsi
+ pop rdx
+ pop rcx
+ pop rbx
+ pop rax
+ %endmacro
+%else
+ %macro PUSH_ALL 0
+ pusha
+ %endmacro
+ %macro POP_ALL 0
+ popa
+ %endmacro
+%endif
;--------------------------------------------------------------------------
diff --git a/e3.html b/e3.html
index 5074d37..328f92f 100644
--- a/e3.html
+++ b/e3.html
@@ -315,42 +315,51 @@ assembled executable for Linux, FreeBSD, NetBSD, OpenBSD, BeOS(tm), QNX(tm).
<DT><B>e3.exe </B></DT>
<DD>is an assembled
-executable for 32 bit Win versions like 95/98/ME/etc, but not suitable
-for 16 bit versions of Win. </DD>
+executable for 32 bit Win versions like 95/98/ME/etc. </DD>
<DT><B>e3c </B></DT>
-<DD>is a 'C' compiled executable for some other
-platforms, optional built. </DD>
+<DD>is a 'C' compiled
+executable for some other platforms, optional built, supporting WS key
+bindings only. </DD>
+
+<DT><B>e3arm </B></DT>
+<DD>is a new experimental (alpha code quality) assembled
+executable for ARM Linux, optional built (identical e3, but no arithmetics
+and no UNDO available). </DD>
<DT><B>e3.hlp </B></DT>
<DD>help text file (for e3c only) </DD>
<DT><B>e3.res </B></DT>
<DD>error
-message text file (for e3c only) <P>
+message text file (for e3c only) </DD>
+
+<DT><B>e3-16 </B></DT>
+<DD><I>e3-16</I>, <I>e3-16.com</I>, <I>e3-16e.exe</I> are special
+bonus files for 16 bit operating systems ELKS (==Embeddable Linux Kernel
+Subset) and DOS, supporting WS key bindings only. <P>
</DD>
</DL>
<H2><A NAME="sect9" HREF="#toc9">Copyright</A></H2>
-e3 is Copyright (c) 2000,01,02
-<P>
-Albrecht Kleine <P>
- 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 the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version. <P>
- This program is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
-warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details. <P>
- You should have received a
-copy of the GNU General Public License along with this program; if not,
-write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
-02139, USA. <P>
+e3 is Copyright
+(c) 2000,01,02,03 Albrecht Kleine <P>
+ 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 the Free Software Foundation; either version 2
+of the License, or (at your option) any later version. <P>
+ This program is
+distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the GNU General Public License for more details. <P>
+ You should
+have received a copy of the GNU General Public License along with this
+program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA. <P>
<H2><A NAME="sect10" HREF="#toc10">Bugs</A></H2>
-There probably are some, but I don't know what they are
-yet. <P>
+There probably are some, but I don't know
+what they are yet. <P>
<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
diff --git a/e3.man b/e3.man
index d172687..9423385 100644
--- a/e3.man
+++ b/e3.man
@@ -267,20 +267,30 @@ is an assembled executable for Linux, FreeBSD, NetBSD, OpenBSD, BeOS(tm), QNX(tm
\fIe3ws\fP, \fIe3em\fP, \fIe3pi\fP, \fIe3vi\fP, \fIe3ne\fP are symbolic links to e3.
.TP
\fBe3.exe
-is an assembled executable for 32 bit Win versions like 95/98/ME/etc,
-but not suitable for 16 bit versions of Win.
+is an assembled executable for 32 bit Win versions like 95/98/ME/etc.
.TP
\fBe3c
-is a 'C' compiled executable for some other platforms, optional built.
+is a 'C' compiled executable for some other platforms, optional built,
+supporting WS key bindings only.
+.TP
+\fBe3arm
+is a new experimental (alpha code quality) assembled executable for ARM Linux,
+optional built (identical e3, but no arithmetics and no UNDO available).
.TP
\fBe3.hlp
help text file (for e3c only)
.TP
\fBe3.res
error message text file (for e3c only)
+.TP
+\fBe3-16
+\fIe3-16\fP, \fIe3-16.com\fP, \fIe3-16e.exe\fP
+are special bonus files for 16 bit operating systems
+ELKS (==Embeddable Linux Kernel Subset) and DOS,
+supporting WS key bindings only.
.SH COPYRIGHT
-e3 is Copyright (c) 2000,01,02 Albrecht Kleine
+e3 is Copyright (c) 2000,01,02,03 Albrecht Kleine
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
diff --git a/e3_nasm_yasm.sed b/e3_nasm_yasm.sed
new file mode 100644
index 0000000..dcb24eb
--- /dev/null
+++ b/e3_nasm_yasm.sed
@@ -0,0 +1,16 @@
+s/jmp short/jmp/g
+s/jmp /jmp near /g
+s/jnz /jnz near /g
+s/jz /jz near /g
+s/ja /ja near /g
+s/jna /jna near /g
+s/jc /jc near /g
+s/jnc /jnc near /g
+s/je /je near /g
+s/jne /jne near /g
+s/jbe /jbe near /g
+s/jae /jae near /g
+s/jb /jb near /g
+s/js /js near /g
+s/jnb /jnb near /g
+s/jns /jns near /g
diff --git a/e3_yasm_yasm64.sed b/e3_yasm_yasm64.sed
new file mode 100644
index 0000000..126bb25
--- /dev/null
+++ b/e3_yasm_yasm64.sed
@@ -0,0 +1,19 @@
+s/bits 32/bits 64/g
+s/push dword/push qword/g
+s/push eax/push rax/g
+s/push ebx/push rbx/g
+s/push ecx/push rcx/g
+s/push edx/push rdx/g
+s/push esi/push rsi/g
+s/push edi/push rdi/g
+s/push ebp/push rbp/g
+s/pop dword/pop qword/g
+s/pop eax/pop rax/g
+s/pop ebx/pop rbx/g
+s/pop ecx/pop rcx/g
+s/pop edx/pop rdx/g
+s/pop esi/pop rsi/g
+s/pop edi/pop rdi/g
+s/pop ebp/pop rbp/g
+s/call ebx/call rbx/g
+s/esp/rsp/g \ No newline at end of file
diff --git a/e3c/Makefile b/e3c/Makefile
index 5b373e1..fc48411 100644..120000
--- a/e3c/Makefile
+++ b/e3c/Makefile
@@ -1,35 +1 @@
-# edit dest dir prefix if you want....
-
- PREFIX='/usr/local'
-# PREFIX=/boot/home
-# (used /boot/home in BeOS)
-
-LIBDIR='$(PREFIX)/lib'
-BINDIR='$(PREFIX)/bin'
-MANSEC='1'
-MANDIR='$(PREFIX)/man/man$(MANSEC)'
-
-
-##_____________________________________________________________
-
-CTARGET=e3c
-CSOURCES=e3.c
-CFLAGS = -Wall -g -O2 -fomit-frame-pointer
-
-all: $(CTARGET)
-
-
-$(CTARGET): $(CSOURCES) Makefile
- gcc $(CFLAGS) -DLIBDIR=\"$(PREFIX)/lib\" $(CSOURCES) -o $(CTARGET)
- strip $(CTARGET)
-
-list: $(CSOURCES) Makefile
- gcc $(CFLAGS) -Wa,-a -c -g -DLIBDIR=\"$(PREFIX)/lib\" $(CSOURCES) >e3c.list
-
-install: $(CTARGET)
- install -d $(PREFIX) $(BINDIR) $(LIBDIR) $(MANDIR)
- install -m 755 $(CTARGET) $(BINDIR)
- install -m 644 e3ws.hlp $(LIBDIR)
- install -m 644 e3.res $(LIBDIR)
- install -m 644 $(CTARGET).man $(MANDIR)/$(CTARGET).$(MANSEC)
-
+Makefile.x86 \ No newline at end of file
diff --git a/e3c/Makefile.arm b/e3c/Makefile.arm
new file mode 100644
index 0000000..f1bc8a5
--- /dev/null
+++ b/e3c/Makefile.arm
@@ -0,0 +1,39 @@
+# edit dest dir prefix if you want....
+
+ PREFIX='/usr/local'
+# PREFIX=/boot/home
+# (used /boot/home in BeOS)
+
+LIBDIR='$(PREFIX)/lib'
+BINDIR='$(PREFIX)/bin'
+MANSEC='1'
+MANDIR='$(PREFIX)/man/man$(MANSEC)'
+
+GCC='/opt/Embedix/tools/bin/arm-linux-gcc'
+STRIP='/opt/Embedix/tools/bin/arm-linux-strip'
+#GCC='gcc'
+#STRIP=strip
+
+##_____________________________________________________________
+
+CTARGET=e3c
+CSOURCES=e3.c
+CFLAGS = -Wall -g -O1
+
+all: $(CTARGET)
+
+
+$(CTARGET): $(CSOURCES) Makefile
+ $(GCC) $(CFLAGS) -DLIBDIR=\"$(PREFIX)/lib\" $(CSOURCES) -o $(CTARGET)
+ $(STRIP) $(CTARGET)
+
+list: $(CSOURCES) Makefile
+ $(GCC) $(CFLAGS) -Wa,-a -c -g -DLIBDIR=\"$(PREFIX)/lib\" $(CSOURCES) >e3c.list
+
+install: $(CTARGET)
+ install -d $(PREFIX) $(BINDIR) $(LIBDIR) $(MANDIR)
+ install -m 755 $(CTARGET) $(BINDIR)
+ install -m 644 e3ws.hlp $(LIBDIR)
+ install -m 644 e3.res $(LIBDIR)
+ install -m 644 $(CTARGET).man $(MANDIR)/$(CTARGET).$(MANSEC)
+
diff --git a/e3c/Makefile.x86 b/e3c/Makefile.x86
new file mode 100644
index 0000000..76dbfd3
--- /dev/null
+++ b/e3c/Makefile.x86
@@ -0,0 +1,39 @@
+# edit dest dir prefix if you want....
+
+ PREFIX='/usr/local'
+# PREFIX=/boot/home
+# (used /boot/home in BeOS)
+
+LIBDIR='$(PREFIX)/lib'
+BINDIR='$(PREFIX)/bin'
+MANSEC='1'
+MANDIR='$(PREFIX)/man/man$(MANSEC)'
+
+#GCC='/opt/Embedix/tools/bin/arm-linux-gcc'
+#STRIP='/opt/Embedix/tools/bin/arm-linux-strip'
+GCC='gcc'
+STRIP=strip
+
+##_____________________________________________________________
+
+CTARGET=e3c
+CSOURCES=e3.c
+CFLAGS = -w -g -O1
+
+all: $(CTARGET)
+
+
+$(CTARGET): $(CSOURCES) Makefile
+ $(GCC) $(CFLAGS) -DLIBDIR=\"$(PREFIX)/lib\" $(CSOURCES) -o $(CTARGET)
+ $(STRIP) $(CTARGET)
+
+list: $(CSOURCES) Makefile
+ $(GCC) $(CFLAGS) -Wa,-a -c -g -DLIBDIR=\"$(PREFIX)/lib\" $(CSOURCES) >e3c.list
+
+install: $(CTARGET)
+ install -d $(PREFIX) $(BINDIR) $(LIBDIR) $(MANDIR)
+ install -m 755 $(CTARGET) $(BINDIR)
+ install -m 644 e3ws.hlp $(LIBDIR)
+ install -m 644 e3.res $(LIBDIR)
+ install -m 644 $(CTARGET).man $(MANDIR)/$(CTARGET).$(MANSEC)
+
diff --git a/e3c/e3.c b/e3c/e3.c
index b21b94c..31976bc 100644
--- a/e3c/e3.c
+++ b/e3c/e3.c
@@ -845,7 +845,7 @@ GetEditScreenSize:
eax = *(long*)edx; // each 16 bit lines,columns
if (!eax) eax = 0x00500018; // i.e. (80<<16)+24 (assume 80x24)
lines = (eax-1)&0xFF; // without status line
-#if 0
+#if 1
// this is not portable: maybe 32bit Linux plus some Un*x systems ?
columns = eax >> 16; // columns > 255 are ignored...
#else
@@ -1515,7 +1515,7 @@ RestoreStatusLine:
PUSH(edi); // important e.g. for asksave
CALL(InitStatusLine,153);
ecx = columns; // width
- if (ecx < (stdtxtlen+15+5+2)) goto RSno_lineNr; // this window is too small
+ if (ecx < (stdtxtlen+1 +5+2)) goto RSno_lineNr; // this window is too small
screenline[1] = changed;
ebx = (int)542330441; //(' SNI'); // Insert
if (insstat==1) goto RSL1;
@@ -1529,13 +1529,13 @@ RSL1:
ebx >>=8;
*((unsigned char*)&(screenline[7])) = (char)ebx;
edi = (long)(screenline+stdtxtlen);
- ecx-=(stdtxtlen+15+5); // space for other than filename
+ ecx-=(stdtxtlen+1+5); // space for other than filename
esi = (long)&filepath;
RSL2: eax=*(unsigned char*)esi++;
if (!eax) goto RSL4;
*(unsigned char*)edi++=eax;
if (--ecx) goto RSL2;
-RSL4: edi = (long)&(screenline[-15]);
+RSL4: edi = (long)&(screenline[-2]);
edi+=columns;
eax = columne;
++eax; // start with 1