Оформлять код НУЖНО тегом - переключателем "asm" или "c":
;******************************************************************************
;* XMEGA ADC driver assembly source file.
;* Application note:
;* AVR1300: Using the XMEGA ADC
;******************************************************************************
; This routine reads the calibration byte given by the index in R16.
; Input: R16 - Byte index.
; Returns: R16 - Calibration byte.
#include <ioavr.h>
MODULE _SP_ReadCalibrationByte
PUBLIC SP_ReadCalibrationByte
RSEG CODE
SP_ReadCalibrationByte:
ldi r20, NVM_CMD_READ_CALIB_ROW_gc ; Prepare NVM command in R20.
mov ZL, r16 ; Load byte index into low byte of Z.
clr ZH ; Clear high byte of Z.
sts NVM_CMD, r20 ; Load prepared command into NVM Command register.
lpm r16, Z ; Preform a LPM to read out byte to R16
ldi r20, NVM_CMD_NO_OPERATION_gc ; Clear NVM Command register
sts NVM_CMD, r20
ret
ENDMOD
END
; END OF FILE