A89: Re: Re: ROM calls in Nostub ASM program


[Prev][Next][Index][Thread]

A89: Re: Re: ROM calls in Nostub ASM program




Hi!

> Look in the anothermario source code.  It has it in there.
> 
> Or, I'll just paste you the code here:
> 
>  move.l $c8,a0
>  move.l X*4(a0),a0
>  jsr (a0)
> 
> X is the ROM call number in the doorsos.h/tios.h document BUT, you MUST
> convert it to decimal while using this method. (This is from am.zip
> (another mario source)).  That is the only way I know of that will work.

I am not so familiar with A68k assembler syntax (I used GNU Assembler),
but I expect that the following will also work:

move.l $c8,a0
move.l DrawStr*4(a0),a0
jsr (a0)

And, as far as I know, there is a macro (ROM_CALL or something similar)
somewhere in ASM header files which does the same thing after the
expansion, so you can use

ROM_CALL DrawStr

> A good friend of mine told me I could do
> 
>  jsr _ROM_CALL_XXX
> 
> in _nostub programs when I was endeavoring into _nostub programs but, I
> could never get it to compile.

No. You definitely can't do this. _ROM_CALL_XXX are only special symbols
which are recognized by the DoorsOS linker. They are completely
meaningless in kernel-less programs.

Zeljko Juric



Follow-Ups: