summaryrefslogtreecommitdiffstats
path: root/tests/tc999_projects/overflow.awl
blob: e45687e3d1f558aa85dcb39a1c73fe7e16bc4828 (plain)
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
ORGANIZATION_BLOCK OB 1
BEGIN

	// no overflow
	// start	= 1000
	// end		= 3000
	// diff		= 2000
	L		3000
	L		1000
	-D
	UD		DW#16#7FFFFFFF
	T		MD 0


	// overflow
	// start	= 2147483646
	// end		= 5
	// diff		= 7
	L		5
	L		L#2147483646
	-D
	UD		DW#16#7FFFFFFF
	T		MD 4


	// overflow
	// start	= 2147483646
	// end		= 2000000000
	// diff		= 2000000002
	L		L#2000000000
	L		L#2147483646
	-D
	UD		DW#16#7FFFFFFF
	T		MD 8


	__ASSERT==	MD 0,	2000
	__ASSERT==	MD 4,	7
	__ASSERT==	MD 8,	L#2000000002


	CALL SFC 46 // STOP CPU
END_ORGANIZATION_BLOCK
bues.ch cgit interface