; Originally taken from came from Motorola's Dr. BuB DSP board. ; Obtained from Todd Day's FTP archive as sloader.asm ; Modified for TDSG56 project by Quinn Jensen (jensenq@npd.novell.com) ; ; Text from original: ; Serial Loader for the DSP56000. ; This loader initializes the serial communications interface (SCI) ; on the DSP56001 for 9600 baud and then loads OMF records (output ; by the DSP56000 assembler) into internal memory. The loader takes ; the upper 128 bytes of P memory allowing the lower memory from ; $0000-(LDRMEM-1) to be used by the user. The following records are ; interpreted: ; _DATA X ADDR ; _DATA Y ADDR ; _DATA P ADDR ; _END ADDR ; After the END record is encountered, the loader jumps to the address ; in the END record. Note that an address MUST be present in the ; END record (the program must contain at least one P segment). ; ; To generate a EPROM of this loader (8Kx8), perform the following: ; $ asm56000 -b -l -a sloader ; $ srec sloader ; ; The EPROM is in file SLOADER.P. To program the EPROM, set the ; programmer to MOTOROLA S record format, download the file with ; a zero address offset and program the part. ; ; BTW, S record format is LSB MidSB MSB (what! Intel format? :-) ; Took me a few hours to figure this one out! [Not really. S records ; are big-endian, its just the 56001 boot loader that wants LSB first. ; -QJ] ; ; If you don't have the program srec (where can I get this?), ; you have to do some gnarly contortions on the .LOD file. ; ; So, if your .LOD file resulting from compiling this program ; looks like this: ; ; _START SLOADER 0000 0000 ; ; _DATA P 0020 ; 010203 040506 070809 ; _END 0020 ; ; then, program your PROM with this sequence: ; $0020 0302 0106 0504 0908 07..... etc. (Fun, eh? :) ; ; ; The loader loads the following memory spaces: ; X - 0 to FF ; Y - 0 to FF ; P - 0 to LDRMEM-1 ; PAGE 68,66,1,1 SCR EQU $FFF0 ;SCI CONTROL REGISTER SCCR EQU $FFF2 ;SCI CLOCK CONTROL REGISTER PCC EQU $FFE1 ;PORT C CONTROL REGISTER RDRF EQU $2 ;RECEIVE DATA REGISTER FULL FLAG SSR EQU $FFF1 ;SCI STATUS REGISTER SRXH EQU $FFF6 ;SCI RECEIVE IN HIGH BYTE PBC equ $FFE0 ;port B control PBDDR equ $FFE2 ;port B data direction PBD equ $FFE4 ;port B data BCR equ $FFFE ;port a bus control reg #ifdef ROM LDRMEM EQU $198 ;START OF LOADER IN P MEMORY #else #ifdef HIGH LDRMEM EQU $F000 ;START OF LOADER IN P MEMORY #else LDRMEM EQU $80 ;START OF LOADER IN P MEMORY #endif #endif ORG P:$0000 ;RESET VECTOR FOR BOOTING RVEC JMP 4,X0 ;CLEAR VALUE, GET 4 JMP 6,X0 ;CLEAR VALUE, GET 6 READHEX DO X0,_READHEX ;READ ASCII HEX AND CONVERT TO BINARY _GET JSR