📄 as31glue.asx
字号:
; MP3 Player, AS31 to SDCC "glue" Code, http://www.pjrc.com/tech/mp3; Copyright (c) 2000, PJRC.COM, LLC; This program is free software; you can redistribute it and/or; modify it under the terms of the GNU General Public License; as published by the Free Software Foundation; either version 2; of the License, or (at your option) any later version.; This program is distributed in the hope that it will be useful,; but WITHOUT ANY WARRANTY; without even the implied warranty of; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the; GNU General Public License for more details.; You should have received a copy of the GNU General Public License; along with this program; if not, write to the Free Software; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.; As a specific exception to the GPL, the executable object code built; from this source code may be combined with hardware configuration data; files. A hardware configuration data file is a set of data that is; transmitted to an intergrated circuit that is not a general purpose; microprocessor or microcontroller, in order to establish its normal; operation. The process of combining the executable ojbect code built; from the GPL licensed source code with the hardware configuration data; shall be considered an aggregation of another work not based on the; Program. While the GPL does not restrict use of the program, any; use restriction associated with the hardware configuration data (for; example, that it only be used with particular hardware) shall apply; to the combined file which includes a copy of the hardware configuration; data.; Contact: paul@pjrc.com.module as31gluedriver_entry = 0x3000 ;location where "drivers.asm" is builtbank1_call = 0x0FE0 ;entry point in PM2 to xfer control to bank 1dram_page_cfg = 0xFF00 ;DRAM controller page config table.area XSEG (XDATA)_sta013_set_attenuation_PARM_2:: .ds 1_map_block_PARM_2:: .ds 2_sta013_read_PARM_2:: .ds 2_sta013_write_PARM_2:: .ds 2_file_cache_PARM_2:: .ds 4_file_cache_PARM_3:: .ds 4_file_uncache_PARM_2:: .ds 4_file_uncache_PARM_3:: .ds 4_file_seek_PARM_2:: .ds 4_file_read_PARM_2:: .ds 2_file_read_PARM_3:: .ds 1_read_param_1byte_PARM_2:: .ds 1_write_flash_param_PARM_2:: .ds 1_play_block_PARM_2:: .ds 2_dir_read_fast_PARM_2:: .ds 2_set_timer_PARM_2:: .ds 2_file_mem_map_PARM_2:: .ds 1_fill_null_mp3_PARM_2:: .ds 1.area CSEG (CODE) ; void init_uart(void);_init_uart:: ljmp 0x203C ; void timer_setup(void);_timer_setup:: ljmp 0x203E ; void ide_hard_reset(void);_ide_hard_reset:: mov dptr, #driver_entry + 82 ljmp bank1_call ; char ide_init(void);_ide_init:: mov dptr, #driver_entry + 85 ljmp bank1_call ; void ide_flush(void);_ide_flush:: mov dptr, #driver_entry + 88 ljmp bank1_call ; void do_ide_loop(unsigned char num);_do_ide_loop:: mov r2, dpl mov dptr, #driver_entry + 91 ljmp bank1_call ; void ide_sleep(void);_ide_sleep:: mov dptr, #driver_entry + 94 ljmp bank1_call ; char is_ide_sleeping(void);_is_ide_sleeping:: mov dptr, #driver_entry + 97 ljmp bank1_call ; char is_ide_idle(void);_is_ide_idle:: mov dptr, #driver_entry + 100 ljmp bank1_call ; char init_memory_mgr(void);_init_memory_mgr:: mov dptr, #driver_entry + 103 ljmp bank1_call ; unsigned char detect_simm_size(void);_detect_simm_size:: mov dptr, #driver_entry + 106 ljmp bank1_call ; void print_memory_available(void);_print_memory_available:: mov dptr, #driver_entry + 109 ljmp bank1_call ; void map_block(unsigned int block, xdata void *addr);_map_block:: mov r2, dpl mov r3, dph mov dptr, #_map_block_PARM_2 + 1 movx a, @dptr swap a anl a, #15 rl a add a, #dram_page_cfg & 255 mov dpl, a clr a addc a, #dram_page_cfg >> 8 mov dph, a mov a, r2 movx @dptr, a inc dptr mov a, r3 movx @dptr, a ret ; unsigned int malloc_blocks(unsigned char num);_malloc_blocks:: mov r2, dpl mov dptr, #driver_entry + 115 ljmp bank1_call ; void free_blocks(unsigned int block);_free_blocks:: mov r2, dpl mov r3, dph mov dptr, #driver_entry + 118 ljmp bank1_call ; unsigned int next_block(unsigned int block);_next_block:: mov r2, dpl mov r3, dph mov dptr, #driver_entry + 121 ljmp bank1_call ; char play_block(unsigned int block, unsigned int nbytes);_play_block:: mov r2, dpl mov r3, dph mov dptr, #_play_block_PARM_2 movx a, @dptr mov r4, a inc dptr movx a, @dptr mov r5, a mov dptr, #driver_entry + 124 ljmp bank1_call ; void play_resume(void);_play_resume:: mov dptr, #driver_entry + 127 ljmp bank1_call ; void play_suspend(void);_play_suspend:: mov dptr, #driver_entry + 130 ljmp bank1_call ; void play_abort(void);_play_abort:: mov dptr, #driver_entry + 133 ljmp bank1_call ; unsigned char play_queue_avail(void);_play_queue_avail:: mov dptr, #driver_entry + 136 ljmp bank1_call ; char is_play_queue_empty(void);_is_play_queue_empty:: mov dptr, #driver_entry + 139 ljmp bank1_call ; void play_dma_irq_enable(void);_play_dma_irq_enable:: mov dptr, #driver_entry + 208 ljmp bank1_call ; char sta013_init(void);_sta013_init:: mov dptr, #driver_entry + 67 ljmp bank1_call ; char sta013_read(unsigned char addr, xdata unsigned char *value);_sta013_read:: mov r4, dpl mov dptr, #driver_entry + 76 lcall bank1_call push acc mov dptr, #_sta013_read_PARM_2 movx a, @dptr mov r2, a inc dptr movx a, @dptr mov dph, a mov dpl, r2 mov a, r3 movx @dptr, a pop dpl ret ; char sta013_write(unsigned char addr, xdata unsigned char *value);_sta013_write:: mov r4, dpl mov dptr, #_sta013_write_PARM_2 movx a, @dptr mov r3, a inc dptr movx a, @dptr mov dph, a mov dpl, r3 movx a, @dptr mov r3, a mov dptr, #driver_entry + 79 ljmp bank1_call ; unsigned long sta013_read_header(void);_sta013_read_header:: mov dptr, #driver_entry + 226 ljmp bank1_call ; void sta013_set_attenuation(unsigned char, unsigned char);_sta013_set_attenuation:: mov r2, dpl mov dptr, #_sta013_set_attenuation_PARM_2 movx a, @dptr mov r3, a mov dptr, #driver_entry + 145 ljmp bank1_call ; char test_sta013(void);_test_sta013:: mov dptr, #driver_entry + 148 ljmp bank1_call ; char detect_filesystem(void);_detect_filesystem:: mov dptr, #driver_entry + 151 ljmp bank1_call ; unsigned long get_root_1st_cluster(void);_get_root_1st_cluster:: mov dptr, #driver_entry + 211 ljmp bank1_call ; char file_open_by_1st_cluster(unsigned long first_cluster);_file_open_by_1st_cluster:: mov r2, dpl mov r3, dph mov r4, b mov r5, a mov dptr, #driver_entry + 154 ljmp bank1_call ; void file_cache(char fd, unsigned long offset, unsigned long length);_file_cache:: mov b, dpl mov dptr, #_file_cache_PARM_2 movx a, @dptr mov r0, a inc dptr movx a, @dptr mov r1, a inc dptr movx a, @dptr mov r2, a inc dptr movx a, @dptr mov r3, a mov dptr, #_file_cache_PARM_3 movx a, @dptr mov r4, a inc dptr movx a, @dptr mov r5, a inc dptr movx a, @dptr mov r6, a inc dptr movx a, @dptr mov r7, a mov dptr, #driver_entry + 157 ljmp bank1_call ; char file_cache_work(char fd);_file_cache_work:: mov r4, dpl mov dptr, #driver_entry + 160 ljmp bank1_call ; char file_seek(char fd, long offset);_file_seek:: mov r6, dpl mov dptr, #_file_seek_PARM_2 movx a, @dptr mov r2, a inc dptr movx a, @dptr mov r3, a inc dptr movx a, @dptr mov r4, a inc dptr movx a, @dptr mov r5, a mov dptr, #driver_entry + 163 ljmp bank1_call ; unsigned long file_tell(char fd);_file_tell:: mov r4, dpl mov dptr, #driver_entry + 190 ljmp bank1_call G$file_read$0$0=. ; unsigned char file_read(char fd, xdata void *buf, unsigned char count)_file_read:: mov r4, dpl mov dptr, #_file_read_PARM_2 movx a, @dptr mov r6, a inc dptr movx a, @dptr mov r7, a mov dptr, #_file_read_PARM_3 movx a, @dptr mov r1, a mov dptr, #driver_entry + 166 ljmp bank1_call ; unsigned int file_read_block(char fd);_file_read_block:: mov r4, dpl mov dptr, #driver_entry + 169 ljmp bank1_call ; void file_close(char fd);_file_close:: mov r4, dpl mov dptr, #driver_entry + 172 ljmp bank1_call ; void file_uncache(char fd, unsigned long offset, unsigned long length)_file_uncache:: mov b, dpl mov dptr, #_file_uncache_PARM_2 movx a, @dptr mov r0, a inc dptr movx a, @dptr mov r1, a inc dptr movx a, @dptr mov r2, a inc dptr movx a, @dptr mov r3, a mov dptr, #_file_uncache_PARM_3 movx a, @dptr mov r4, a inc dptr movx a, @dptr mov r5, a inc dptr movx a, @dptr mov r6, a inc dptr movx a, @dptr mov r7, a mov dptr, #driver_entry + 193 ljmp bank1_call ; void free_fat_memory(void);_free_fat_memory:: mov dptr, #driver_entry + 175 ljmp bank1_call ; char dir_read_fast(char fd, xdata void *info);_dir_read_fast:: mov r4, dpl mov dptr, #_dir_read_fast_PARM_2 movx a, @dptr mov r6, a inc dptr movx a, @dptr mov r7, a mov dptr, #driver_entry + 229 ljmp bank1_call ;char dir_read_fast_name(xdata char * buf);_dir_read_fast_name:: mov r4, dpl mov r5, dph mov dptr, #driver_entry + 232 ljmp bank1_call ; void update_events(void);_update_events:: mov dptr, #driver_entry + 181 ljmp bank1_call ; unsigned char get_next_event(void);_get_next_event:: mov dptr, #driver_entry + 184 ljmp bank1_call ; void put_back_event(unsigned char event);_put_back_event:: mov r4, dpl mov dptr, #driver_entry + 187 ljmp bank1_call ; void add_new_event(unsigned char event);_add_new_event:: mov a, dpl clr ea lcall 0x2040 setb ea ret ; char write_flash_param(unsigned char parm_id, idata void *data);_write_flash_param:: mov r2, dpl mov dptr, #_write_flash_param_PARM_2 movx a, @dptr mov r0, a mov dptr, #driver_entry + 196 ljmp bank1_call mov dpl, #1 ret ; unsigned char read_param_1byte(unsigned char parm_id, ; unsigned char default_value);_read_param_1byte:: mov r2, dpl mov dptr, #_read_param_1byte_PARM_2 movx a, @dptr mov r0, a mov dptr, #driver_entry + 199 ljmp bank1_call ; char xilinx_download(void);_xilinx_download:: mov dptr, #driver_entry + 73 ljmp bank1_call ; void power_shutdown(void);_power_shutdown:: mov dptr, #driver_entry + 70 ljmp bank1_call ;void run_old_firmware(void)_run_old_firmware:: ljmp 0xF040 ; void drivers_init(void);_drivers_init:: mov dptr, #driver_entry + 205 ljmp bank1_call ; void set_timer(unsigned char timer, unsigned int value);_set_timer:: mov r4, dpl mov dptr, #_set_timer_PARM_2 movx a, @dptr mov r2, a inc dptr movx a, @dptr mov r3, a mov dptr, #driver_entry + 214 ljmp bank1_call ; unsigned int read_timer(unsigned char timer);_read_timer:: mov r4, dpl mov dptr, #driver_entry + 217 ljmp bank1_call ; void clear_timer(unsigned char timer);_clear_timer:: mov r4, dpl mov dptr, #driver_entry + 220 ljmp bank1_call ; unsigned long clock_tick(void);_clock_tick:: mov dptr, #driver_entry + 223 ljmp bank1_call ; void flush(void);_flush:: ljmp 0x2042 ; char file_mem_map(char fd, char block_addr);_file_mem_map:: mov r4, dpl mov dptr, #_file_mem_map_PARM_2 movx a, @dptr mov r6, a mov dptr, #driver_entry + 235 ljmp bank1_call ; void fill_null_mp3(xdata void *addr, unsigned char num_frames);_fill_null_mp3:: mov r2, dpl mov r3, dph mov dptr, #_fill_null_mp3_PARM_2 movx a, @dptr mov r1, a mov dptr, #driver_entry + 202 ljmp bank1_call
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -