I am currently writing functions using an educational assembly language called Y86, AT&T syntax and am trying to accomplish/get around something this doesn't support. I want to add a number to a value stored in memory and for some stupid reason you can only use addl to add to a register. I don't know why this is.
Inside a function I want to do something such as this and don't know how:
addl $1, -4(ebp)
Also, I seem to have a problem of running out of registers. Maybe it's because I don't know how to make room for storing local variables. I have heard thought there is a concept where registers are saved by the caller and callee. I would greatly appreciate any commands that are equal to what's above but in Y86. Also any tips on saving registers would be great! THANK YOU! I know looking over this stuff is a real pain.