summaryrefslogtreecommitdiff
path: root/sdas/asz80/tconst.asm
blob: c8f254bccb8326f52bcf93bc14ee877efe7b0ae2 (plain) (blame)
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
	.title	Assembler Link Test Constants

	.module	tconst

	.area	TEST	(ABS,OVR)

	bra1	==	0	; branching constants
	bra2	==	0x80
	bra3	==	0x182
	bra4	==	0x204

	.blkb	0x7E		;bra1:
	.blkb	0x02
	.blkb	0x7F		;bra2:
	.blkb	0x02
	.blkb	0x02
	.blkb	0x7F
	.blkb	0x00		;bra3:
	.blkb	0x02
	.blkb	0x80
	.blkb	0x00		;bra4:

	.globl	bra5,bra6,bra7,bra8

				; branching labels
bra5:	.blkb	0x7E		;bra5:
	.blkb	0x02
bra6:	.blkb	0x7F		;bra6:
	.blkb	0x02
	.blkb	0x02
	.blkb	0x7F
bra7:	.blkb	0x00		;bra7:
	.blkb	0x02
	.blkb	0x80
bra8:	.blkb	0x00		;bra8:


	; 12-Bit numbers are considered valid if:
	;   1) the most significant 4 bits of the 16-bit number are zero
	;   2) the most significant 4 bits of the 16-bit number are all ones

	n0FFF	==	0x0FFF	;largest positive
	n1000	==	0x1000	;+1

	nF000	==	0xF000	;largest negative
	nEFFF	==	0xEFFF	;-1


	.area	DIRECT	(ABS,OVR)
	.setdp

	boundary	==	0x101

	minus1	==	-1	; paging / indexing constants
	zero	==	0
	two55	==	0d255
	two56	==	0d256
	five11	==	0d511
	five12	==	0d512


	.globl	lzero,ltwo55,ltwo56,lminus1

lzero:	.blkb	0x00FF		; paging labels
ltwo55:	.blkb	0x0001
ltwo56:	.blkb	0xFEFF
lminus1:.blkb	0d0000