aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.asm/asmsrc1.s
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>1998-03-13 01:36:59 +0000
committerDoug Evans <dje@google.com>1998-03-13 01:36:59 +0000
commit681a9f4adbd3fb0b5ca24866a84d5b00784c533f (patch)
tree89a1a07223e8d475c2d6ef004bb4e7832e505e11 /gdb/testsuite/gdb.asm/asmsrc1.s
parent89d7d8094b2f11c073035007c92aac5188358440 (diff)
downloadgdb-681a9f4adbd3fb0b5ca24866a84d5b00784c533f.zip
gdb-681a9f4adbd3fb0b5ca24866a84d5b00784c533f.tar.gz
gdb-681a9f4adbd3fb0b5ca24866a84d5b00784c533f.tar.bz2
snapshot
Diffstat (limited to 'gdb/testsuite/gdb.asm/asmsrc1.s')
-rw-r--r--gdb/testsuite/gdb.asm/asmsrc1.s61
1 files changed, 61 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.asm/asmsrc1.s b/gdb/testsuite/gdb.asm/asmsrc1.s
new file mode 100644
index 0000000..1eba17b
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/asmsrc1.s
@@ -0,0 +1,61 @@
+; "main" routine for assembly source debugging test
+; Eventually this code needs to be made more machine independent
+; (with the actual code coming from macros in some header file)
+; so that the same driver will work for several architectures.
+
+ .macro exit0
+ ldi r4, 1
+ ldi r0, 0
+ trap 15
+ .endm
+
+ .macro several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+; FIXME: For now we include crt0.
+; For a portable testcase we should use the standard one.
+
+ .globl _start
+_start:
+; set up the stack
+ ldi sp, 0x8000
+ mvtc sp, psw ; psw <- SW
+ ldi sp, 0x7ffe ; 0x7ffe is a magic number known to gdb: "top of stack"
+; Call main, then exit.
+ bl main
+ bl exit
+
+; Program begins here.
+
+ .global main
+main:
+ st r13,@-sp
+
+; Call a macro that consists of several lines of assembler code.
+
+ several_nops
+
+; Call a subroutine in another file.
+
+ bl foo2
+
+; All done.
+
+ exit0
+
+; A routine for foo2 to call.
+
+ .global foo3
+foo3:
+ st r13,@-sp
+
+ ld r13,@sp+
+ jmp r13
+
+ .global exit
+exit:
+ exit0