mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 09:41:35 +08:00
Progress toward natvie z80 SDCC build -- still issues
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5413 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -76,6 +76,7 @@
|
||||
|
||||
void z80_lowputc(char ch) __naked
|
||||
{
|
||||
#ifdef CONFIG_SDCC_OLD
|
||||
_asm
|
||||
ld hl, #2
|
||||
add hl, sp
|
||||
@@ -83,6 +84,15 @@ void z80_lowputc(char ch) __naked
|
||||
out (0xbe), a
|
||||
ret
|
||||
_endasm;
|
||||
#else
|
||||
__asm__ (
|
||||
"\tld hl, #2\n"
|
||||
"\tadd hl, sp\n"
|
||||
"\tld a, (hl)\n"
|
||||
"\tout (0xbe), a\n"
|
||||
"\tret\n"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
/********************************************************************************
|
||||
@@ -94,10 +104,19 @@ void z80_lowputc(char ch) __naked
|
||||
|
||||
char z80_lowgetc(void) __naked
|
||||
{
|
||||
#ifdef CONFIG_SDCC_OLD
|
||||
_asm
|
||||
in a, (0xbe)
|
||||
ld l, a
|
||||
ld h, #0
|
||||
ret
|
||||
_endasm;
|
||||
#else
|
||||
__asm__ (
|
||||
"\tin a, (0xbe)\n"
|
||||
"\tld l, a\n"
|
||||
"\tld h, #0\n"
|
||||
"\tret\n"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user