diff --git a/configs/pjrc-8051/Make.defs b/configs/pjrc-8051/Make.defs index 8dd552990f..8034555222 100644 --- a/configs/pjrc-8051/Make.defs +++ b/configs/pjrc-8051/Make.defs @@ -53,6 +53,7 @@ CC = sdcc CPP = sdcpp LD = aslink AS = asx8051 +#AR = sdar -r AR = sdcclib -a CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ diff --git a/configs/xtrs/nsh/Make.defs b/configs/xtrs/nsh/Make.defs index 749b693154..db67b931cb 100644 --- a/configs/xtrs/nsh/Make.defs +++ b/configs/xtrs/nsh/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/configs/xtrs/ostest/Make.defs b/configs/xtrs/ostest/Make.defs index 550c70d3c8..3555017377 100644 --- a/configs/xtrs/ostest/Make.defs +++ b/configs/xtrs/ostest/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/configs/xtrs/pashello/Make.defs b/configs/xtrs/pashello/Make.defs index 409e303c10..641b9426d6 100644 --- a/configs/xtrs/pashello/Make.defs +++ b/configs/xtrs/pashello/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/configs/z80sim/nsh/Make.defs b/configs/z80sim/nsh/Make.defs index a5b325e79d..1edd5fdcf8 100644 --- a/configs/z80sim/nsh/Make.defs +++ b/configs/z80sim/nsh/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/configs/z80sim/ostest/Make.defs b/configs/z80sim/ostest/Make.defs index 54b6d8c45d..91d30a061b 100644 --- a/configs/z80sim/ostest/Make.defs +++ b/configs/z80sim/ostest/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/configs/z80sim/pashello/Make.defs b/configs/z80sim/pashello/Make.defs index 076aad7ed7..2dca56a0eb 100644 --- a/configs/z80sim/pashello/Make.defs +++ b/configs/z80sim/pashello/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/configs/z80sim/src/z80_lowputc.c b/configs/z80sim/src/z80_lowputc.c index e23caeb0f3..9b46b48801 100644 --- a/configs/z80sim/src/z80_lowputc.c +++ b/configs/z80sim/src/z80_lowputc.c @@ -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 }