How can I do to translate this proc to NASM?
In MASM i have:

MyProc proc near uses bx
...
...
...
...

How do I make it in NASM? In NASM i am not allowed to use proc near uses ax, so, what can I do?

Thanks in advance.
Posted on 2002-04-11 14:25:28 by CodeLover
I've never used NASM but, what about

MyProc proc near

push bx

{code that uses bx}

pop bx
Posted on 2002-04-11 15:36:59 by anon
hi yere is some examples:


;========================================
StreamInProc:
enter 0, 0

extern ReadFile
call ReadFile,,,,,0

xor eax,eax
leave
ret 16
;========================================






other one:


;====== internal function =========================
; PROC USES ESI EDI EBX _hdc:HDC, _wdt:DWORD, _hgt:DWORD
;==========================================

MakeRegion:
%define _hdc ebp+8
%define _wdt ebp+12
%define _hgt ebp+16


enter 0,0
mov dword ,FALSE
mov dword ,TRUE
mov dword ,0
xor edi,edi
xor esi,esi
extern GetPixel
call GetPixel,[_hdc],0,0
mov ,eax

.xloop

call GetPixel,[_hdc],edi,esi

cmp eax,
jz .letsgo

cmp edi,[_wdt]
jnz .foundone

.letsgo
cmp dword ,TRUE
jnz near .nextone

mov dword ,FALSE
mov eax,esi
inc eax
extern CreateRectRgn
call CreateRectRgn,ebx,esi,edi,eax
mov ,eax

cmp dword ,TRUE
jnz .nofrun
mov dword ,FALSE
push dword
pop dword
jmp .nextone

.nofrun
extern CombineRgn
call CombineRgn,,,,RGN_OR
extern DeleteObject
call DeleteObject,
jmp .nextone

.foundone
cmp dword ,FALSE
jnz .nextone
mov dword ,TRUE
mov ebx,edi

.nextone
inc edi
cmp edi,[_wdt]
jbe .xloop

xor edi,edi
inc esi
cmp esi,[_hgt]
jb .xloop

.exit

mov eax,

;uses ESI EDI EBX
pop ebx
pop edi
pop esi

leave
ret 12






;=========== MakeRegion internal function end
Posted on 2002-04-11 22:31:59 by Nguga