-SECT sect[NSECTS]; // All sections...
-int cursect; // Current section number
-
-// These are copied from the section descriptor, the current code chunk descriptor and the current
-// fixup chunk descriptor when a switch is made into a section. They are copied back to the
-// descriptors when the section is left.
-WORD scattr; // Section attributes
-LONG sloc; // Current loc in section
-
-CHUNK * scode; // Current (last) code chunk
-LONG challoc; // #bytes alloc'd to code chunk
-LONG ch_size; // #bytes used in code chunk
-char * chptr; // Deposit point in code chunk buffer
-
-CHUNK * sfix; // Current (last) fixup chunk
-LONG fchalloc; // #bytes alloc'd to fixup chunk
-LONG fchsize; // #bytes used in fixup chunk
-PTR fchptr; // Deposit point in fixup chunk buffer
-
-unsigned fwdjump[MAXFWDJUMPS]; // forward jump check table
-unsigned fwindex = 0; // forward jump index
-
-// Return a size (SIZB, SIZW, SIZL) or 0, depending on what kind of fixup is associated
-// with a location.
-static char fusiztab[] = {
- 0, // FU_QUICK
- 1, // FU_BYTE
- 2, // FU_WORD
- 2, // FU_WBYTE
- 4, // FU_LONG
- 1, // FU_BBRA
- 0, // (unused)
- 1, // FU_6BRA
+SECT sect[NSECTS]; // All sections...
+int cursect; // Current section number
+
+// These are copied from the section descriptor, the current code chunk
+// descriptor and the current fixup chunk descriptor when a switch is made into
+// a section. They are copied back to the descriptors when the section is left.
+uint16_t scattr; // Section attributes
+uint32_t sloc; // Current loc in section
+
+CHUNK * scode; // Current (last) code chunk
+uint32_t challoc; // # bytes alloc'd to code chunk
+uint32_t ch_size; // # bytes used in code chunk
+uint8_t * chptr; // Deposit point in code chunk buffer
+uint8_t * chptr_opcode; // Backup of chptr, updated before entering code generators
+
+CHUNK * sfix; // Current (last) fixup chunk
+uint32_t fchalloc; // # bytes alloc'd to fixup chunk
+uint32_t fchsize; // # bytes used in fixup chunk
+PTR fchptr; // Deposit point in fixup chunk buffer
+
+// Return a size (SIZB, SIZW, SIZL) or 0, depending on what kind of fixup is
+// associated with a location.
+static uint8_t fusiztab[] = {
+ 0, // FU_QUICK
+ 1, // FU_BYTE
+ 2, // FU_WORD
+ 2, // FU_WBYTE
+ 4, // FU_LONG
+ 1, // FU_BBRA
+ 0, // (unused)
+ 1, // FU_6BRA