|Declaration of local variables in assembly code depends on your assembler and it may not support such d|
Do it in constellation conversation .data: designate variables: varA, varB, varC, varD, and Res: … … .statute deep1 proc: rate Res = (A + B) – (C + D): … …: rate (A + B) – (C + D): … …: catch the fruit in Res conjure ExitProcess, 0 deep1 objectp object deep1
|Declaration of national variables in constellation statute depends on your assembler and it may not attributable attributable attributable food such declarations at complete.
Considering values of A,B C and D are treasured in retrospect residuum and Res Variable is already professed.
Mov R1, A ;/ Move the postulates from retrospect residuum A to Register R1
Mov R2,B ;// Move the postulates from retrospect residuum B to Register R2
Mov R3, C; // Move the postulates from retrospect residuum C to Register R3
Mov R4, D; // Move the postulates from retrospect residuum D to Register R4
ADD R1, R2; //Add R1 and R2 and treasure in R1
ADD R3,R4; //Add R3 and R4 and treasure in R3
SUB R1,R3;// Subtract R3 from R1 and treasure in R1
MOV Res,R1 ; /Move R1 to Res
Ccomplete ExitProcess ; //Calls Exitprocess procedure
RET ; // Return from the deep procedure