diff -rc tkgate-2.0-a11/src/gmac/gmac.c tkgate-2.0-a11-gmac/src/gmac/gmac.c
*** tkgate-2.0-a11/src/gmac/gmac.c	2005-04-03 11:34:47.000000000 -0300
--- tkgate-2.0-a11-gmac/src/gmac/gmac.c	2008-10-23 16:05:13.036353420 -0200
***************
*** 300,305 ****
--- 300,309 ----
    oi->oi_sRange.lsb = slsb;
    oi->oi_value = val;
  
+   /* By Armando Delgado <nicolui@inf.ufpr.br>, Oct-17-2008 */
+   oi->oi_offset = offset;
+   /* END By Armando */
+ 
    if (oi->oi_sRange.msb < 0) {
      oi->oi_sRange.msb = oi->oi_dRange.msb-oi->oi_dRange.lsb;
      oi->oi_sRange.lsb = 0;
***************
*** 374,380 ****
      if (n[oi->oi_value]->ntype == NT_VALUE)
        MemInst_setNumValue(mi,mask&((n[oi->oi_value]->v.d-MemProg_current(mp))  >> oi->oi_sRange.lsb));
      else
!       MemInst_setSymValue(mi,n[oi->oi_value]->v.s,-MemProg_current(mp),oi->oi_sRange.msb,oi->oi_sRange.lsb);
      break;
    }
    return mi;
--- 378,386 ----
      if (n[oi->oi_value]->ntype == NT_VALUE)
        MemInst_setNumValue(mi,mask&((n[oi->oi_value]->v.d-MemProg_current(mp))  >> oi->oi_sRange.lsb));
      else
!       /* Changed by Armando Delgado <nicolui@inf.ufpr.br>, Oct-17-2008 */
!       MemInst_setSymValue(mi,n[oi->oi_value]->v.s,oi->oi_offset-MemProg_current(mp),oi->oi_sRange.msb,oi->oi_sRange.lsb);
!       /* END By Armando */
      break;
    }
    return mi;
***************
*** 831,836 ****
--- 837,846 ----
  
  int main(int argc,char *argv[])
  {
+   /* By Armando Delgado <nicolui@inf.ufpr.br>, Oct-17-2008 */
+   extern int pcoffset;   /* declared in grammar.y */
+   /* END By Armando */
+ 
    extern char *optarg;
    extern int optind;
  #if OPTRESET
***************
*** 845,852 ****
    map = new_Code(MAP);
  
    while (argc > 0) {
!     while ((c = getopt(argc,argv,"o:m:")) != EOF) {
        switch (c) {
        case 'o' :
  	if (outf) usage();
  	outf = optarg;
--- 855,866 ----
    map = new_Code(MAP);
  
    while (argc > 0) {
!     /* Changed by Armando Delgado <nicolui@inf.ufpr.br>, Oct-17-2008 */
!     while ((c = getopt(argc,argv,"p:o:m:")) != EOF) {
        switch (c) {
+       case 'p' :
+ 	pcoffset = -atoi(optarg);
+ 	break;
        case 'o' :
  	if (outf) usage();
  	outf = optarg;
diff -rc tkgate-2.0-a11/src/gmac/grammar.y tkgate-2.0-a11-gmac/src/gmac/grammar.y
*** tkgate-2.0-a11/src/gmac/grammar.y	2005-04-03 11:35:58.000000000 -0300
--- tkgate-2.0-a11-gmac/src/gmac/grammar.y	2008-10-23 16:12:55.864806253 -0200
***************
*** 31,36 ****
--- 31,40 ----
  %token <I> REGISTER
  %token <S> STRING
  
+ /* Added by Armando Delgado <nicolui@inf.ufpr.br>, Oct-17-2008 */
+ %token PCOFFSET
+ /* END by Armando */
+ 
  %type <S>  label
  %type <I> what dtype register offset opasgn
  %type <R> brange obrange
***************
*** 39,44 ****
--- 43,52 ----
  %{
  #include "parser.h"
  #include "grammar.h"
+ 
+ /* Added by Armando Delgado <nicolui@inf.ufpr.br>, Oct-23-2008 */
+   int pcoffset = 0;
+ /* END by Armando */
  %}
  
  %%
***************
*** 49,54 ****
--- 57,65 ----
  
  top_item	: bank_decl
  		| field_decl
+              /* Added by Armando Delgado <nicolui@inf.ufpr.br>, Oct-17-2008 */
+ 		| offset_decl  
+              /* END by Armando */
  		| reg_decl
  		| operand_decl
  		| op_decl
***************
*** 90,95 ****
--- 101,115 ----
  eitem		: LITERAL ASGN NUMBER			{ ycEnum($1,$3); }
  		;
  
+ /* Added by Armando Delgado <nicolui@inf.ufpr.br>, Oct-17-2008 */
+ /* Changed by Armando Delgado <nicolui@inf.ufpr.br>, Oct-23-2008 */
+ /***********************************************************************
+  * PC Offset declaration
+  ***********************************************************************/
+ offset_decl	: PCOFFSET NUMBER SEMI	 { pcoffset = -$2; }
+ 		;
+ /* END by Armando Delgado */
+ 
  /***********************************************************************
   * Register declarations
   ***********************************************************************/
***************
*** 139,147 ****
  		| PLUS NUMBER obrange ASGN PERCENT NUMBER obrange	{ ycORHS(OI_REGOP,$2,&$3,$6,&$7,0); $$ = 0; }
  		;
  
! offset 		: AT NUMBER	{ $$ = $2; }
! 		| AT		{ $$ = 0; }
  		;
  
  /***********************************************************************
   * Opcode declarations
--- 159,170 ----
  		| PLUS NUMBER obrange ASGN PERCENT NUMBER obrange	{ ycORHS(OI_REGOP,$2,&$3,$6,&$7,0); $$ = 0; }
  		;
  
! /* Changed by Armando Delgado <nicolui@inf.ufpr.br>, Oct-17-2008 */
! /* Changed by Armando Delgado <nicolui@inf.ufpr.br>, Oct-23-2008 */
! offset 		: AT NUMBER	{ $$ = $2 +  pcoffset; }
! 		| AT		{ $$ = pcoffset; }
  		;
+ /* END by Armando Delgado */
  
  /***********************************************************************
   * Opcode declarations
diff -rc tkgate-2.0-a11/src/gmac/luthor.l tkgate-2.0-a11-gmac/src/gmac/luthor.l
*** tkgate-2.0-a11/src/gmac/luthor.l	2005-04-03 11:35:58.000000000 -0300
--- tkgate-2.0-a11-gmac/src/gmac/luthor.l	2008-10-17 16:05:45.196162757 -0300
***************
*** 47,52 ****
--- 47,56 ----
    {"microcode",	MICROCODE }, 
    {"op",	OP }, 
    {"operands",	OPERANDS }, 
+   /* Added by Armando Delgado <nicolui@inf.ufpr.br>, Oct-17-2008 */
+   /* ATENTION: keywords must be in alphabetical order here. */
+   {"pcoffset",	PCOFFSET },
+   /* END by Armando Delgado */
    {"registers",	REGISTERS } 
  };
  int num_lex_words = sizeof(lex_words)/sizeof(lex_words[0]);
