Yuri Petriaev

assembly statements do not compile

Discussion created by Yuri Petriaev on Mar 16, 2007
Latest reply on Mar 19, 2007 by Yuri Petriaev
Following assembly statements were compiled with DIAB compiler. Does anyone knows eqivalent instructions in CW for ColdFire compiler.
 
/* save all of the registers we are going to modify */
__asm push es ;/* ES will contain a modified data segment */
__asm push di;/* DI is the offset of the data to sum */
__asm push dx;/* DX is the sum */
__asm push cx;/*CX is first used for temporary storage, and then to hold the loop control variable */
__asm les di, link16BitDataPtr;/* Load the pointer into ES:di */
 __asm mov cx, di;/* Save the offset portion of the pointer before we modify it */
__asm shr di, 4;/* Shift the offset right by 4 */
__asm push es;/* Copy the segment (es) into dx */
__asm pop dx;
__asm add dx, di;/* Add in the shifted offset */
__asm push dx;/* Copy the updated segment back into es */
__asm pop es;
__asm mov di, cx;/* Load the old offset, and mask off everything except the last 4 bits */
__asm and di, 000fh;
 
I am using CodeWarrior Development Studio for ColdFire Architectures Version 6.3, Build 14.

Outcomes