+ SaveSection();
+ SwitchSection(BSS);
+ }
+
+ return 0;
+}
+
+
+//
+// .ds[.size] expression
+//
+int d_ds(WORD siz)
+{
+ DEBUG { printf("Directive: .ds.[size] = %u, sloc = $%X\n", siz, sloc); }
+
+ uint64_t eval;
+ WORD eattr;
+
+ if ((cursect & (M6502 | M56KPXYL)) == 0)
+ {
+ if ((siz != SIZB) && (sloc & 1)) // Automatic .even
+ auto_even();
+ }
+
+ if (expr(exprbuf, &eval, &eattr, NULL) < 0)
+ return ERROR;
+
+ // Check to see if the value being passed in is negative (who the hell does
+ // that?--nobody does; it's the code gremlins, or rum, what does it)
+ // N.B.: Since 'eval' is of type uint64_t, if it goes negative, it will
+ // have its high bit set.
+ if (eval & 0x8000000000000000)
+ return error("negative sizes not allowed in DS");
+
+ // In non-TDB section (BSS, ABS and M6502) just advance the location
+ // counter appropriately. In TDB sections, deposit (possibly large) chunks
+ // of zeroed memory....
+ if ((scattr & SBSS) || cursect == M6502)
+ {
+ listvalue((uint32_t)eval);
+ eval *= siz;
+ sloc += (uint32_t)eval;
+
+ if (cursect == M6502)
+ chptr += eval;
+
+ just_bss = 1; // No data deposited (8-bit CPU mode)
+ }
+ else if (cursect & M56KPXYL)
+ {
+ // Change segment instead of marking blanks.
+ // Only mark segments we actually wrote something
+ if (chptr != dsp_currentorg->start && dsp_written_data_in_current_org)
+ {
+ dsp_currentorg->end = chptr;
+ dsp_currentorg++;
+ dsp_currentorg->memtype = dsp_currentorg[-1].memtype;
+ }
+
+ listvalue((uint32_t)eval);
+ sloc += (uint32_t)eval;
+
+ // And now let's create a new segment
+ dsp_currentorg->start = chptr;
+ dsp_currentorg->chunk = scode; // Mark down which chunk this org starts from (will be needed when outputting)
+ sect[cursect].orgaddr = sloc;
+ dsp_currentorg->orgadr = sloc;
+ dsp_written_data_in_current_org = 0;
+
+ just_bss = 1; // No data deposited
+ }
+ else
+ {
+ dep_block(eval, siz, 0, (DEFINED | ABS), NULL);