Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sub and function, asm and ix
#1
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: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:FUNCTION">http://www.boriel.com/wiki/en/index.php ... C:FUNCTION</a><!-- m --> and <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:SUB">http://www.boriel.com/wiki/en/index.php/ZX_BASIC:SUB</a><!-- m -->

thanks and cheers! Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)