From 0fb43293bc938b543f192110b65f9954a6d68095 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Wed, 30 May 2018 21:37:54 +0100 Subject: [PATCH] VERSA: Implement tab and backspace. @ uses tabs when formatting /C cross-reference pages. --- src/dcp/versa.211 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/dcp/versa.211 b/src/dcp/versa.211 index c9bd73bc..1e6b69c5 100644 --- a/src/dcp/versa.211 +++ b/src/dcp/versa.211 @@ -4578,7 +4578,30 @@ normal: skipn outena return backsp: -tab: aos (p) +tab: skipn outena ;do nothing if output disabled + jrst bspfin + push p,x ;save char + move x,xgp.x ;save original pos + push p,x + movei x,40 ;output space + call normal + jfcl + move z,xgp.x ;compute width of space (including seper) + pop p,x ;restore original pos + sub z,x + pop p,y ;are we doing a backspace? + cain y,^H + jrst bspbsp + imuli z,8 ;compute width of tab + sub x,lftmar ;how many tabs are we from the margin? + idiv x,z + aos x ;move right to next tab stop + imul x,z + add x,lftmar + skipa +bspbsp: sub x,z ;move left by one space + movem x,xgp.x +bspfin: aos (p) return linefd: jrst linfin