Here is a sample translation of some code to implement the XMODEM file transfer protocol, written for the 65C02.
The source code was written by Daryl Rictor (All rights acknowledged), and was obtained from the following web site:
http://www.6502.org/source/io/xmodem/xmodem.txt.
Click on the links below to display the sample 65C02 assembler source and automatically-generated C in your browser: