+void DelCodeEntries (CodeSeg* S, unsigned Start, unsigned Count)
+/* Delete a range of code entries. This includes removing references to labels,
+ * labels attached to the entries and so on.
+ */
+{
+ /* Start deleting the entries from the rear, because this involves less
+ * memory moving.
+ */
+ while (Count--) {
+ DelCodeEntry (S, Start + Count);
+ }
+}
+
+
+
+void MoveCodeEntry (CodeSeg* S, unsigned OldPos, unsigned NewPos)
+/* Move an entry from one position to another. OldPos is the current position
+ * of the entry, NewPos is the new position of the entry.
+ */
+{
+ /* Get the code entry and remove it from the collection */
+ CodeEntry* E = GetCodeEntry (S, OldPos);
+ CollDelete (&S->Entries, OldPos);
+
+ /* Correct NewPos if needed */
+ if (NewPos >= OldPos) {
+ /* Position has changed with removal */
+ --NewPos;
+ }
+
+ /* Now insert it at the new position */
+ CollInsert (&S->Entries, E, NewPos);
+}
+
+
+