***************************************************************** * exp4c55_7.asm - An assembly program for C55x CCS simulator * Special case of multiplication in Section 4.6.7 * ***************************************************************** * Section allocation * .def x,yh,y,init x .usect "vars",2 ; reserve 2 locations for x y .usect "vars",1 ; reserve 1 location for y yh .usect "vars",1 ; reserve 1 location for yh .sect "table" init .int -32768,-32768 .text ; create code section .def start ; label of the beginning of code start BCLR C54CM ; set C55x native mode BSET SXMD BSET SATD BSET FRCT copy AMOV #x,XAR1 ; XAR1 pointing to x0 AMOV #init,XAR2 ; XAR2 pointing to table of data RPT #1 ; repeat next instruction 2 times MOV *AR2+,*AR1+ ; copy 2 data to x mult AMOV #x,XAR1 AMOV #(x+1),XAR2 MOV *AR1<<#16,AC0 MPYM *AR2,AC0 * Write the result to memory location y write: MOV AC0,*(#y) ; y <- AL MOV HI(AC0),*(#yh) ; yh <- AH end NOP B end ; stop here