diff -urb irmp.orig/irmp.c irmp/irmp.c
--- irmp.orig/irmp.c	2015-10-28 16:43:43.357458450 +0100
+++ irmp/irmp.c	2015-10-28 00:27:05.000000000 +0100
@@ -2013,6 +2013,9 @@
      ROM_GPIOPadConfigSet(IRMP_PORT_BASE, IRMP_PORT_PIN,
                           GPIO_STRENGTH_2MA,
                           GPIO_PIN_TYPE_STD_WPU);
+#elif defined(SDCC_STM8)
+    IRMP_GPIO_STRUCT->CR1 |= (1<<IRMP_BIT);   // activate pullup
+    IRMP_GPIO_STRUCT->DDR &= ~(1<<IRMP_BIT);  // pin is input
 #else                                                                   // AVR
     IRMP_PORT &= ~(1<<IRMP_BIT);                                        // deactivate pullup
     IRMP_DDR &= ~(1<<IRMP_BIT);                                         // set pin to input
diff -urb irmp.orig/irmp.h irmp/irmp.h
--- irmp.orig/irmp.h	2015-10-28 16:43:43.357458450 +0100
+++ irmp/irmp.h	2015-10-28 00:27:05.000000000 +0100
@@ -73,6 +73,14 @@
 #  define input(x)                              ((uint8_t)(ROM_GPIOPinRead(IRMP_PORT_BASE, IRMP_PORT_PIN)))
 #  define sei()                                 IntMasterEnable()
 
+#elif defined(SDCC_STM8)
+#  define _CONCAT(a,b)                          a##b
+#  define CONCAT(a,b)                           _CONCAT(a,b)
+#  define IRMP_GPIO_STRUCT                      CONCAT(GPIO, IRMP_PORT_LETTER)
+#  define IRMP_PIN
+#  define IRMP_BIT                              IRMP_BIT_NUMBER
+#  define input(x)                              (IRMP_GPIO_STRUCT->IDR & 1<<IRMP_BIT)
+
 #endif
 
 #if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
diff -urb irmp.orig/irmpconfig.h irmp/irmpconfig.h
--- irmp.orig/irmpconfig.h	2015-10-28 16:43:43.357458450 +0100
+++ irmp/irmpconfig.h	2015-10-28 00:58:51.000000000 +0100
@@ -141,6 +141,13 @@
 #  define IRMP_BIT_NUMBER                       4
 
 /*---------------------------------------------------------------------------------------------------------------------------------------------------
+ * Change hardware pin here for STM8
+ *---------------------------------------------------------------------------------------------------------------------------------------------------
+ */
+#elif defined (SDCC_STM8)                                               // use PA1 as IR input on STM8
+#  define IRMP_PORT_LETTER                      A
+#  define IRMP_BIT_NUMBER                       1
+/*---------------------------------------------------------------------------------------------------------------------------------------------------
  * Handling of unknown target system: DON'T CHANGE
  *---------------------------------------------------------------------------------------------------------------------------------------------------
  */
diff -urb irmp.orig/irmpsystem.h irmp/irmpsystem.h
--- irmp.orig/irmpsystem.h	2015-10-28 16:43:43.361458349 +0100
+++ irmp/irmpsystem.h	2015-10-28 00:27:06.000000000 +0100
@@ -46,6 +46,8 @@
 #elif defined(TARGET_IS_BLIZZARD_RA2)                                               // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio)
 #  define STELLARIS_ARM_CORTEX_M4
 #  define F_CPU (SysCtlClockGet())
+#elif defined(__SDCC_stm8)                                                          // SDCC stm8 target
+#  define SDCC_STM8
 #elif defined(unix) || defined(WIN32) || defined(__APPLE__)                         // Unix/Linux or Windows or Apple
 #  define UNIX_OR_WINDOWS
 #else
@@ -116,6 +118,15 @@
 #  define PROGMEM
 #  define memcpy_P                      memcpy
 
+#elif defined(SDCC_STM8)
+
+#  include "stm8s.h"
+#  define PROGMEM
+#  define memcpy_P                      memcpy
+#  define __attribute__(x)
+#  define uint_fast8_t uint8_t
+#  define uint_fast16_t uint16_t
+
 #else
 
 #  define PROGMEM
