Hi, Don.

El Wed, 24 Jul 2019 20:08:09 -0400
Don Wooton <dtwoo...@gmail.com> escribió:

> [...]
> I was not so successful with _INTCONbits.  Maybe I did not do it correctly?

You did it right. All the variations you tried work for me.
Maybe the difference is this:

$ gpasm --version
gpasm-1.5.0 #1285 (May 29 2019)

What version of gputils are you using?

> Manually adding extern _INTCONbit into main.asm in the correct
> section did work but would be rather a pain to automate.

Please try the attached file test2.c

In case of failure, please post the C file and the resulting
assembly file.

-- 
   Gonzalo Pérez de Olaguer Córdoba       s...@gpoc.es
  -=- buscando empleo desde 1988 -=-       www.gpoc.es 

PGP: 3F87 CCE7 8B35 8C06 E637  2D57 5723 9984 718C A614
#include "pic16f1825.h"

typedef unsigned int config_word_t; 
static __code config_word_t __at _CONFIG1 config1Reg = 0x01;
static __code config_word_t __at _CONFIG2 config2Reg = 0x01;


#define disableIntr() \
	(void)INTCONbits; \
	__asm						__endasm; \
	__asm	bcf   _INTCONbits,7	; disableIntr()	__endasm; \
	__asm	btfsc _INTCONbits,7			__endasm; \
	__asm	goto  $-2				__endasm; \
	__asm						__endasm

#define enableIntr() \
	__asm						__endasm; \
	__asm	bsf   _INTCONbits,7	; enableIntr()	__endasm; \
	__asm						__endasm

void main(void)
{
	disableIntr();

	enableIntr();
}

_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to