00001 /* 00002 * divhi3.c 00003 * 00004 * Wrapper for ROM divhi3 routine, a 16-bit signed divide: r0 /= r1 00005 * 00006 * The contents of this file are subject to the Mozilla Public License 00007 * Version 1.0 (the "License"); you may not use this file except in 00008 * compliance with the License. You may obtain a copy of the License at 00009 * http://www.mozilla.org/MPL/ 00010 * 00011 * Software distributed under the License is distributed on an "AS IS" 00012 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 00013 * License for the specific language governing rights and limitations 00014 * under the License. 00015 * 00016 * The Original Code is Librcx code, released February 9, 1999. 00017 * 00018 * The Initial Developer of the Original Code is Kekoa Proudfoot. 00019 * Portions created by Kekoa Proudfoot are Copyright (C) 1999 00020 * Kekoa Proudfoot. All Rights Reserved. 00021 * 00022 * Contributor(s): Kekoa Proudfoot <kekoa@graphics.stanford.edu> 00023 */ 00024 00025 __asm__ ( 00026 ".section .text\n\t" 00027 ".global ___divhi3\n" 00028 "___divhi3:\n\t" 00029 "push r5\n\t" 00030 "push r6\n\t" 00031 "mov.w r0,r6\n\t" 00032 "mov.w r1,r5\n\t" 00033 "jsr @@82\n\t" 00034 "mov.w r6,r0\n\t" 00035 "pop r6\n\t" 00036 "pop r5\n\t" 00037 "rts" 00038 );