Zur Übersicht - Zurück zur Homepage
Re: call Kategorie: Progr. Assembler, TaskingTools, OS (von mafoe"s ghost  - 26.7.2001 21:44)
Kategorie Progr. Assembler, TaskingTools, OS
note:
- your C/assembly code must be linked to 0003:0000
- do not declare any variables in on-chip RAM
- do not link any startup asm-file of Tasking to your project
- your program must not have an own C-stack (ignore the linker warning)
- just use the registers, but not R0!

this example should run:

#define REG164CI_NOOTP
#define REG164CI_NOPEC
#define REG164CI_NOCAN /* ! */
#include "reg164ci.h"

void led_on ( void );
void led_off ( void );

//--------------------
void led_on ( void )
//--------------------
{
P1L = 1;
}


Inside the VM, something like this happens (I"m not really sure anymore, and maybe the
comments below are not correct):


//--------------------------
void vmop_syscall ( void )
//--------------------------
{
WORD segment, offset;

offset = (WORD) vmstack_pop_int();
segment = (WORD) vmstack_pop_int();

system_syscall((BYTE)segment,offset);
}


//------------------------------------------
void system_syscall ( BYTE seg, WORD off )
//------------------------------------------
{
// calling a system routine at seg:off, which must return by RETS;
// the register context is safed an restored,
// R0 is used as CUSTACK pointer,

sysjmp_struct.seg = seg;
sysjmp_struct.off = off;

#pragma asm

RBANK1REGDEF R0-R15
PUSH CP
MOV RBANK1, R0
MOV CP, #RBANK1
CALLS SEG _sysjmp_struct, _sysjmp_struct
POP CP

#pragma endasm

/*
oldversion without own register bank:

#pragma asm
CALLS SEG _sysjmp_struct, _sysjmp_struct
#pragma endasm
*/
}


    Antwort schreiben


Antworten:

Re: call (von Robert am 26.7.2001, 23:52)
    Re: call (von Eric am 27.7.2001, 13:01)
        Re: call (von Robert am 29.7.2001, 12:27)
            Re: call (von Mario Fischer am 10.8.2001, 15:01)
                Re: call (von André H. am 10.8.2001, 19:17)
                    Re: call (von Mario Fischer am 11.8.2001, 1:07)
                        Re: call (von Robert am 16.8.2001, 0:09)
            Wrong e-mail-address (von André H. am 29.7.2001, 12:51)
        Re: call (von Eric am 27.7.2001, 13:10)

Zum Bezugsartikel