I was told to put valid registers into stack not to overwrite them later in "subprogram" and it's clear to me, everyone knows it. But when I read the code of my mates I found the following code:
puts: ; display character in ax
push ax
push bx
push cx
push dx
mov dx, ax
mov ah, 9h
int 21h
pop dx
pop cx
pop bx
pop ax
ret
Then I saw pusha
and popa
commands. I suppose it could be done this way:
puts: ; display character in ax
pusha
mov dx, ax
mov ah, 9h
int 21h
popa
ret
Is there any difference between the pusha
and set of push
es?
Thank you in advance.