Post Mon Jun 10, 2013 2:22 pm

sub and function, asm and ix

when advancing a bit more on the MSX part of Boriel's ZX-Basic Compiler, and after that help from accessing paged memory on ZX-Spectrum 128k, i got this situation:

the library i used on the MSX "version"
  Code:
sub msxvpoke(tad as uinteger,tva as uinteger)
  asm
    ld h,(ix+5)
    ld l,(ix+4)
    ld a,(ix+6)
    call $004D
    end asm
  end sub


there i'm seeing that sub is using 'ix' from the arguments, but i don't know how are they arranged (as ubyte, uinteger, etc.), and why or what for we use fastcall, get ix instead of bc,de,hl,af - and from a function, in which register or index the value is returned (af, just like from fastcall?)

i can't find documentation explaining it better on the wiki: http://www.boriel.com/wiki/en/index.php ... C:FUNCTION and http://www.boriel.com/wiki/en/index.php/ZX_BASIC:SUB

thanks and cheers! :)