************************************************************** * exp4c54_7.asm - An assembly program for C5000 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: NOP copy: STM #x, AR1 RPT #1 MVPD init, *AR1+ mult: .mmregs SSBX FRCT SSBX SXM ; turn-on sign extension SSBX OVM ; turn-on Overflow mode ;RSBX OVM ; turn-off Overflow mode (allow overflow) STM #x, AR1 STM #(x+1),AR2 LD *AR1, T MPY *AR2,A * Write the result to memory location y write: STL A,*(y) ; y <- AL STH A,*(yh) ; yh <- AH end NOP B end ; stop here