Re: [cc65] String Literal Segment in C code

From: <Maspethrose71aol.com>
Date: 2010-11-28 23:14:53
 
 
In a message dated 11/28/2010 4:09:52 P.M. Eastern Standard Time,  
64subnet@gmail.com writes:

Uhhh...  shall we start with your example?  Could you post the  interesting
parts of the code you ran?  I don't have a ready example  of my own...



The config. file:
---------------------------------------------------------
MEMORY {
ZP:  start = $0002, size = $001A, type  = rw, define = yes;
RAM: start = $07FF, size = $3801, file  = %O, define = yes;
RAM2:start = $4FFE, size = $1000, file  = "data.seq", define = yes;
}
SEGMENTS {
STARTUP:  load = RAM, type = ro;
LOWCODE:  load  = RAM, type =  ro,                optional = yes;
INIT:     load = RAM,  type = ro, define = yes, optional = yes;
CODE:     load = RAM, type = ro;
RODATA:   load = RAM, type = ro;
DATA:     load = RAM, type = rw;
ZPSAVE:   load = RAM, type = bss;
BSS:      load = RAM, type = bss, define =  yes;
HEAP:     load = RAM, type = bss,  optional = yes; # must sit just below 
stack
HIDECONST:load  = RAM2,type = ro, optional = yes;
HIDEDATA: load =  RAM2,type = rw, optional = yes;
HIDEBSS:  load =  RAM2,type = bss, optional = yes;
ZEROPAGE: load =  ZP,  type = zp;
}
FEATURES {
CONDES: segment =  INIT,
type =  constructor,
label =  __CONSTRUCTOR_TABLE__,
count =  __CONSTRUCTOR_COUNT__;
CONDES: segment =  RODATA,
type =  destructor,
label =  __DESTRUCTOR_TABLE__,
count =  __DESTRUCTOR_COUNT__;
CONDES: segment =  RODATA,
type =  interruptor,
label =  __INTERRUPTOR_TABLE__,
count =  __INTERRUPTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__:  value = $0800, weak = yes; # 2k stack
}
 
---------------------------------------------------------
The code:
 
---------------------------------------------------------  
#include <stdlib.h>
#include <stdio.h>
#include  <string.h>
#include <ctype.h>
#include <conio.h>
 
#include <c64.h>
 
#pragma rodataseg ("HIDECONST")
#pragma dataseg ("HIDEDATA")
const  unsigned a=0x5000;
char* strovr="Hello, world!";
#pragma rodataseg  ("RODATA")
#pragma dataseg ("DATA")
void main ()
{
cbm_load  ("data,prg",8,0);
puts  (strovr);
}
---------------------------------------------------------



 
-------------------
Joseph Rose, a.k.a. Harry Potter
Working  magic in the computer community...or at least striving to!  :(
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Nov 28 23:15:13 2010

This archive was generated by hypermail 2.1.8 : 2010-11-28 23:15:16 CET