Stack pointer in Assembly

148 Views Asked by At

I have a C exercise call a function from assembly. "Calculate perimeter of a triangle".

int a = 3, b = 4, c =5;
int Calculate_triangle(int a, int b, int c);

I have a code of Assembly here

PUSH HL
PUSH AX
MOVW AX, [HL]
ADDW AX, [HL+8]
ADDW AX, [HL+10]
POP  AX
POP  HL
RET
END

I know "a" will put in [HL]. But I have no idea why the b store in [HL+8]. Could anyone help me *I'm using RL78G14 renesas and cubesuit+ compiler

0

There are 0 best solutions below