Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!rutgers!aramis.rutgers.edu!topaz.rutgers.edu!jjoshua From: jjoshua@topaz.rutgers.edu (Jon Joshua) Newsgroups: comp.sys.mac.programmer Subject: patching SetPort() Keywords: kaboom Message-ID: Date: 18 Feb 90 01:57:50 GMT Organization: Rutgers Univ., New Brunswick, N.J. Lines: 51 I am trying to patch SetPort() to eventually do some neat things. Since this is my first attempt at something like this I decided to write a simple patch that does nothing except tell me that it is alive and well inside the machine. This is in LS C with standard headers turned off. --- void main (); header () /* not a function */ { asm { bra.s @start ;Jump over storage tAddr: dc.l 0 ;Save SetPort trap addr here start: jsr main ;Do neat stuff move.l @tAddr,a1 ;Load orig SetPort trap addr jmp (a1) ;Outa' here } } void main () { SysBeep (5); } --- Notes: It works under finder and not MF. MacsBug says it dies in the following way: 1111 ERR 850130: 6100 6100612A MOVE.W D7,D6 >WH In ROM @ 4175D2 A058 InsTime Question: Could someone please shed some light on what might be happening? Why only under MF and not finder. I tried booting with 0 INITs/CDEVs etc. and the same thing happened. Thanks, JOn. PS. Thanks to the few people who have been helping me so far. -- /\ ? ________________ jjoshua@topaz.rutgers.edu \ ____ __ fgu |.signature under| Anything is possible... \ | | / | orywlut- | construction | ========== gfgsdfsdfsd |________________| _____________________________OO_____O___hfdhksjdhfksjdfs_______||__________||__