3 ;;; Copyright 2003 Free Software Foundation, Inc.
5 ;;; This file is part of GNU Radio
7 ;;; GNU Radio is free software; you can redistribute it and/or modify
8 ;;; it under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3, or (at your option)
10 ;;; any later version.
12 ;;; GNU Radio is distributed in the hope that it will be useful,
13 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Radio; see the file COPYING. If not, write to
19 ;;; the Free Software Foundation, Inc., 51 Franklin Street,
20 ;;; Boston, MA 02110-1301, USA.
23 ;;; The default external memory initialization provided by sdcc is not
24 ;;; appropriate to the FX2. This is derived from the sdcc code, but uses
25 ;;; the FX2 specific _MPAGE sfr.
28 .area XISEG (XDATA) ; the initialized external data area
29 .area XINIT (CODE) ; the code space consts to init XISEG
30 .area XSEG (XDATA) ; zero initialized xdata
31 .area USBDESCSEG (XDATA); usb descriptors
35 ;; Look at usrp_main.rst and count the bytes from our
36 ;; "normal return location" to the first instruction following
37 ;; the comment: "_mcs51_getRAMCLEAR () start"
39 INSTRUCTION_BYTES_TO_SKIP = 0x29 ; valid for sdcc 2.4.0
44 ;; sfr that sets upper address byte of MOVX using @r0 or @r1
47 __sdcc_external_startup::
48 ; _mcs51_genXINIT() start
53 mov r2,#((l_XINIT+255) >> 8)
56 mov _MPAGE,#(s_XISEG >> 8)
64 00002$: djnz r1,00001$
69 ;; Danger! Total KLUDGE!
70 ;; We pop the return address, add a magic number to it
71 ;; then jump to that address. Believe it or not, this
72 ;; looks like the least kludgy way to handle this,
73 ;; short of patching the compiler...
77 mov a,#INSTRUCTION_BYTES_TO_SKIP