Date: Wed, 05 Feb 1997 15:44:12 -0800 To: Richard Hughey From: Duane Strong Subject: Re: assembling HC11 code X-Attachments: C:\UCSC\cmpe121\c\DS\example.s; C:\UCSC\cmpe121\c\DS\Vector.s; C:\UCSC\cmpe121\c\DS\a.bat; --=====================_855215052==_ Content-Type: text/plain; charset="us-ascii" At 11:14 AM 2/5/97 -0800, you wrote: >Posting it (or emailing it to me to add to the www page) would be >great!! Adding to the web page would be best since people would have to cut the code out of a posting. So here they are (attached). The vector table Vector.s has to be re-assembled anytime it is changed (it only has a reset vector right now) using: X6811 vector.s Otherwise a person would just say: a myfile to assemble link and create a hex file from myfile.s --=====================_855215052==_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: attachment; filename="example.s" ;an example assemble program .public __stext, __return ;defined in vector.s .psect _text ;this is where your code starts on reset __stext: ;here is some code ldaa #7Fh staa 4000h jmp __stext ;this is a stub routine for all unused vectors in vector.s __return: rts .end --=====================_855215052==_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: attachment; filename="Vector.s" ; ; this is a default interrupt vector table for the M68HC11. You should ; modify this as necessary for your application. Make sure that the ; label for your ISR is prepended by an underscore (_) if the ISR is ; written in C. Also make sure that you have included the label in a ; .external statement (see below). ; .external __return,__stext ; ; __return and __stext are both defined in the C runtime startup file ; .psect _text .word __return ; SCI .word __return ; SPI .word __return ; PA input .word __return ; PA overflow .word __return ; timer overflow .word __return ; TOC5 .word __return ; TOC4 .word __return ; TOC3 .word __return ; TOC2 .word __return ; TOC1 .word __return ; TIC3 .word __return ; TIC2 .word __return ; TIC1 .word __return ; RTI .word __return ; IRQ .word __return ; XIRQ .word __return ; SWI .word __return ; Illegal opcode .word __return ; COP fail .word __return ; COP clock fail .word __stext ; RESET .end --=====================_855215052==_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: attachment; filename="a.bat" echo off rem - batch file for assembling/linking/hexing hc11 code rem - change these to match your system set ROM=0x8000 set RAM=0x2000 rem - check that the file name was supplied without extension if exist %1 goto NOEXT rem - assemble the file %1.s -> %1.o x6811 -l %1.s if errorlevel 1 goto ERRORS rem - link it (and vector table too) -> %1.h11 lnkh11 +h -o %1.h11 +text -b %ROM% +data -b %RAM% %1.o +text -b 0xFFD6 vector.o if errorlevel 1 goto ERRORS rem - generate Motorola S-record hex format file for PROM burner -> %1.hex hexh11 -s -o %1.hex %1.h11 if errorlevel 1 goto ERRORS goto END :NOEXT echo Do not include the .s file extension please goto END :ERRORS echo There were errors. Insert another quarter to continue... goto end :END set ROM= set RAM= --=====================_855215052==_--