Horje
sum 5 numbers in memory and put it to sum assembly language Code Example
sum 5 numbers in memory and put it to sum assembly language
FIND_SUM:  //the label where it starts may change syntax 
XOR DX,DX  // makes dx = 0 
XOR AH,AH  // makes AH = 0 
PUSH CX	   // save how many bytes (in your case 5 should be here) 
CLD		   // clear direction flag moves SI to the next byte each load 
FIND_SUM_LOOP1: 
LODSB	   // moves first byte into AL 
ADD DX,AX  // used DX,AX instead of DL,AL so there is no issue of overflow 
DEC CL     // decrement counter 
JNZ FIND_SUM_LOOP1 //if its no zero do the loop 
POP	CX    // reached the end, at this point DX has the total sum 
MOV AX,DX // copies the sum into ax (to do the average) 
DIV CL    // now CL has the average rounded down. 
RET		  // returns from where it was called. 
 
to use this lets suppose you have a variable name so you need to read the efective address of such variable suppose you name it stnumber5 
 
LEA SI,stnumber5 
MOV CX,5 
CALL FIND_SUM




Whatever

Related
trying to get property Code Example trying to get property Code Example
From where to enable module windows in visual studio Code Example From where to enable module windows in visual studio Code Example
speed up vlc shortcut Code Example speed up vlc shortcut Code Example
qt rest api Code Example qt rest api Code Example
how to convert 30fps to 60fps using ffmpeg Code Example how to convert 30fps to 60fps using ffmpeg Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7