试图将一个阵列从高射线到变数,将其送往高射线,一只狗知道在什么地方存在问题,以及该阵列在变数中获救,但无法在终端接收任何数据,很可能没有东西。
.DSEG
.ORG 0X0100
STRNG: .BYTE 128 ;Strings recommended to be even
.CSEG
STRNG2: .DB "Printing aithing from probably the buffer",0X00 ;Strings recommended to be even
RJMP MAIN
MAIN: SBI DDRD,PD1
LDI R16,0X00
LDI R17,0XCF
STS UBRR0L,R17 ;UBRRXL - Usart Baud Rate 0 Register Low| Low byte of Baud Rate
STS UBRR0H,R16 ;UBRRXH - Usart Baud Rate 0 Register High| High 4bits of Baud Rate
LDI R18,0X22
STS UCSR0A,R18 ;UCSRXA - Usart Control and Status Register X A| flags, status and config: (flag after receive)(flag after transmit)(flag buffer data register empty[1 defaul])(flag frame error)(flag buffer overrun)(flag parity error)(U2XX state)(multiprocessor communication state) | set flags acording documentation (all in 0 except UDRE0)
LDI R19,0X06
STS UCSR0C,R19 ;UCSRXC - Usart Control and Status Register X C| flags, status and config: (Usart modes)(parity mode)(stop bits mode)(character size)(clock polarity[for USART])
LDI R20,0X18
STS UCSR0B,R20 ;UCSRXB - Usart Control and Status Register X B| config: (after receive interrupt)(after transmit interrupt)(buffer data register empty interrupt)(rx enable)(tx enable)(character size)(receive data bit 8[for 9bit])(transmit data bit 8[for 9bit])
LOOP: RJMP RX
RCALL WAITT
RJMP LOOP
RX: LDS R21,UCSR0A
SBRS R21,UDRE0
RJMP RX
LDI XL,LOW(STRNG) ;Z POINTER
LDI XH,HIGH(STRNG)
LDS R22,UDR0
CPI R22,0X0D
BREQ TX
LDI XL,LOW(STRNG) ;Z POINTER
LDI XH,HIGH(STRNG)
ST X+,R22
RJMP RX
TX: LDI XL,LOW(STRNG) ;Z POINTER
LDI XH,HIGH(STRNG)
LD R23,X+
CPI R23,0X00
BREQ END
SEND: LDS R21,UCSR0A
SBRS R21,UDRE0
RJMP SEND
STS UDR0,R23
RJMP TX
END: RET
WAITT: LDI R24, 82
LDI R25, 43
L1: DEC r25
BRNE L1
DEC r24
BRNE L1
RET
我无法理解问题何在。