Mail Archives: djgpp/1999/06/29/07:05:47
SP points to topmost stack value. You do:
push BP
mov BP, SP
which sets [BP]=(old BP), [BP+4]=(return address), [BP+8]=first
argument.
Therefore you need to use [BP+8] instead of [BP+4].
Davin.
On Tue, 29 Jun 1999 14:05:57 +1200, "David Mitchell"
<dmitchell AT inet DOT net DOT nz> wrote:
>Umm, I have written the following for NASM:
>
>[SECTION .text]
>
>GLOBAL _setmode ; setmode(int mode)
>
>_setmode:
> push bp
> mov bp, sp
>
> push ax
> push dx
>
> mov ax, [bp+4]
> int 10h
>
> pop dx
> pop ax
>
> pop bp
>
> ret
>
[snip]
>
>when I run a.exe, nothing happens. But it should change to screen 13h.
>What is happening, can somebody please help!
>
>David
__________________________________________________________
*** davmac - sharkin'!! davmac AT iname DOT com ***
my programming page: http://yoyo.cc.monash.edu.au/~davmac/
- Raw text -