File: link.s

package info (click to toggle)
gdb-doc 16.3-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid, trixie
  • size: 244,264 kB
  • sloc: ansic: 2,134,731; asm: 375,582; exp: 206,875; cpp: 73,639; makefile: 70,232; sh: 26,038; python: 13,697; yacc: 11,341; ada: 7,358; xml: 6,098; perl: 5,077; pascal: 3,389; tcl: 2,986; f90: 2,764; lisp: 1,984; cs: 879; lex: 738; sed: 228; awk: 181; objc: 137; fortran: 57
file content (67 lines) | stat: -rw-r--r-- 995 bytes parent folder | download | duplicates (33)
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
# Blackfin testcase for link/unlink instructions
# mach: bfin

	.include "testutils.inc"

	start

	/* give FP/RETS known/different values */
	R7.H = 0xdead;
	R7.L = 0x1234;
	RETS = R7;
	R6 = R7;
	R6 += 0x23;
	FP = R6;

	/* SP should have moved by -8 bytes (to push FP/RETS) */
	R0 = SP;
	LINK 0;
	R1 = SP;
	R1 += 8;
	CC = R0 == R1;
	IF !CC JUMP 1f;

	/* FP should now have the same value as SP */
	R1 = SP;
	R2 = FP;
	CC = R1 == R2;
	IF !CC JUMP 1f;

	/* make sure FP/RETS on the stack have our known values */
	R1 = [SP];
	CC = R1 == R6;
	IF !CC JUMP 1f;

	R1 = [SP + 4];
	CC = R1 == R7;
	IF !CC JUMP 1f;

	/* UNLINK should:
	 *	assign SP to current FP
	 *	adjust SP by -8 bytes
	 *	restore RETS/FP from the stack
	 */
	R4 = 0;
	RETS = R4;
	R0 = SP;
	UNLINK;

	/* Check new SP */
	R1 = SP;
	R1 += -0x8;
	CC = R1 == R0;
	IF !CC JUMP 1f;

	/* Check restored RETS */
	R1 = RETS;
	CC = R1 == R7;
	IF !CC JUMP 1f;

	/* Check restored FP */
	R1 = FP;
	CC = R1 == R6;
	IF !CC JUMP 1f;

	pass
1:
	fail