File: black.asm

package info (click to toggle)
pasmo 0.5.3-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 892 kB
  • ctags: 1,805
  • sloc: cpp: 8,508; asm: 3,020; sh: 790; makefile: 627
file content (116 lines) | stat: -rw-r--r-- 1,811 bytes parent folder | download | duplicates (8)
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
	; black.asm

	; Fills slowly the spectrum screen.
	; This program test some capabilities of Pasmo.

	; Try for example:
	; pasmo --tapbas black.asm black.tap
	; pasmo --tapbas --equ NODELAY black.asm black.tap
	; pasmo --tapbas --equ DELAYVALUE=0F000h black.asm black.tap

	; To run it in fuse, for example:
	; fuse black.tap

;		Testing ? short-circuit operator
	org defined LOADPOS ? LOADPOS : 30000

	if defined FILLVALUE
value	equ FILLVALUE
	else
value	equ 0FFh
	endif

start

	; Point to the screen bitmap.

screen		equ defined CPC ? 0C000h : 04000h
	; High word of end of screen
endscreen	equ defined CPC ? 00h : 58h

	if defined USEHL
	ld hl, screen
	else
	ld ix,screen
	endif

other

	; Fills an octet of the screen with the value specified.

	if defined USEHL
	ld (hl), value
	inc hl
	else
	ld (ix), value
	inc ix
	endif

	; Delay

	;if not defined NODELAY
	;if ~ defined NODELAY
	;if ! defined NODELAY
	; Testing short-circuit evaluation.
	if ! defined NODELAY && (! defined DELAYVALUE || DELAYVALUE != 0)
	;if ! defined NODELAY || ! defined DELAYVALUE || DELAYVALUE != 0

;	if defined DELAYVALUE
;loops	equ DELAYVALUE
;	else
;loops	equ 100h
;	endif
;		Testing ? short-circuit operator
loops	equ defined DELAYVALUE ? DELAYVALUE : 100h

;	ld bc, loops
;		Testing high and low operators
	ld b, high loops
	ld c, low loops

delay	dec bc
	ld a,b
	or c
	if defined USEJP
	jp nz, delay
	else
	jr nz, delay
	endif

	endif

	; Test if reached end of screen.

	ld a, 0

	if defined USEHL
	cp l
	else
	cp ixl
	endif

	if defined USEJP
	jp nz, other
	else
	jr nz, other
	endif
	ld a, endscreen

	if defined USEHL
	cp h
	else
	cp ixh
	endif

	if defined USEJP
	jp nz, other
	else
	jr nz, other
	endif

	; And return to Basic.

	ret

	; Set the entry point, needed with the --tapbas option to autorun.
	end start