80-Bus News

  

March-April 1984, Volume 3, Issue 2











Page 14 of 51











Part of Sysb4.Mac. Original code by Richard Beal. Modified by Adrian Perkins l-Jan-1984 to support the following:

ajp002 – When at top of

page, “throw away" spurious CR, LF, CS

5 ; 5; ajpQO1 – Perform page throw by form feeds, not CR,LF ; 3

ajp001 equ true ajpQ02 equ true

if ttyes or Iptes

true for form feed, false for CR,LF true for "intelligence", false original lfi:

er ulles

Routine to support automatic form feed

;

} and perforation skip if ajpoo2

top flag: defb 0

lhs flag: defb 0

5 3

0 = top-of-page, #0 = not at top 0 = at lhe of page, #0 = chars on this line

; Ignore CR, LF, CS if at top lhs

ekes: ld a,c ep lf jr z,ck top ep er dv a,ck top ep cs jr z,ck top Id hl,lhs flag r 1d (hl),1 jr ckesl ck top: ld a,(top flag) r

ora jr nz,ckesl ld a,(lhs flag) : ow or a jr na,ckesl pop hl ret

ekesl: id a,c else

ekes: ld a,c endif ep Lf jr z,1fl ep cs ret nz

; Handle CS pop hl ld (lstel), hl r if ajpO0l « jr skips else

esi: ld a,(lent) r or a jv z,skips dec a ld (lent),a x

eall feed r jr esl endify – 3; Handle line feed if ajp002 LfL: id hl,top flag r

id (h1),1 ld hl,ihs flag

r ld (h1),0 pop hl else

pop hi endif

Id (lstel),hl ; Save return address

Get return address

Get return address

r call feedl ; Do LF

r ld hl,lent Decrement

rt dec (hl) ret nz

if ajp0ol lid c,cs endif

«+ line counter Not at end of pag

ard

; Perforation skip

skips:

skips: If NZ not at top

L€ NZ not at lhs skips] Discard print address

ckesx:

Handle Line feed Ignore {f not CS or LF

Get return address Save return address

3 Send feed:

Get line count

Perforation skip Next Line ; Send

feadl: Do CR/LF

feed2: Loop until end of page

1f aj p002 ld hl,top flag

r ld (n1),0 Id hl,lhs flag

r

ld (hl),0

else

ld a,(lekip) $ Lines to skip r

or a ; Could be none

je z,ckesx

ld b,a

push be

call feed

e

pop be

djnz skipsl

endif

Id a,(plpag) 5 Reset line counter

rc ld (lent),a

r

Lf ajp002

jr feed2

else

ret

endif

CR/LF through the calling routine ld c,er

id hl, feedl 3 Return address

r push hl id hl, (istel) ; Caller address

r

jp (hi)

LF through the calling routine ld c,1lf if ajp0d2

endif ld hl, (istel) 3 Caller address

r je (hl) endif

i \

14

4 ‘


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 14 of 51