tgl6502: set up ready to allow relocatable binaries.
authorAlan Cox <alan@linux.intel.com>
Sun, 25 Jan 2015 15:45:38 +0000 (15:45 +0000)
committerAlan Cox <alan@linux.intel.com>
Sun, 25 Jan 2015 15:45:38 +0000 (15:45 +0000)
Kernel/cpu-6502/cpu.h
Kernel/platform-tgl6502/kernel.def
Kernel/platform-tgl6502/tgl6502.s

index a2610df..66d9e41 100644 (file)
@@ -22,6 +22,7 @@ extern void * __fastcall__ memset(void *, int, size_t);
 extern size_t __fastcall__ strlen(const char *);
 
 #define EMAGIC    0x4C    /* Header of executable (JMP) */
+#define EMAGIC_2  0x18   /* CLC BCC foo */
 /* High byte is saved, low byte is a mystery so take worst case. Also allow
    a bit less as C stack is not return stack */
 #define brk_limit() ((udata.u_syscall_sp | 0xFF) - 384)
index 237aad9..61bfff4 100644 (file)
@@ -6,3 +6,4 @@ U_DATA                      .set $0200
 U_DATA__TOTALSIZE           .set $300        
 
 PROGLOAD                   .set $2000
+ZPBASE                     .set $0
index eca9ec9..8212574 100644 (file)
@@ -624,6 +624,8 @@ platform_doexec:
 ;
            ldx #$ff
            txs
+           ldx #>PROGLOAD      ; For the relocation engine
+           lda #ZPBASE
            jmp (ptr1)          ; Enter user application
 
 ;