1 ;-------------------------------------------------------- 2 ; File Created by SDCC : FreeWare ANSI-C Compiler 3 ; Version 2.1.9Ga Sun Jan 16 17:31:28 2000 4 5 ;-------------------------------------------------------- 6 .module _gptrget 7 ;-------------------------------------------------------- 8 ; publics variables in this module 9 ;-------------------------------------------------------- 10 .globl __gptrget 11 ;-------------------------------------------------------- 12 ; special function registers 13 ;-------------------------------------------------------- 14 ;-------------------------------------------------------- 15 ; special function bits 16 ;-------------------------------------------------------- 17 ;-------------------------------------------------------- 18 ; internal ram data 19 ;-------------------------------------------------------- 20 .area DSEG (DATA) 21 ;-------------------------------------------------------- 22 ; overlayable items in internal ram 23 ;-------------------------------------------------------- 24 .area OSEG (OVR,DATA) 25 ;-------------------------------------------------------- 26 ; indirectly addressable internal ram data 27 ;-------------------------------------------------------- 28 .area ISEG (DATA) 29 ;-------------------------------------------------------- 30 ; bit data 31 ;-------------------------------------------------------- 32 .area BSEG (BIT) 33 ;-------------------------------------------------------- 34 ; external ram data 35 ;-------------------------------------------------------- 36 .area XSEG (XDATA) 37 ;-------------------------------------------------------- 38 ; global & static initialisations 39 ;-------------------------------------------------------- 40 .area GSINIT (CODE) 41 ;-------------------------------------------------------- 42 ; code 43 ;-------------------------------------------------------- 44 .area CSEG (CODE) 0000 45 G$_gptrget$0$0 ==. 46 ; _gptrget.c 26 47 ; ----------------------------------------- 48 ; function _gptrget 49 ; ----------------------------------------- 0000 50 __gptrget: 0002 51 ar2 = 0x02 0003 52 ar3 = 0x03 0004 53 ar4 = 0x04 0005 54 ar5 = 0x05 0006 55 ar6 = 0x06 0007 56 ar7 = 0x07 0000 57 ar0 = 0x00 0001 58 ar1 = 0x01 59 ; _gptrget.c 81 60 ; save values passed 0000 C8 61 xch a,r0 0001 C0 E0 62 push acc 63 ; 64 ; depending on the pointer type 65 ; 0003 E5 F0 66 mov a,b 0005 60 0D 67 jz 00001$ 0007 14 68 dec a 0008 60 0F 69 jz 00002$ 000A 14 70 dec a 000B 60 0F 71 jz 00003$ 000D 14 72 dec a 000E 60 10 73 jz 00004$ 74 ; 75 ; any other value for type 76 ; return xFF 0010 74 FF 77 mov a,#0xff 0012 80 0F 78 sjmp 00005$ 79 ; 80 ; Pointer to data space 81 ; 0014 82 00001$: 0014 A8 82 83 mov r0,dpl ; use only low order address 0016 E6 84 mov a,@r0 0017 80 0A 85 sjmp 00005$ 86 ; 87 ; pointer to xternal data 88 ; 0019 89 00002$: 0019 E0 90 movx a,@dptr 001A 80 07 91 sjmp 00005$ 92 ; 93 ; pointer to code area 94 ; 001C 95 00003$: 001C E4 96 clr a 001D 93 97 movc a,@a+dptr 001E 80 03 98 sjmp 00005$ 99 ; 100 ; pointer to xternal stack 101 ; 0020 102 00004$: 0020 A8 82 103 mov r0,dpl 0022 E2 104 movx a,@r0 105 ; 106 ; restore and return 107 ; 0023 108 00005$: 0023 F8 109 mov r0,a 0024 D0 E0 110 pop acc 0026 C8 111 xch a,r0 0027 112 00101$: 0027 113 C$_gptrget.c$83$1$1 ==. 0027 114 XG$_gptrget$0$0 ==. 0027 22 115 ret 116 .area CSEG (CODE)