All pastes #199977 Raw Edit

Untitled

public text v1 · immutable
#199977 ·published 2006-10-12 21:21 UTC
rendered paste body
Im trying to get my head around why old bp is pushed and bp sp are altered after function calls does this code look okay?

push bp 
	call showstack ;
        |bp|<--bp sp
        pop bp;     |empty|
        mov sp, bp ;should this not be mov bp,sp or is old bp when popped put int the current bp? reg
 	
      


showstack:
         
	push 57h ;|bp|nla|57h
        mov bp,sp ;|bp|nla|57h <-----bp and sp after this mov
        mov al, [bp]  ;  
    	mov ah, 0x0E	; video function 0Eh (print char)
	mov bx, 0x0007	; color
	int 0x10
	
  	retn