Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!ig!jade!saturn!ssyx!koreth From: koreth@ssyx.ucsc.edu (Steven Grimm) Newsgroups: comp.sys.atari.st Subject: Re: RTE causing bus error Message-ID: <1139@saturn.ucsc.edu> Date: Mon, 16-Nov-87 15:27:32 EST Article-I.D.: saturn.1139 Posted: Mon Nov 16 15:27:32 1987 Date-Received: Sat, 21-Nov-87 00:48:40 EST References: <1498@ihlpm.ATT.COM> Sender: usenet@saturn.ucsc.edu Reply-To: koreth@ssyx.ucsc.edu (Steven Grimm) Organization: University of California, Santa Cruz Lines: 34 Keywords: bus error, rte In article <1498@ihlpm.ATT.COM> nicholso@ihlpm.ATT.COM (B E Nicholson) writes: >[ Line eater, come and get it] > > >I've recently been developing some code which installs it's own interrupt, >and trap handlers. Unfortunately, whenever the code tries to return to >the original code a bus error results. For example, if the routine >_clock_int is installed as either a trap, timer interrupt, or any other >exception handler by the main routine when the rte instruction is executed >at the end of the _restart routine a bus error will result. I'm a little >lost as to why. > > (assembly code follows) What is that routine supposed to do? Knowing that makes debugging it a lot easier. At first glance, it looks like it could be a task-switcher for a multitasking kernel; is that it? It looks like you aren't doing the same number of pushes and pops to the stack. That could be intentional (if you're doing multitasking), but is a pretty sure way to get a bus error. My advice to you is to trace your code on paper, keeping track of exactly what's on the user and supervisor stacks. Remember that exceptions push the status register and return address to the supervisor stack before running the exception code; make sure you know in what order those are pushed, as that can mess you up too. Hope that helps. +New! Improved! Now 100% Artificial-+-+-----------------------------------+ |# # @@@ **** &&&&& $$$$$ % %| |Steven Grimm | |# # @ @ * * & $ % %+-+ ARPA: koreth@ucscb.ucsc.edu | |### @ @ **** &&&& $ %%%%%| | UUCP: ...!ucbvax!ucscc!ssyx!koreth| |# # @ @ * * & $ % %+-+ ______________________________| |# # @@@ * ** &&&&& $ % %| | |"Let's see what's out there."| +-----with NutraSour(TM)! No natural colors or preservatives!------------+