1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-06-08 21:29:30 +00:00

Break long data statements into multiple lines

This commit is contained in:
Curtis F Kaylor 2018-08-05 21:23:51 -04:00
parent e26c49d790
commit b6b84aaa9b
2 changed files with 9 additions and 5 deletions

View File

@ -142,7 +142,7 @@ char escape(char c) {
switch (c) {
case 'a': return 0x07; //Alert (Beep/Bell)
case 'b': return 0x08; //Backspace
case 'e': return 0x08; //Escape
case 'e': return 0x1B; //Escape
case 'f': return 0x0C; //Form Feed
case 'n': return 0x0A; //Newline (Line Feed)
case 'r': return 0x0D; //Return (Carriage Return)

View File

@ -287,14 +287,18 @@ void vardef(int m) {
DEBUG("Building Data for Variable '%s'\n", varnam[i])
value[0] = 0;
for (j=0; j<datlen[i]; j++) {
if (j) strcat(value,",");
if (strlen(value)) strcat(value,",");
sprintf(word, "$%hhX", datvar[dlen++]);
strcat(value, word);
strcat(value, word);
if (strlen(value)>64) {asmlin(BYTEOP,value); value[0]=0;}
}
if (dattyp[i] == DTSTR) {
if (strlen(value)) strcat(value,",");
strcat(value, "$00");
}
if (dattyp[i] == DTSTR) strcat(value, ",$00");
DEBUG("Allocating Data for Variable '%s'\n", varnam[i])
asmlin(BYTEOP, value);
}
}
else if (strlen(varsiz[i]) > 0) {
DEBUG("Allocating array '%s'\n", varnam[i])
asmlin(STROP, varsiz[i]);