OB does not do even minimal optimisation. So I wonder how to use the assembler? Fragment below does not work.
Btw, Oxide has severe issues:
It may "eat" characters: it may do stuff like open the "save" dialogue, start code etc, when coding and typing i.e. "s" or "e".
Do you really use it for coding?
function fillr(bm as integer ptr, x as dword,y as dword,w as dword,h as dword,col as dword)
int* bits
int pitch
/*
@bits=@bm
pitch=(SCANLEN-w)*4
@bits+=(y*SCANLEN+x)*4
for i=0 to <h
for j=0 to <w
bits=col
@bits+=4
next
@bits+=pitch
next
*/
mov eax,bm ; @bits=@bm
mov bits,eax
mov ecx,1280 ; pitch=(SCANLEN-w)*4
sub ecx,w
shl ecx,2
mov pitch,ecx
mov eax,1280 ; @bits+=(y*SCANLEN+x)*4
mul y
add eax,x
shl eax,2
add bits,eax
mov eax,col
mov edx,bits
._for1 ; for i=0 to <h
dec h
jz _exitfor1
mov ecx,w
._for2 ; for j=0 to <w
dec ecx
jz _exitfor2
mov [edx],eax ; bits=col
add edx,4 ; @bits+=4
jmp _for2
._exitfor2
add edx,pitch ; @bits+=pitch
jmp _for1
._exitfor1
._leave
xor eax,eax
end function