diff --git a/ChangeLog b/ChangeLog
index 5c840fbe564f18798dc7e012f479648cd8833f58..e3788e250ab60f151d73c975a2a9731b03244b02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -338,4 +338,5 @@
 
 	* Began adding support for the ZiLOG Z8Encore! microcontroller for the Z8Encore000ZCO
 	  development board and the Z8F642 part.
+	* Fix broken 'clean' target on z80sim configurations
 
diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html
index c7a455600d12654cdcc83ec5af6702feace3c255..f18c1bf7e2d6ac0538bf08ff588542507dd05ba1 100644
--- a/Documentation/NuttX.html
+++ b/Documentation/NuttX.html
@@ -992,6 +992,7 @@ nuttx-0.3.9 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
 
 	* Began adding support for the ZiLOG Z8Encore! microcontroller for the Z8Encore000ZCO
 	  development board and the Z8F642 part.
+	* Fix broken 'clean' target on z80sim configurations
 
 pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
 
diff --git a/arch/z80/src/Makefile.sdcc b/arch/z80/src/Makefile.sdcc
index 500ed001e568d5572463956308ab6850a4aeb76f..89278d894a7559354428d8f4f3d72f323530d4ee 100644
--- a/arch/z80/src/Makefile.sdcc
+++ b/arch/z80/src/Makefile.sdcc
@@ -117,17 +117,17 @@ up_mem.h:
 	@echo "#endif /* __UP_MEM_H */" >>up_mem.h
 
 asm_mem.h:
-	@echo "	UP_COMPILER_OTHER	== 0" > asm_mem.h
-	@echo "	UP_COMPILER_SDCC	== 1" >> asm_mem.h
+	@echo "	CONFIG_COMPILER_OTHER	== 0" > asm_mem.h
+	@echo "	CONFIG_COMPILER_SDCC	== 1" >> asm_mem.h
 ifeq ($(CC),sdcc)
-	@echo "	UP_COMPILER	== 1" >> asm_mem.h
+	@echo "	CONFIG_COMPILER	== 1" >> asm_mem.h
 else
-	@echo "	UP_COMPILER	== 0" >> asm_mem.h
+	@echo "	CONFIG_COMPILER	== 0" >> asm_mem.h
 endif
-	@echo "	UP_STACK_END	== ($(CONFIG_DRAM_SIZE) - 1)" >> asm_mem.h
-	@echo "	UP_STACK_BASE	== (UP_STACK_END - $(CONFIG_PROC_STACK_SIZE))" >> asm_mem.h
-	@echo "	UP_HEAP1_END	== (UP_STACK_END - $(CONFIG_PROC_STACK_SIZE) - 1)" >> asm_mem.h
-	@echo "	UP_HEAP1_BASE	== $(HEAP_BASE)" >> asm_mem.h
+	@echo "	CONFIG_STACK_END	== ($(CONFIG_DRAM_SIZE) - 1)" >> asm_mem.h
+	@echo "	CONFIG_STACK_BASE	== (CONFIG_STACK_END - $(CONFIG_PROC_STACK_SIZE))" >> asm_mem.h
+	@echo "	CONFIG_HEAP1_END	== (CONFIG_STACK_END - $(CONFIG_PROC_STACK_SIZE) - 1)" >> asm_mem.h
+	@echo "	CONFIG_HEAP1_BASE	== $(HEAP_BASE)" >> asm_mem.h
 
 # Combine all objects in this directory into a library
 
diff --git a/arch/z80/src/z80/z80_head.asm b/arch/z80/src/z80/z80_head.asm
index 816cab347ab6e612b6239a675ee586167d203862..2a02cdf1c1ebd1c2e07e5c309bb847c442a20bf1 100644
--- a/arch/z80/src/z80/z80_head.asm
+++ b/arch/z80/src/z80/z80_head.asm
@@ -166,7 +166,7 @@ _up_reset::
 	; Set up the stack pointer at the location determined the Makefile
 	; and stored in asm_mem.h
 
-	ld	SP, #UP_STACK_END	; Set stack pointer
+	ld	SP, #CONFIG_STACK_END	; Set stack pointer
 
 	; Performed initialization unique to the SDCC toolchain