This file is indexed.

/usr/share/z88dk/lib/gray85.asm is in z88dk-data 1.8.ds1-10.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
; Graylib interrupt installer
; Ported and heavily modified by Stefano Bodrato - Mar 2000
; Lateron more modified by Henk Poley - Sep 2001
;
; original code (graydraw.asm) by:
;
;------------------------------------------------------------
; Date:     Sun, 5 May 1996 12:44:17 -0400 (EDT)
; From:     Jingyang Xu  [br00416@bingsuns.cc.binghamton.edu]
; Subject:  LZ: Graydraw source!
;------------------------------------------------------------
;
; $Id: gray85.asm,v 1.4 2002/04/10 20:31:10 dom Exp $
;

	XDEF	graybit1
	XDEF	graybit2

defc	intcount = $8980

	ld	hl,($8be5)		; Get end of VAT
	dec	hl			; Make sure we're clear it..
	dec	hl			;
	
	ld	a,h			; Now we need to get the position of
	sub	4			;  the nearest screen boundary
	ld	h,a			;
	ld	l,0			;
	push	hl			;

	ld	de,($8be1)		; Tests if there is a space for the 1K
	or	a			;  needed for the 2nd screen
	sbc	hl,de			;
	pop	hl			;
	jr	c,cleanup		; If not, stop the program...

	and	@11000000		; Test if our block of memory is
	cp	@11000000		;  within the range addressable
	jr	nz,cleanup		;  by the LCD hardware

	ld	(graybit2),hl		; Save the address of our 2nd Screen

	ld	a,h			; If in range, set up the signal to
	and	@00111111		;  send thrue port 0 to switch to our
	ld	(page2),a		;  2nd screen
;----
	;dec	h			; Set the IV for IM2 mode
	;ld	a,h			;
	;ld	i,a			;
	
	;ld      (hl),IntProcStart&$FF	; Set the IV table
	;inc     hl			;
	;ld      (hl),IntProcStart/256	;
	;ld	d,h			;
	;ld	e,l			;
	;dec	hl			;
	;inc	de			;
	;ld	bc,$0100		;
	;ldir				;
;----
	im	1			;
	ld	a,$87			; locate vector table at $8700-$8800
	ld	i,a			;
	ld	bc,$0100		; vector table is 256 bytes 
	ld	h,a			;
	ld	l,c			; HL = $8700
	ld	d,a			;
	ld	e,b			; DE = $8801
	inc	a			; A  = $88
	ld	(hl),a			; interrupt "program" located at 8888h
	ldir				;
					;
	ld	l,a			; HL = $8787
	ld	(hl),$C3		; Put a JP IntProcStart at $8787
	ld	de,IntProcStart		; (Done this way for relocatable code...)
	inc	hl			;
	ld	(hl),e			;
	inc	hl			;
	ld	(hl),d			;
;----
	xor	a			; Init counter
	ld	(intcount),a		;
	im	2			; Enable int
	jp	jump_over		; Jump over the interrupt code

;.IntProcStart
;	push	af			;
;	ld	a,(intcount)		; Check if own interrupt has quited
;	bit	7,a			;  correctly, then bit 7 is zero
;	jr	nz,int_fix		; If not zero, fix stack...
;	push	hl			;
;	push	de			;
;	push	bc			;
;	push	iy			;
;	ld	iy,_IY_TABLE		;
;					;
;.cont_interrupt			;
;	in	a,(3)			;
;	bit	1,a			; check that it is a vbl interrupt
;	jr	z,EndInt		;
;					;
;	ld	a,(intcount)		;
;	res	7,(hl)			;
;	cp	2			;
;	jr	z,Disp_2		;
;					;
;.Disp_1				;
;	inc	a			;
;	ld	(intcount),a		;
;	ld	a,(page2)		;
;	out	(0),a			;
;	jr	EndInt			;
;.Disp_2				;
;	ld	a,$3c			;
;	out	(0),a			;
;	sub	a			;
;	ld	(intcount),a		;
;.EndInt				;
;	ld	hl,intcount		; If a 'direct interrupt' occures    
;	set	7,(hl)			;  right after the TIOS-int, then
;					;  we want bit 7 to be set...
;	exx				; Swap to shadow registers.
;	ex	af,af			; So the TIOS swaps back to the
;					;  normal ones... (the ones we saved
;					;  with push/pops)
;	rst	$38			;
;	di				; 'BIG' HOLE HERE... (TIOS does ei...)
;	ex	af,af			;
;	exx				;
;					;
;	ld	hl,intcount		; Interrupt returned correctly, so
;	res	7,(hl)			;  we reset our error-condition...
;	pop	iy			;
;	pop	bc			;
;	pop	de			;
;	pop	hl			;
;	pop	af			;
;	ei				;
;	ret				; Return to program
;					;
;.int_fix				;
;	pop	af			; Pop AF back
;	ex	af,af			; Fix shadowregs back
;	exx				;
;	pop	bc			; Pop the returnpoint of RST $38
;					;  from the stack
;	jr	cont_interrupt		; Continue with interrupt
;.IntProcEnd

.IntProcStart
	push	af			;
	in	a,(3)			;
	bit	1,a			; check that it is a vbl interrupt
	jr	z,EndInt		;
					;
	ld	a,(intcount)		;
	cp	2			;
	jr	z,Disp_2		;
					;
.Disp_1					;
	inc	a			;
	ld	(intcount),a		;
	ld	a,(page2)		;
	out	(0),a			;
	jr	EndInt			;
.Disp_2
	ld	a,$3c			;
	out	(0),a			;
	sub	a			;
	ld	(intcount),a		;
.EndInt					;
	pop	af			;
	ei				;
	ret				; Skip standard interrupt
.IntProcEnd

.graybit1 defw VIDEO_MEM
.graybit2 defw 0
.page2    defb 0

.jump_over
;	ld	hl,(graybit2)		; Whipe the 2nd screen clean
;	ld	d,h
;	ld	e,l
;	inc	de
;	ld	(hl),0
;	ld	bc,1023
;	ldir