.mmregs
.def start
K_IF80 .set 1
.bss x,1
.bss y,1
.bss SINSTP,1
.bss SIN25P,1
.data
sinx .usect "sinx",1000
cosx .usect "cosx",1000
fsin .usect "fsin",1000
fcos .usect "fcos",1000
qpsk .usect "qpsk",3000
STACK .usect "STACK",10
table .word -8*32768/10000---------------设初值
.word -32*32768/10000
.word -75*32768/10000
.word -114*32768/10000
.word -76*32768/10000
.word 126*32768/10000
.word 532*32768/10000
.word 1081*32768/10000
.word 1617*32768/10000
.word 1949*32768/10000
.word 1949*32768/10000
.word 1617*32768/10000
.word 1081*32768/10000
.word 532*32768/10000
.word 126*32768/10000
.word -76*32768/10000
.word -114*32768/10000
.word -75*32768/10000
.word -32*32768/10000
.word -8*32768/10000
SINTAB: .word 07FFFH,07FD8H,07F61H,07E9CH,07D89H,07C29H,07A7CH,07884H-----正弦映射表
.word 07641H,073B5H,070E2H,06DC9H,06A6DH,066CFH,062F1H,05ED7H
.word 05A82H,055F5H,05133H,04C3FH,0471CH,041CEH,03C56H,036BAH
.word 030FBH,02B1FH,02528H,01F1AH,018F9H,012C8H,00C8CH,00648H
.word 00000H,0F9B8H,0F374H,0ED38H,0E707H,0E0E6H,0DAD8H,0D4E1H
.word 0CF05H,0C946H,0C3AAH,0BE32H,0B8E4H,0B3C1H,0AECDH,0AA0BH
.word 0A57EH,0A129H,09D0FH,09931H,09593H,09237H,08F1EH,08C4BH
.word 089BFH,0877CH,08584H,083D7H,08277H,08164H,0809FH,08028H
.word 08001H,08028H,0809FH,08164H,08277H,083D7H,08584H,0877CH
.word 089BFH,08C4BH,08F1EH,09237H,09593H,09931H,09D0FH,0A129H
.word 0A57EH,0AA0BH,0AECDH,0B3C1H,0B8E4H,0BE32H,0C3AAH,0C946H
.word 0CF05H,0D4E1H,0DAD8H,0E0E6H,0E707H,0ED38H,0F374H,0F9B8H
.word 00000h,00648H,00C8CH,012C8H,018F9H,01F1AH,02528H,02B1FH
.word 030FBH,036BAH,03C56H,041CEH,0471CH,04C3FH,05133H,055F5H
.word 05A82H,05ED7H,062F1H,066CFH,06A6DH,06DC9H,070E2H,073B5H
.word 07641H,07884H,07A7CH,07C29H,07D89H,07E9CH,07F61H,07FD8H
.word 07FFFH
.text
start: SSBX FRCT
STM #STACK+10,SP
STM #sinx,AR1
STM #cosx,AR3
STM #fsin,AR4
STM #fcos,AR2
STM #qpsk,AR0
ST #0,@SIN25P
CALL SIN25K
STM #x,AR5
STM #y,AR7
ST #0xe4e4,*AR7
LD *AR7,B
STL B,*AR5-----值放在*AR5和B的低16位
ST #0,@SIN25P
STM #7,AR6
QPSKSTART: LD *AR5,B
AND #11,B
SFTL B,5
LD *AR5,A
ROR A
ROR A
STL A,*AR5
LD SIN25P,A
ADD B,A
ADD #SINTAB,A
STM #255,BRC
RPTB QPSKEND
SUB #SINTAB,A
ADD SINSTP,A
AND #07FH,A
ADD #SINTAB,A
QPSKEND: READA *AR0+
BANZ QPSKSTART,*AR6-
here: B here
SIN25K: STM #500, BRC
RPTB SINRET-1
ST #K_IF80,SINSTP
LD SIN25P,A
ADD SINSTP,A
AND #07FH,A
STL A,SIN25P
ADD #SINTAB,A
READA *AR1+
LD SIN25P,A
ADD #32,A
AND #07FH,A
ADD #SINTAB,A
READA *AR3+
LD SIN25P,A
ADD #64,A
AND #07FH,A
ADD #SINTAB,A
READA *AR4+
LD SIN25P,A
ADD #96,A
AND #07FH,A
ADD #SINTAB,A
READA *AR2+
SINRET RET
.end···················很捉急 |