I need to call from a C program, this ASM instruction
Code: Select all
in a,(0x88)
Thanks in advance
Code: Select all
in a,(0x88)
Code: Select all
__sfr __at (0x88) PORT;
void func() {
int l = PORT;
}
So for SMC, you could do something like this:
Code: Select all
int readport(int port) __z88dk_fastcall
{
#asm
ld a,l
ld (portsmc+1),a
portsmc:
in a,(port)
ld l,a
ld h,0
#endasm
}
Code: Select all
{
set_port(0x88);
...
...
int value = read_port()
}
Code: Select all
void set_port(int port) __z88dk_fastcall {
#asm
ld a,l
ld (portsmc+1),a
#endasm
}
int read_port() __z88dk_fastcall {
#asm
portsmc:
in a,(0x00)
ld l,a
ld h,0
#endasm
}