| 1 | /* |
| 2 | the DASM macro assembler (aka small systems cross assembler) |
| 3 | |
| 4 | Copyright (c) 1988-2002 by Matthew Dillon. |
| 5 | Copyright (c) 1995 by Olaf "Rhialto" Seibert. |
| 6 | Copyright (c) 2003-2008 by Andrew Davie. |
| 7 | Copyright (c) 2008 by Peter H. Froehlich. |
| 8 | |
| 9 | This program is free software; you can redistribute it and/or modify |
| 10 | it under the terms of the GNU General Public License as published by |
| 11 | the Free Software Foundation; either version 2 of the License, or |
| 12 | (at your option) any later version. |
| 13 | |
| 14 | This program is distributed in the hope that it will be useful, |
| 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | GNU General Public License for more details. |
| 18 | |
| 19 | You should have received a copy of the GNU General Public License along |
| 20 | with this program; if not, write to the Free Software Foundation, Inc., |
| 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 22 | */ |
| 23 | |
| 24 | /* |
| 25 | * OPS.C |
| 26 | * |
| 27 | * Handle mnemonics and pseudo ops |
| 28 | */ |
| 29 | |
| 30 | #include "asm.h"cxx . . $ `<file>/src/asm.h`/ |
| 31 | |
| 32 | unsigned char Gencxx . . $ Gen.[MAXLINEcxx . . $ `src/asm.h:67:9`!]; |
| 33 | unsigned char OrgFillcxx . . $ OrgFill. = DEFORGFILLcxx . . $ `src/asm.h:163:9`!; |
| 34 | int Glencxx . . $ Glen.; |
| 35 | |
| 36 | extern MNEMONICcxx . . $ `src/asm.h:154:9`! Mne6502cxx . . $ Mne6502.[]; |
| 37 | extern MNEMONICcxx . . $ `src/asm.h:154:9`! Mne6803cxx . . $ Mne6803.[]; |
| 38 | extern MNEMONICcxx . . $ `src/asm.h:154:9`! MneHD6303cxx . . $ MneHD6303.[]; |
| 39 | extern MNEMONICcxx . . $ `src/asm.h:154:9`! Mne68705cxx . . $ Mne68705.[]; |
| 40 | extern MNEMONICcxx . . $ `src/asm.h:154:9`! Mne68HC11cxx . . $ Mne68HC11.[]; |
| 41 | extern MNEMONICcxx . . $ `src/asm.h:154:9`! MneF8cxx . . $ MneF8.[]; |
| 42 | extern MNEMONICcxx . . $ `src/asm.h:154:9`! Mne68908cxx . . $ Mne68908.[]; |
| 43 | |
| 44 | void generatecxx . . $ generate(49f6e7a06ebc5aa8).(void); |
| 45 | void genfillcxx . . $ genfill(86ac8c965b1a1974).(long fill, long bytes, int size); |
| 46 | void pushifcxx . . $ pushif(b45ddcbc8423892c).(boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xbool); |
| 47 | int gethexdigcxx . . $ gethexdig(7864480464b09eea).(int c); |
| 48 | |
| 49 | /* |
| 50 | * An opcode modifies the SEGMENT flags in the following ways: |
| 51 | */ |
| 52 | |
| 53 | void v_processorcxx . . $ v_processor(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 54 | { |
| 55 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! bCalled = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 56 | unsigned long PreviousProcessor = Processorcxx . . $ Processor.; |
| 57 | |
| 58 | Processorcxx . . $ Processor. = 0; |
| 59 | |
| 60 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str,"6502") == 0) |
| 61 | { |
| 62 | if ( !bCalled ) |
| 63 | addhashtablecxx . . $ addhashtable(c2a72e93142ff88d).(Mne6502cxx . . $ Mne6502.); |
| 64 | |
| 65 | MsbOrdercxx . . $ MsbOrder. = 0; /* lsb,msb */ |
| 66 | Processorcxx . . $ Processor. = 6502; |
| 67 | } |
| 68 | |
| 69 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str,"6803") == 0) |
| 70 | { |
| 71 | if ( !bCalled ) |
| 72 | addhashtablecxx . . $ addhashtable(c2a72e93142ff88d).(Mne6803cxx . . $ Mne6803.); |
| 73 | |
| 74 | MsbOrdercxx . . $ MsbOrder. = 1; /* msb,lsb */ |
| 75 | Processorcxx . . $ Processor. = 6803; |
| 76 | } |
| 77 | |
| 78 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str,"HD6303") == 0 || strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str, "hd6303") == 0) |
| 79 | { |
| 80 | if ( !bCalled ) |
| 81 | { |
| 82 | addhashtablecxx . . $ addhashtable(c2a72e93142ff88d).(Mne6803cxx . . $ Mne6803.); |
| 83 | addhashtablecxx . . $ addhashtable(c2a72e93142ff88d).(MneHD6303cxx . . $ MneHD6303.); |
| 84 | } |
| 85 | |
| 86 | MsbOrdercxx . . $ MsbOrder. = 1; /* msb,lsb */ |
| 87 | Processorcxx . . $ Processor. = 6303; |
| 88 | } |
| 89 | |
| 90 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str,"68705") == 0) |
| 91 | { |
| 92 | if ( !bCalled ) |
| 93 | addhashtablecxx . . $ addhashtable(c2a72e93142ff88d).(Mne68705cxx . . $ Mne68705.); |
| 94 | |
| 95 | MsbOrdercxx . . $ MsbOrder. = 1; /* msb,lsb */ |
| 96 | Processorcxx . . $ Processor. = 68705; |
| 97 | } |
| 98 | |
| 99 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str,"68HC11") == 0 || strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str, "68hc11") == 0) |
| 100 | { |
| 101 | if ( !bCalled ) |
| 102 | addhashtablecxx . . $ addhashtable(c2a72e93142ff88d).(Mne68HC11cxx . . $ Mne68HC11.); |
| 103 | |
| 104 | MsbOrdercxx . . $ MsbOrder. = 1; /* msb,lsb */ |
| 105 | Processorcxx . . $ Processor. = 6811; |
| 106 | } |
| 107 | |
| 108 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str,"F8") == 0 || strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str, "f8") == 0) |
| 109 | { |
| 110 | if ( !bCalled ) |
| 111 | addhashtablecxx . . $ addhashtable(c2a72e93142ff88d).(MneF8cxx . . $ MneF8.); |
| 112 | |
| 113 | MsbOrdercxx . . $ MsbOrder. = 1; |
| 114 | Processorcxx . . $ Processor. = 0xf8; |
| 115 | } |
| 116 | if ((strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str,"68908") == 0) || (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str,"68hc908") == 0)) { |
| 117 | if ( !bCalled ) { |
| 118 | addhashtablecxx . . $ addhashtable(c2a72e93142ff88d).(Mne68908cxx . . $ Mne68908.); |
| 119 | } |
| 120 | MsbOrdercxx . . $ MsbOrder. = 1; /* msb,lsb */ |
| 121 | Processorcxx . . $ Processor. = 68908; |
| 122 | } |
| 123 | |
| 124 | bCalled = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 125 | |
| 126 | if ( !Processorcxx . . $ Processor. ) |
| 127 | { |
| 128 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_PROCESSOR_NOT_SUPPORTEDcxx . . $ ERROR_PROCESSOR_NOT_SUPPORTED., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, str ); |
| 129 | } |
| 130 | |
| 131 | if ( PreviousProcessor && Processorcxx . . $ Processor. != PreviousProcessor ) |
| 132 | { |
| 133 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ONLY_ONE_PROCESSOR_SUPPORTEDcxx . . $ ERROR_ONLY_ONE_PROCESSOR_SUPPORTED., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, str ); |
| 134 | } |
| 135 | |
| 136 | } |
| 137 | |
| 138 | #define badcodecxx . . $ `src/ops.c:138:9`!(mne,adrmode) (!(mne->okmask & (1L << adrmode))) |
| 139 | |
| 140 | extern int passcxx . . $ pass.; |
| 141 | extern int nMaxPassescxx . . $ nMaxPasses.; |
| 142 | |
| 143 | void v_mnemoniccxx . . $ v_mnemonic(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *mne) |
| 144 | { |
| 145 | int addrmode; |
| 146 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym; |
| 147 | unsigned int opcode; |
| 148 | short opidx; |
| 149 | SYMBOLcxx . . $ `src/asm.h:160:9`! *symbase; |
| 150 | int opsize; |
| 151 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! byteRequested; |
| 152 | char sBuffer[128]; |
| 153 | |
| 154 | Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. |= SF_REFcxx . . $ `src/asm.h:309:9`!; |
| 155 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 156 | symbase = evalcxx . . $ eval(83a8820e5b78665b).(str, 1); |
| 157 | |
| 158 | if ( bTracecxx . . $ bTrace. ) |
| 159 | printfcxx . . $ printf(581fddd72a8db8fc).("PC: %04lx MNEMONIC: %s addrmode: %d ", Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org., mne->namecxx . . $ _MNE#name., symbase->addrmodecxx . . $ _SYMBOL#addrmode.); |
| 160 | |
| 161 | for (sym = symbase; sym; sym = sym->nextcxx . . $ _SYMBOL#next.) |
| 162 | { |
| 163 | if (sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) |
| 164 | { |
| 165 | ++Redocxx . . $ Redo.; |
| 166 | Redo_whycxx . . $ Redo_why. |= REASON_MNEMONIC_NOT_RESOLVEDcxx . . $ REASON_MNEMONIC_NOT_RESOLVED.; |
| 167 | } |
| 168 | } |
| 169 | sym = symbase; |
| 170 | |
| 171 | if (mne->flagscxx . . $ _MNE#flags. & MF_IMODcxx . . $ `src/asm.h:243:9`!) |
| 172 | { |
| 173 | if (sym->nextcxx . . $ _SYMBOL#next.) |
| 174 | { |
| 175 | sym->addrmodecxx . . $ _SYMBOL#addrmode. = AM_BITMODcxx . . $ AM_BITMOD.; |
| 176 | if ((mne->flagscxx . . $ _MNE#flags. & MF_RELcxx . . $ `src/asm.h:242:9`!) && sym->nextcxx . . $ _SYMBOL#next.) |
| 177 | sym->addrmodecxx . . $ _SYMBOL#addrmode. = AM_BITBRAMODcxx . . $ AM_BITBRAMOD.; |
| 178 | } |
| 179 | } |
| 180 | addrmode = sym->addrmodecxx . . $ _SYMBOL#addrmode.; |
| 181 | if ((sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) || sym->valuecxx . . $ _SYMBOL#value. >= 0x100) |
| 182 | opsize = 2; |
| 183 | else |
| 184 | opsize = (sym->valuecxx . . $ _SYMBOL#value.) ? 1 : 0; |
| 185 | |
| 186 | while (badcodecxx . . $ `src/ops.c:138:9`!(mne,addrmode) && Cvtcxx . . $ Cvt.[addrmode]) |
| 187 | addrmode = Cvtcxx . . $ Cvt.[addrmode]; |
| 188 | |
| 189 | |
| 190 | if ( bTracecxx . . $ bTrace. ) |
| 191 | printfcxx . . $ printf(581fddd72a8db8fc).("mnemask: %08lx adrmode: %d Cvt[am]: %d Mnext:%d value: %ld\n", mne->okmaskcxx . . $ _MNE#okmask., addrmode, Cvtcxx . . $ Cvt.[addrmode], Mnextcxx . . $ Mnext., sym->valuecxx . . $ _SYMBOL#value.); |
| 192 | |
| 193 | if (badcodecxx . . $ `src/ops.c:138:9`!(mne,addrmode)) |
| 194 | { |
| 195 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "%s %s", mne->namecxx . . $ _MNE#name., str ); |
| 196 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ILLEGAL_ADDRESSING_MODEcxx . . $ ERROR_ILLEGAL_ADDRESSING_MODE., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 197 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(symbase); |
| 198 | //FIX |
| 199 | ++Redocxx . . $ Redo.; |
| 200 | Redo_whycxx . . $ Redo_why. |= REASON_MNEMONIC_NOT_RESOLVEDcxx . . $ REASON_MNEMONIC_NOT_RESOLVED.; |
| 201 | return; |
| 202 | } |
| 203 | |
| 204 | |
| 205 | if (Mnextcxx . . $ Mnext. >= 0 && Mnextcxx . . $ Mnext. < NUMOCcxx . . $ NUMOC.) /* Force */ |
| 206 | { |
| 207 | addrmode = Mnextcxx . . $ Mnext.; |
| 208 | |
| 209 | //FIX: OPCODE.FORCE needs to be adjusted for x,y,sp indexing... |
| 210 | switch(sym->addrmodecxx . . $ _SYMBOL#addrmode.) { |
| 211 | case AM_INDBYTEXcxx . . $ AM_INDBYTEX.: |
| 212 | case AM_INDBYTEYcxx . . $ AM_INDBYTEY.: |
| 213 | // there is only INDWORD to force indirect addressing mode but not with X or Y |
| 214 | // this must be an error |
| 215 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ILLEGAL_FORCED_ADDRESSING_MODEcxx . . $ ERROR_ILLEGAL_FORCED_ADDRESSING_MODE., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, mne->namecxx . . $ _MNE#name. ); |
| 216 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(symbase); |
| 217 | |
| 218 | //FIX: Cause assembly to fail when an invalid mode is used for an opcode... |
| 219 | ++Redocxx . . $ Redo.; |
| 220 | Redo_whycxx . . $ Redo_why. |= REASON_MNEMONIC_NOT_RESOLVEDcxx . . $ REASON_MNEMONIC_NOT_RESOLVED.; |
| 221 | return; |
| 222 | |
| 223 | case AM_BYTEADR_SPcxx . . $ AM_BYTEADR_SP.: |
| 224 | addrmode = AM_BYTEADR_SPcxx . . $ AM_BYTEADR_SP.; |
| 225 | if ((Mnextcxx . . $ Mnext. == AM_WORDADRcxx . . $ AM_WORDADR.) || (Mnextcxx . . $ Mnext. == AM_WORDADR_SPcxx . . $ AM_WORDADR_SP.)) |
| 226 | addrmode = AM_WORDADR_SPcxx . . $ AM_WORDADR_SP.; |
| 227 | break; |
| 228 | |
| 229 | case AM_0Ycxx . . $ AM_0Y.: |
| 230 | addrmode = AM_0Ycxx . . $ AM_0Y.; |
| 231 | |
| 232 | if ((Mnextcxx . . $ Mnext. == AM_WORDADRcxx . . $ AM_WORDADR.) || (Mnextcxx . . $ Mnext. == AM_WORDADRYcxx . . $ AM_WORDADRY.)) |
| 233 | addrmode = AM_WORDADRYcxx . . $ AM_WORDADRY.; |
| 234 | |
| 235 | if ((Mnextcxx . . $ Mnext. == AM_BYTEADRcxx . . $ AM_BYTEADR.) || (Mnextcxx . . $ Mnext. == AM_BYTEADRYcxx . . $ AM_BYTEADRY.)) |
| 236 | addrmode = AM_BYTEADRYcxx . . $ AM_BYTEADRY.; |
| 237 | break; |
| 238 | |
| 239 | case AM_0Xcxx . . $ AM_0X.: |
| 240 | addrmode = AM_0Xcxx . . $ AM_0X.; |
| 241 | |
| 242 | if ((Mnextcxx . . $ Mnext. == AM_WORDADRcxx . . $ AM_WORDADR.) || (Mnextcxx . . $ Mnext. == AM_WORDADRXcxx . . $ AM_WORDADRX.)) |
| 243 | addrmode = AM_WORDADRXcxx . . $ AM_WORDADRX.; |
| 244 | |
| 245 | if ((Mnextcxx . . $ Mnext. == AM_BYTEADRcxx . . $ AM_BYTEADR.) || (Mnextcxx . . $ Mnext. == AM_BYTEADRXcxx . . $ AM_BYTEADRX.)) |
| 246 | addrmode = AM_BYTEADRXcxx . . $ AM_BYTEADRX.; |
| 247 | break; |
| 248 | } |
| 249 | |
| 250 | |
| 251 | if (badcodecxx . . $ `src/ops.c:138:9`!(mne,addrmode)) |
| 252 | { |
| 253 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ILLEGAL_FORCED_ADDRESSING_MODEcxx . . $ ERROR_ILLEGAL_FORCED_ADDRESSING_MODE., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, mne->namecxx . . $ _MNE#name. ); |
| 254 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(symbase); |
| 255 | |
| 256 | //FIX: Cause assembly to fail when an invalid mode is used for an opcode... |
| 257 | ++Redocxx . . $ Redo.; |
| 258 | Redo_whycxx . . $ Redo_why. |= REASON_MNEMONIC_NOT_RESOLVEDcxx . . $ REASON_MNEMONIC_NOT_RESOLVED.; |
| 259 | return; |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | if ( bTracecxx . . $ bTrace. ) |
| 264 | printfcxx . . $ printf(581fddd72a8db8fc).("final addrmode = %d, opsize:%d Opsize[%d]:%d\n", addrmode, opsize, addrmode, Opsizecxx . . $ Opsize.[addrmode]); |
| 265 | |
| 266 | byteRequested = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 267 | switch(Mnextcxx . . $ Mnext.) { |
| 268 | case AM_IMM8cxx . . $ AM_IMM8.: |
| 269 | case AM_BYTEADRcxx . . $ AM_BYTEADR.: |
| 270 | case AM_BYTEADRXcxx . . $ AM_BYTEADRX.: |
| 271 | case AM_BYTEADRYcxx . . $ AM_BYTEADRY.: |
| 272 | case AM_BYTEADR_SPcxx . . $ AM_BYTEADR_SP.: |
| 273 | byteRequested = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 274 | if (opsize > 1) { |
| 275 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "%s %s, user requested byte mode", mne->namecxx . . $ _MNE#name., str ); |
| 276 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ADDRESS_MUST_BE_LT_100cxx . . $ ERROR_ADDRESS_MUST_BE_LT_100., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 277 | } |
| 278 | break; |
| 279 | } |
| 280 | |
| 281 | switch(addrmode) { |
| 282 | case AM_IMM16cxx . . $ AM_IMM16.: |
| 283 | case AM_WORDADRcxx . . $ AM_WORDADR.: |
| 284 | case AM_WORDADRXcxx . . $ AM_WORDADRX.: |
| 285 | case AM_WORDADRYcxx . . $ AM_WORDADRY.: |
| 286 | case AM_INDWORDcxx . . $ AM_INDWORD.: |
| 287 | case AM_WORDADR_SPcxx . . $ AM_WORDADR_SP.: |
| 288 | if ((sym->valuecxx . . $ _SYMBOL#value. > 0xFFFF) || (sym->valuecxx . . $ _SYMBOL#value. < -0xFFFF)) { // isn't this our space ? |
| 289 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "%s %s", mne->namecxx . . $ _MNE#name., str ); |
| 290 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ADDRESS_MUST_BE_LT_10000cxx . . $ ERROR_ADDRESS_MUST_BE_LT_10000., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 291 | } |
| 292 | break; |
| 293 | |
| 294 | case AM_IMM8cxx . . $ AM_IMM8.: |
| 295 | case AM_BYTEADRcxx . . $ AM_BYTEADR.: |
| 296 | case AM_BYTEADRXcxx . . $ AM_BYTEADRX.: |
| 297 | case AM_BYTEADRYcxx . . $ AM_BYTEADRY.: |
| 298 | case AM_BYTEADR_SPcxx . . $ AM_BYTEADR_SP.: |
| 299 | if (sym->valuecxx . . $ _SYMBOL#value. < -0xFF) { // isn't this our space ? |
| 300 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "negative %s %s", mne->namecxx . . $ _MNE#name., str ); |
| 301 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ADDRESS_MUST_BE_LT_100cxx . . $ ERROR_ADDRESS_MUST_BE_LT_100., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 302 | } |
| 303 | break; |
| 304 | } |
| 305 | |
| 306 | while (opsize > Opsizecxx . . $ Opsize.[addrmode]) |
| 307 | { |
| 308 | if (Cvtcxx . . $ Cvt.[addrmode] == 0 || badcodecxx . . $ `src/ops.c:138:9`!(mne,Cvt[addrmode])) |
| 309 | { |
| 310 | if (sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) |
| 311 | break; |
| 312 | |
| 313 | //FIX: for negative operands... |
| 314 | if ( (addrmode == AM_IMM8cxx . . $ AM_IMM8.) && (sym->valuecxx . . $ _SYMBOL#value. <0) ) |
| 315 | { |
| 316 | opsize=1; |
| 317 | sym->valuecxx . . $ _SYMBOL#value.=(char)(sym->valuecxx . . $ _SYMBOL#value. & 255); |
| 318 | break; |
| 319 | } |
| 320 | |
| 321 | |
| 322 | if ((sym->valuecxx . . $ _SYMBOL#value. > 255) && !byteRequested) { |
| 323 | // automatically increasing address-mode only if user has not explicitly stated |
| 324 | if (addrmode == AM_BYTEADRXcxx . . $ AM_BYTEADRX.) { |
| 325 | if (! badcodecxx . . $ `src/ops.c:138:9`!(mne, AM_WORDADRX)) { |
| 326 | addrmode = AM_WORDADRXcxx . . $ AM_WORDADRX.; |
| 327 | break; |
| 328 | } |
| 329 | } |
| 330 | if (addrmode == AM_BYTEADRYcxx . . $ AM_BYTEADRY.) { |
| 331 | if (! badcodecxx . . $ `src/ops.c:138:9`!(mne, AM_WORDADRY)) { |
| 332 | addrmode = AM_WORDADRYcxx . . $ AM_WORDADRY.; |
| 333 | break; |
| 334 | } |
| 335 | } |
| 336 | if (addrmode == AM_BYTEADR_SPcxx . . $ AM_BYTEADR_SP.) { |
| 337 | if (! badcodecxx . . $ `src/ops.c:138:9`!(mne, AM_WORDADR_SP)) { |
| 338 | addrmode = AM_WORDADR_SPcxx . . $ AM_WORDADR_SP.; |
| 339 | break; |
| 340 | } |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "%s %s", mne->namecxx . . $ _MNE#name., str ); |
| 345 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ADDRESS_MUST_BE_LT_100cxx . . $ ERROR_ADDRESS_MUST_BE_LT_100., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 346 | break; |
| 347 | } |
| 348 | addrmode = Cvtcxx . . $ Cvt.[addrmode]; |
| 349 | } |
| 350 | opcode = mne->opcodecxx . . $ _MNE#opcode.[addrmode]; |
| 351 | opidx = 1 + (opcode > 0xFF); |
| 352 | if (opidx == 2) |
| 353 | { |
| 354 | Gencxx . . $ Gen.[0] = opcode >> 8; |
| 355 | Gencxx . . $ Gen.[1] = opcode; |
| 356 | } |
| 357 | else |
| 358 | { |
| 359 | Gencxx . . $ Gen.[0] = opcode; |
| 360 | } |
| 361 | |
| 362 | switch(addrmode) |
| 363 | { |
| 364 | case AM_BITMODcxx . . $ AM_BITMOD.: |
| 365 | sym = symbase->nextcxx . . $ _SYMBOL#next.; |
| 366 | if (!(sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) && sym->valuecxx . . $ _SYMBOL#value. >= 0x100) { |
| 367 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "unknown %s %ld", mne->namecxx . . $ _MNE#name., sym->valuecxx . . $ _SYMBOL#value.); |
| 368 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ADDRESS_MUST_BE_LT_100cxx . . $ ERROR_ADDRESS_MUST_BE_LT_100., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 369 | } |
| 370 | Gencxx . . $ Gen.[opidx++] = sym->valuecxx . . $ _SYMBOL#value.; |
| 371 | |
| 372 | if (!(symbase->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!)) |
| 373 | { |
| 374 | if (symbase->valuecxx . . $ _SYMBOL#value. > 7) |
| 375 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ILLEGAL_BIT_SPECIFICATIONcxx . . $ ERROR_ILLEGAL_BIT_SPECIFICATION., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, str ); |
| 376 | else |
| 377 | Gencxx . . $ Gen.[0] += symbase->valuecxx . . $ _SYMBOL#value. << 1; |
| 378 | } |
| 379 | break; |
| 380 | |
| 381 | case AM_BITBRAMODcxx . . $ AM_BITBRAMOD.: |
| 382 | |
| 383 | if (!(symbase->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!)) |
| 384 | { |
| 385 | if (symbase->valuecxx . . $ _SYMBOL#value. > 7) |
| 386 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ILLEGAL_BIT_SPECIFICATIONcxx . . $ ERROR_ILLEGAL_BIT_SPECIFICATION., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, str ); |
| 387 | else |
| 388 | Gencxx . . $ Gen.[0] += symbase->valuecxx . . $ _SYMBOL#value. << 1; |
| 389 | } |
| 390 | |
| 391 | sym = symbase->nextcxx . . $ _SYMBOL#next.; |
| 392 | |
| 393 | if (!(sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) && sym->valuecxx . . $ _SYMBOL#value. >= 0x100) { |
| 394 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "%s %ld", mne->namecxx . . $ _MNE#name., sym->valuecxx . . $ _SYMBOL#value.); |
| 395 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ADDRESS_MUST_BE_LT_100cxx . . $ ERROR_ADDRESS_MUST_BE_LT_100., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 396 | } |
| 397 | Gencxx . . $ Gen.[opidx++] = sym->valuecxx . . $ _SYMBOL#value.; |
| 398 | sym = sym->nextcxx . . $ _SYMBOL#next.; |
| 399 | break; |
| 400 | |
| 401 | case AM_RELcxx . . $ AM_REL.: |
| 402 | break; |
| 403 | |
| 404 | default: |
| 405 | if (Opsizecxx . . $ Opsize.[addrmode] > 0) |
| 406 | Gencxx . . $ Gen.[opidx++] = sym->valuecxx . . $ _SYMBOL#value.; |
| 407 | if (Opsizecxx . . $ Opsize.[addrmode] == 2) |
| 408 | { |
| 409 | if (MsbOrdercxx . . $ MsbOrder.) |
| 410 | { |
| 411 | Gencxx . . $ Gen.[opidx-1] = sym->valuecxx . . $ _SYMBOL#value. >> 8; |
| 412 | Gencxx . . $ Gen.[opidx++] = sym->valuecxx . . $ _SYMBOL#value.; |
| 413 | } |
| 414 | else |
| 415 | { |
| 416 | Gencxx . . $ Gen.[opidx++] = sym->valuecxx . . $ _SYMBOL#value. >> 8; |
| 417 | } |
| 418 | } |
| 419 | sym = sym->nextcxx . . $ _SYMBOL#next.; |
| 420 | break; |
| 421 | } |
| 422 | |
| 423 | if (mne->flagscxx . . $ _MNE#flags. & MF_MASKcxx . . $ `src/asm.h:241:9`!) |
| 424 | { |
| 425 | if (sym) |
| 426 | { |
| 427 | if (!(sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) && sym->valuecxx . . $ _SYMBOL#value. >= 0x100) { |
| 428 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "unknown && > 256 %s %ld", mne->namecxx . . $ _MNE#name., sym->valuecxx . . $ _SYMBOL#value.); |
| 429 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ADDRESS_MUST_BE_LT_100cxx . . $ ERROR_ADDRESS_MUST_BE_LT_100., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 430 | } |
| 431 | Gencxx . . $ Gen.[opidx] = sym->valuecxx . . $ _SYMBOL#value.; |
| 432 | sym = sym->nextcxx . . $ _SYMBOL#next.; |
| 433 | } |
| 434 | else |
| 435 | { |
| 436 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_NOT_ENOUGH_ARGScxx . . $ ERROR_NOT_ENOUGH_ARGS., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ); |
| 437 | } |
| 438 | |
| 439 | ++opidx; |
| 440 | } |
| 441 | |
| 442 | if ((mne->flagscxx . . $ _MNE#flags. & MF_RELcxx . . $ `src/asm.h:242:9`!) || addrmode == AM_RELcxx . . $ AM_REL.) |
| 443 | { |
| 444 | ++opidx; /* to end of instruction */ |
| 445 | |
| 446 | if (!sym) |
| 447 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_NOT_ENOUGH_ARGScxx . . $ ERROR_NOT_ENOUGH_ARGS., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ); |
| 448 | else if (!(sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!)) |
| 449 | { |
| 450 | long pc; |
| 451 | unsigned char pcf; |
| 452 | long dest; |
| 453 | |
| 454 | pc = (Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. & SF_RORGcxx . . $ `src/asm.h:311:9`!) ? Csegmentcxx . . $ Csegment.->rorgcxx . . $ _SEGMENT#rorg. : Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org.; |
| 455 | pcf= (Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. & SF_RORGcxx . . $ `src/asm.h:311:9`!) ? Csegmentcxx . . $ Csegment.->rflagscxx . . $ _SEGMENT#rflags. : Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags.; |
| 456 | |
| 457 | if ((pcf & (SF_UNKNOWNcxx . . $ `src/asm.h:308:9`!|2)) == 0) |
| 458 | { |
| 459 | dest = sym->valuecxx . . $ _SYMBOL#value. - pc - opidx; |
| 460 | |
| 461 | if (dest >= 128 || dest < -128) |
| 462 | { |
| 463 | //FIX: sometimes zero page addressing will first be assumed to be absolute until |
| 464 | // another pass. ERROR_BRANCH_OUT_OF_RANGE was made non-fatal, but we keep |
| 465 | // pushing for Redo so assembly won't actually be succesfull until the branch |
| 466 | // actually works. |
| 467 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "%ld", dest ); |
| 468 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_BRANCH_OUT_OF_RANGEcxx . . $ ERROR_BRANCH_OUT_OF_RANGE., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 469 | ++Redocxx . . $ Redo.; |
| 470 | Redo_whycxx . . $ Redo_why. |= REASON_BRANCH_OUT_OF_RANGEcxx . . $ REASON_BRANCH_OUT_OF_RANGE.; |
| 471 | sym->flagscxx . . $ _SYMBOL#flags.=sym->flagscxx . . $ _SYMBOL#flags. | SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!; |
| 472 | dest = 0; |
| 473 | } |
| 474 | } |
| 475 | else |
| 476 | { |
| 477 | /* Don't bother - we'll take another pass */ |
| 478 | dest = 0; |
| 479 | } |
| 480 | Gencxx . . $ Gen.[opidx-1] = dest & 0xFF; /* byte before end of inst. */ |
| 481 | } |
| 482 | } |
| 483 | Glencxx . . $ Glen. = opidx; |
| 484 | generatecxx . . $ generate(49f6e7a06ebc5aa8).(); |
| 485 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(symbase); |
| 486 | } |
| 487 | |
| 488 | void v_tracecxx . . $ v_trace(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 489 | { |
| 490 | bTracecxx . . $ bTrace. = (str[1] == 'n'); |
| 491 | } |
| 492 | |
| 493 | void v_listcxx . . $ v_list(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 494 | { |
| 495 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 496 | |
| 497 | Glencxx . . $ Glen. = 0; /* Only so outlist() works */ |
| 498 | |
| 499 | if (strncmpcxx . . $ strncmp(fd278af2f295fa2e).(str, "localoff", 7) == 0 || strncmpcxx . . $ strncmp(fd278af2f295fa2e).(str, "LOCALOFF", 7) == 0) |
| 500 | pIncfilecxx . . $ pIncfile.->flagscxx . . $ _INCFILE#flags. |= INF_NOLISTcxx . . $ `src/asm.h:268:9`!; |
| 501 | else if (strncmpcxx . . $ strncmp(fd278af2f295fa2e).(str, "localon", 7) == 0 || strncmpcxx . . $ strncmp(fd278af2f295fa2e).(str, "LOCALON", 7) == 0) |
| 502 | pIncfilecxx . . $ pIncfile.->flagscxx . . $ _INCFILE#flags. &= ~INF_NOLISTcxx . . $ `src/asm.h:268:9`!; |
| 503 | else if (strncmpcxx . . $ strncmp(fd278af2f295fa2e).(str, "off", 2) == 0 || strncmpcxx . . $ strncmp(fd278af2f295fa2e).(str, "OFF", 2) == 0) |
| 504 | ListModecxx . . $ ListMode. = 0; |
| 505 | else |
| 506 | ListModecxx . . $ ListMode. = 1; |
| 507 | } |
| 508 | |
| 509 | static char * |
| 510 | getfilenamecxx . . $ getfilename(7a9722d75b371431).(char *str) |
| 511 | { |
| 512 | if (*str == '\"') { |
| 513 | char *buf; |
| 514 | |
| 515 | str++; |
| 516 | buf = ckmalloccxx . . $ ckmalloc(ff224f080444ee45).(strlencxx . . $ strlen(751346f8406fd082).(str)+1); |
| 517 | strcpycxx . . $ strcpy(b7b3a83273496486).(buf, str); |
| 518 | |
| 519 | for (str = buf; *str && *str != '\"'; ++str); |
| 520 | *str = 0; |
| 521 | |
| 522 | return buf; |
| 523 | } |
| 524 | return str; |
| 525 | } |
| 526 | |
| 527 | void |
| 528 | v_includecxx . . $ v_include(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 529 | { |
| 530 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym; |
| 531 | |
| 532 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 533 | |
| 534 | // only eval the string if it's compliant with symbol naming |
| 535 | if ((*str<'0')||(*str>'9')) //check could be more comprehensive |
| 536 | sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 537 | else |
| 538 | sym = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 539 | |
| 540 | if ( (sym) && (sym->flagscxx . . $ _SYMBOL#flags. & SYM_STRINGcxx . . $ `src/asm.h:328:9`! ) ) |
| 541 | { |
| 542 | pushincludecxx . . $ pushinclude(fda57c8427c60377).(sym->stringcxx . . $ _SYMBOL#string.); |
| 543 | } |
| 544 | else |
| 545 | { |
| 546 | char *buf; |
| 547 | buf = getfilenamecxx . . $ getfilename(7a9722d75b371431).(str); |
| 548 | |
| 549 | pushincludecxx . . $ pushinclude(fda57c8427c60377).(buf); |
| 550 | |
| 551 | if (buf != str) |
| 552 | freecxx . . $ free(5d22bdacc48458e8).(buf); |
| 553 | } |
| 554 | |
| 555 | if (sym) |
| 556 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 557 | } |
| 558 | |
| 559 | |
| 560 | void |
| 561 | v_incbincxx . . $ v_incbin(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 562 | { |
| 563 | char *buf; |
| 564 | FILEcxx . . $ FILE# *binfile; |
| 565 | |
| 566 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 567 | buf = getfilenamecxx . . $ getfilename(7a9722d75b371431).(str); |
| 568 | |
| 569 | binfile = pfopencxx . . $ pfopen(82ec0787cd37e0a3).(buf, "rb"); |
| 570 | if (binfile) { |
| 571 | if (Redocxx . . $ Redo.) { |
| 572 | /* optimize: don't actually read the file if not needed */ |
| 573 | fseekcxx . . $ fseek(543fae30d249f6b1).(binfile, 0, SEEK_ENDcxx . . $ `<external>/232824719582829767/stdio.h:112:9`!); |
| 574 | Glencxx . . $ Glen. = ftellcxx . . $ ftell(1dcafcd8ef4c6e6c).(binfile); |
| 575 | generatecxx . . $ generate(49f6e7a06ebc5aa8).(); /* does not access Gen[] if Redo is set */ |
| 576 | } |
| 577 | else |
| 578 | { |
| 579 | for (;;) { |
| 580 | Glencxx . . $ Glen. = freadcxx . . $ fread(738fc8ac1d711e58).(Gencxx . . $ Gen., 1, sizeof(Gencxx . . $ Gen.), binfile); |
| 581 | if (Glencxx . . $ Glen. <= 0) |
| 582 | break; |
| 583 | generatecxx . . $ generate(49f6e7a06ebc5aa8).(); |
| 584 | } |
| 585 | } |
| 586 | fclosecxx . . $ fclose(89bc1efcdac0ca22).(binfile); |
| 587 | } |
| 588 | else |
| 589 | { |
| 590 | printfcxx . . $ printf(581fddd72a8db8fc).("unable to open %s\n", buf); |
| 591 | } |
| 592 | |
| 593 | if (buf != str) |
| 594 | freecxx . . $ free(5d22bdacc48458e8).(buf); |
| 595 | Glencxx . . $ Glen. = 0; /* don't list hexdump */ |
| 596 | } |
| 597 | |
| 598 | |
| 599 | |
| 600 | void |
| 601 | v_segcxx . . $ v_seg(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 602 | { |
| 603 | SEGMENTcxx . . $ `src/asm.h:159:9`! *seg; |
| 604 | |
| 605 | for (seg = Seglistcxx . . $ Seglist.; seg; seg = seg->nextcxx . . $ _SEGMENT#next.) { |
| 606 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str, seg->namecxx . . $ _SEGMENT#name.) == 0) { |
| 607 | Csegmentcxx . . $ Csegment. = seg; |
| 608 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 609 | return; |
| 610 | } |
| 611 | } |
| 612 | Csegmentcxx . . $ Csegment. = seg = (SEGMENTcxx . . $ `src/asm.h:159:9`! *)zmalloccxx . . $ zmalloc(ff224f080444ee45).(sizeof(SEGMENTcxx . . $ `src/asm.h:159:9`!)); |
| 613 | seg->nextcxx . . $ _SEGMENT#next. = Seglistcxx . . $ Seglist.; |
| 614 | seg->namecxx . . $ _SEGMENT#name. = strcpycxx . . $ strcpy(b7b3a83273496486).(ckmalloccxx . . $ ckmalloc(ff224f080444ee45).(strlencxx . . $ strlen(751346f8406fd082).(str)+1), str); |
| 615 | seg->flagscxx . . $ _SEGMENT#flags.= seg->rflagscxx . . $ _SEGMENT#rflags. = seg->initflagscxx . . $ _SEGMENT#initflags. = seg->initrflagscxx . . $ _SEGMENT#initrflags. = SF_UNKNOWNcxx . . $ `src/asm.h:308:9`!; |
| 616 | Seglistcxx . . $ Seglist. = seg; |
| 617 | if (Mnextcxx . . $ Mnext. == AM_BSScxx . . $ AM_BSS.) |
| 618 | seg->flagscxx . . $ _SEGMENT#flags. |= SF_BSScxx . . $ `src/asm.h:310:9`!; |
| 619 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 620 | } |
| 621 | |
| 622 | void |
| 623 | v_hexcxx . . $ v_hex(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 624 | { |
| 625 | int i; |
| 626 | int result; |
| 627 | |
| 628 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 629 | Glencxx . . $ Glen. = 0; |
| 630 | for (i = 0; str[i]; ++i) { |
| 631 | if (str[i] == ' ') |
| 632 | continue; |
| 633 | result = (gethexdigcxx . . $ gethexdig(7864480464b09eea).(str[i]) << 4) + gethexdigcxx . . $ gethexdig(7864480464b09eea).(str[i+1]); |
| 634 | if (str[++i] == 0) |
| 635 | break; |
| 636 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = result; |
| 637 | } |
| 638 | generatecxx . . $ generate(49f6e7a06ebc5aa8).(); |
| 639 | } |
| 640 | |
| 641 | int |
| 642 | gethexdigcxx . . $ gethexdig(7864480464b09eea).(int c) |
| 643 | { |
| 644 | char sBuffer[64]; |
| 645 | |
| 646 | if (c >= '0' && c <= '9') |
| 647 | return c - '0'; |
| 648 | |
| 649 | if (c >= 'a' && c <= 'f') |
| 650 | return c - 'a' + 10; |
| 651 | |
| 652 | if (c >= 'A' && c <= 'F') |
| 653 | return c - 'A' + 10; |
| 654 | |
| 655 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "Bad Hex Digit %c", c ); |
| 656 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_SYNTAX_ERRORcxx . . $ ERROR_SYNTAX_ERROR., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 657 | |
| 658 | putscxx . . $ puts(5c4306d8553b3696).("(Must be a valid hex digit)"); |
| 659 | if (F_listfilecxx . . $ F_listfile.) |
| 660 | fputscxx . . $ fputs(874fa6a5e59ab9bd).("(Must be a valid hex digit)\n", FI_listfilecxx . . $ FI_listfile.); |
| 661 | |
| 662 | return 0; |
| 663 | } |
| 664 | |
| 665 | void |
| 666 | v_errcxx . . $ v_err(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 667 | { |
| 668 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 669 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ERR_PSEUDO_OP_ENCOUNTEREDcxx . . $ ERROR_ERR_PSEUDO_OP_ENCOUNTERED., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ); |
| 670 | exitcxx . . $ exit(3ca292c338df9bb3).(1); |
| 671 | } |
| 672 | |
| 673 | void |
| 674 | v_dccxx . . $ v_dc(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *mne) |
| 675 | { |
| 676 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym; |
| 677 | SYMBOLcxx . . $ `src/asm.h:160:9`! *tmp; |
| 678 | long value; |
| 679 | char *macstr = 0; /* "might be used uninitialised" */ |
| 680 | char vmode = 0; |
| 681 | char sBuffer[128]; /* verbose error messages*/ |
| 682 | |
| 683 | Glencxx . . $ Glen. = 0; |
| 684 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 685 | |
| 686 | |
| 687 | /* for byte, .byte, word, .word, long, .long */ |
| 688 | if (mne->namecxx . . $ _MNE#name.[0] != 'd') { |
| 689 | static char sTmp[4]; |
| 690 | strcpycxx . . $ strcpy(b7b3a83273496486).(sTmp, "x.x"); |
| 691 | sTmp[2] = mne->namecxx . . $ _MNE#name.[0]; |
| 692 | findextcxx . . $ findext(fda57c8427c60377).(sTmp); |
| 693 | } |
| 694 | |
| 695 | /* F8... */ |
| 696 | |
| 697 | /* db, dw, dd */ |
| 698 | if ( (mne->namecxx . . $ _MNE#name.[0] == 'd') && (mne->namecxx . . $ _MNE#name.[1] != 'c') && (mne->namecxx . . $ _MNE#name.[1] != 'v')) { |
| 699 | static char sTmp[4]; |
| 700 | strcpycxx . . $ strcpy(b7b3a83273496486).(sTmp, "x.x"); |
| 701 | if ('d' == mne->namecxx . . $ _MNE#name.[1]) { |
| 702 | sTmp[2] = 'l'; |
| 703 | } else { |
| 704 | sTmp[2] = mne->namecxx . . $ _MNE#name.[1]; |
| 705 | } |
| 706 | findextcxx . . $ findext(fda57c8427c60377).(sTmp); |
| 707 | } |
| 708 | |
| 709 | /* ...F8 */ |
| 710 | |
| 711 | |
| 712 | |
| 713 | if (mne->namecxx . . $ _MNE#name.[1] == 'v') { |
| 714 | int i; |
| 715 | vmode = 1; |
| 716 | for (i = 0; str[i] && str[i] != ' '; ++i); |
| 717 | tmp = findsymbolcxx . . $ findsymbol(83a8820e5b78665b).(str, i); |
| 718 | str += i; |
| 719 | if (tmp == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 720 | putscxx . . $ puts(5c4306d8553b3696).("EQM label not found"); |
| 721 | return; |
| 722 | } |
| 723 | if (tmp->flagscxx . . $ _SYMBOL#flags. & SYM_MACROcxx . . $ `src/asm.h:330:9`!) { |
| 724 | macstr = (void *)tmp->stringcxx . . $ _SYMBOL#string.; |
| 725 | } |
| 726 | else |
| 727 | { |
| 728 | putscxx . . $ puts(5c4306d8553b3696).("must specify EQM label for DV"); |
| 729 | return; |
| 730 | } |
| 731 | } |
| 732 | sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 733 | for (; sym; sym = sym->nextcxx . . $ _SYMBOL#next.) { |
| 734 | value = sym->valuecxx . . $ _SYMBOL#value.; |
| 735 | if (sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) { |
| 736 | ++Redocxx . . $ Redo.; |
| 737 | Redo_whycxx . . $ Redo_why. |= REASON_DC_NOT_RESOVEDcxx . . $ REASON_DC_NOT_RESOVED.; |
| 738 | } |
| 739 | if (sym->flagscxx . . $ _SYMBOL#flags. & SYM_STRINGcxx . . $ `src/asm.h:328:9`!) { |
| 740 | unsigned char *ptr = (void *)sym->stringcxx . . $ _SYMBOL#string.; |
| 741 | while ((value = *ptr) != 0) { |
| 742 | if (vmode) { |
| 743 | setspecialcxx . . $ setspecial(3e454b8ccf442868).(value, 0); |
| 744 | tmp = evalcxx . . $ eval(83a8820e5b78665b).(macstr, 0); |
| 745 | value = tmp->valuecxx . . $ _SYMBOL#value.; |
| 746 | if (tmp->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) { |
| 747 | ++Redocxx . . $ Redo.; |
| 748 | Redo_whycxx . . $ Redo_why. |= REASON_DV_NOT_RESOLVED_PROBABLYcxx . . $ REASON_DV_NOT_RESOLVED_PROBABLY.; |
| 749 | } |
| 750 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(tmp); |
| 751 | } |
| 752 | switch(Mnextcxx . . $ Mnext.) { |
| 753 | default: |
| 754 | case AM_BYTEcxx . . $ `src/asm.h:226:9`!: |
| 755 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 756 | break; |
| 757 | case AM_WORDcxx . . $ `src/asm.h:227:9`!: |
| 758 | if (MsbOrdercxx . . $ MsbOrder.) { |
| 759 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 760 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 761 | } |
| 762 | else |
| 763 | { |
| 764 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 765 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 766 | } |
| 767 | break; |
| 768 | case AM_OTHER_ENDIANcxx . . $ AM_OTHER_ENDIAN.: |
| 769 | if (MsbOrdercxx . . $ MsbOrder. == 0) { |
| 770 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 771 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 772 | } |
| 773 | else |
| 774 | { |
| 775 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 776 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 777 | } |
| 778 | break; |
| 779 | case AM_LONGcxx . . $ AM_LONG.: |
| 780 | if (MsbOrdercxx . . $ MsbOrder.) { |
| 781 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 24)& 0xFF; |
| 782 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 16)& 0xFF; |
| 783 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 784 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 785 | } |
| 786 | else |
| 787 | { |
| 788 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 789 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 790 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 16)& 0xFF; |
| 791 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 24)& 0xFF; |
| 792 | } |
| 793 | break; |
| 794 | } |
| 795 | ++ptr; |
| 796 | } |
| 797 | } |
| 798 | else |
| 799 | { |
| 800 | if (vmode) { |
| 801 | setspecialcxx . . $ setspecial(3e454b8ccf442868).(value, sym->flagscxx . . $ _SYMBOL#flags.); |
| 802 | tmp = evalcxx . . $ eval(83a8820e5b78665b).(macstr, 0); |
| 803 | value = tmp->valuecxx . . $ _SYMBOL#value.; |
| 804 | if (tmp->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) { |
| 805 | ++Redocxx . . $ Redo.; |
| 806 | Redo_whycxx . . $ Redo_why. |= REASON_DV_NOT_RESOLVED_COULDcxx . . $ REASON_DV_NOT_RESOLVED_COULD.; |
| 807 | } |
| 808 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(tmp); |
| 809 | } |
| 810 | switch(Mnextcxx . . $ Mnext.) { |
| 811 | default: |
| 812 | case AM_BYTEcxx . . $ `src/asm.h:226:9`!: |
| 813 | //any value outside two's complement +ve and +ve byte representation is invalid... |
| 814 | if ((value < -0xFF)||(value > 0xFF)) |
| 815 | { |
| 816 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "byte %s %ld", mne->namecxx . . $ _MNE#name., value); |
| 817 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ADDRESS_MUST_BE_LT_100cxx . . $ ERROR_ADDRESS_MUST_BE_LT_100., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 818 | } |
| 819 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 820 | break; |
| 821 | case AM_WORDcxx . . $ `src/asm.h:227:9`!: |
| 822 | //any value outside two's complement +ve and +ve word representation is invalid... |
| 823 | if ( (bStrictModecxx . . $ bStrictMode.) && ((value < -0xFFFF)||(value > 0xFFFF)) ) |
| 824 | { |
| 825 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "word %s %ld", mne->namecxx . . $ _MNE#name., value); |
| 826 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ADDRESS_MUST_BE_LT_10000cxx . . $ ERROR_ADDRESS_MUST_BE_LT_10000., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 827 | } |
| 828 | |
| 829 | if (MsbOrdercxx . . $ MsbOrder.) { |
| 830 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 831 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 832 | } |
| 833 | else |
| 834 | { |
| 835 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 836 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 837 | } |
| 838 | break; |
| 839 | case AM_OTHER_ENDIANcxx . . $ AM_OTHER_ENDIAN.: |
| 840 | if ( (bStrictModecxx . . $ bStrictMode.) && ((value < -0xFFFF)||(value > 0xFFFF)) ) { |
| 841 | sprintfcxx . . $ sprintf(26c8642d26409d6d).( sBuffer, "swapped %s %ld", mne->namecxx . . $ _MNE#name., value); |
| 842 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ADDRESS_MUST_BE_LT_10000cxx . . $ ERROR_ADDRESS_MUST_BE_LT_10000., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, sBuffer ); |
| 843 | } |
| 844 | if (MsbOrdercxx . . $ MsbOrder. == 0) { |
| 845 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 846 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 847 | } |
| 848 | else |
| 849 | { |
| 850 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 851 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 852 | } |
| 853 | break; |
| 854 | case AM_LONGcxx . . $ AM_LONG.: |
| 855 | if (MsbOrdercxx . . $ MsbOrder.) { |
| 856 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 24)& 0xFF; |
| 857 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 16)& 0xFF; |
| 858 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 859 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 860 | } |
| 861 | else |
| 862 | { |
| 863 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = value & 0xFF; |
| 864 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 8) & 0xFF; |
| 865 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 16)& 0xFF; |
| 866 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = (value >> 24)& 0xFF; |
| 867 | } |
| 868 | break; |
| 869 | } |
| 870 | } |
| 871 | } |
| 872 | generatecxx . . $ generate(49f6e7a06ebc5aa8).(); |
| 873 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 874 | } |
| 875 | |
| 876 | |
| 877 | |
| 878 | void |
| 879 | v_dscxx . . $ v_ds(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 880 | { |
| 881 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym; |
| 882 | int mult = 1; |
| 883 | long filler = 0; |
| 884 | |
| 885 | if (Mnextcxx . . $ Mnext. == AM_WORDcxx . . $ `src/asm.h:227:9`!) |
| 886 | mult = 2; |
| 887 | if (Mnextcxx . . $ Mnext. == AM_LONGcxx . . $ AM_LONG.) |
| 888 | mult = 4; |
| 889 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 890 | if ((sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 891 | if (sym->nextcxx . . $ _SYMBOL#next.) |
| 892 | filler = sym->nextcxx . . $ _SYMBOL#next.->valuecxx . . $ _SYMBOL#value.; |
| 893 | if (sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) { |
| 894 | ++Redocxx . . $ Redo.; |
| 895 | Redo_whycxx . . $ Redo_why. |= REASON_DS_NOT_RESOLVEDcxx . . $ REASON_DS_NOT_RESOLVED.; |
| 896 | } |
| 897 | else |
| 898 | { |
| 899 | if (sym->nextcxx . . $ _SYMBOL#next. && sym->nextcxx . . $ _SYMBOL#next.->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) { |
| 900 | ++Redocxx . . $ Redo.; |
| 901 | Redo_whycxx . . $ Redo_why. |= REASON_DS_NOT_RESOLVEDcxx . . $ REASON_DS_NOT_RESOLVED.; |
| 902 | } |
| 903 | genfillcxx . . $ genfill(86ac8c965b1a1974).(filler, sym->valuecxx . . $ _SYMBOL#value., mult); |
| 904 | } |
| 905 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 906 | } |
| 907 | } |
| 908 | |
| 909 | void |
| 910 | v_orgcxx . . $ v_org(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 911 | { |
| 912 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym; |
| 913 | |
| 914 | sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 915 | Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org. = sym->valuecxx . . $ _SYMBOL#value.; |
| 916 | |
| 917 | if (sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) |
| 918 | Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. |= SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!; |
| 919 | else |
| 920 | Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. &= ~SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!; |
| 921 | |
| 922 | if (Csegmentcxx . . $ Csegment.->initflagscxx . . $ _SEGMENT#initflags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) |
| 923 | { |
| 924 | Csegmentcxx . . $ Csegment.->initorgcxx . . $ _SEGMENT#initorg. = sym->valuecxx . . $ _SYMBOL#value.; |
| 925 | Csegmentcxx . . $ Csegment.->initflagscxx . . $ _SEGMENT#initflags. = sym->flagscxx . . $ _SYMBOL#flags.; |
| 926 | } |
| 927 | |
| 928 | if (sym->nextcxx . . $ _SYMBOL#next.) |
| 929 | { |
| 930 | OrgFillcxx . . $ OrgFill. = sym->nextcxx . . $ _SYMBOL#next.->valuecxx . . $ _SYMBOL#value.; |
| 931 | if (sym->nextcxx . . $ _SYMBOL#next.->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) |
| 932 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_VALUE_UNDEFINEDcxx . . $ ERROR_VALUE_UNDEFINED., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ); |
| 933 | } |
| 934 | |
| 935 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 936 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 937 | } |
| 938 | |
| 939 | void |
| 940 | v_rorgcxx . . $ v_rorg(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 941 | { |
| 942 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 943 | |
| 944 | Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. |= SF_RORGcxx . . $ `src/asm.h:311:9`!; |
| 945 | if (sym->addrmodecxx . . $ _SYMBOL#addrmode. != AM_IMPcxx . . $ AM_IMP.) { |
| 946 | Csegmentcxx . . $ Csegment.->rorgcxx . . $ _SEGMENT#rorg. = sym->valuecxx . . $ _SYMBOL#value.; |
| 947 | if (sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) |
| 948 | Csegmentcxx . . $ Csegment.->rflagscxx . . $ _SEGMENT#rflags. |= SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!; |
| 949 | else |
| 950 | Csegmentcxx . . $ Csegment.->rflagscxx . . $ _SEGMENT#rflags. &= ~SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!; |
| 951 | if (Csegmentcxx . . $ Csegment.->initrflagscxx . . $ _SEGMENT#initrflags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) { |
| 952 | Csegmentcxx . . $ Csegment.->initrorgcxx . . $ _SEGMENT#initrorg. = sym->valuecxx . . $ _SYMBOL#value.; |
| 953 | Csegmentcxx . . $ Csegment.->initrflagscxx . . $ _SEGMENT#initrflags. = sym->flagscxx . . $ _SYMBOL#flags.; |
| 954 | } |
| 955 | } |
| 956 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 957 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 958 | } |
| 959 | |
| 960 | void |
| 961 | v_rendcxx . . $ v_rend(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 962 | { |
| 963 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 964 | Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. &= ~SF_RORGcxx . . $ `src/asm.h:311:9`!; |
| 965 | } |
| 966 | |
| 967 | void |
| 968 | v_aligncxx . . $ v_align(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 969 | { |
| 970 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 971 | unsigned char fill = 0; |
| 972 | unsigned char rorg = Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. & SF_RORGcxx . . $ `src/asm.h:311:9`!; |
| 973 | |
| 974 | if (rorg) |
| 975 | Csegmentcxx . . $ Csegment.->rflagscxx . . $ _SEGMENT#rflags. |= SF_REFcxx . . $ `src/asm.h:309:9`!; |
| 976 | else |
| 977 | Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. |= SF_REFcxx . . $ `src/asm.h:309:9`!; |
| 978 | if (sym->nextcxx . . $ _SYMBOL#next.) { |
| 979 | if (sym->nextcxx . . $ _SYMBOL#next.->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) { |
| 980 | ++Redocxx . . $ Redo.; |
| 981 | Redo_whycxx . . $ Redo_why. |= REASON_ALIGN_NOT_RESOLVEDcxx . . $ REASON_ALIGN_NOT_RESOLVED.; |
| 982 | } |
| 983 | else |
| 984 | { |
| 985 | fill = sym->nextcxx . . $ _SYMBOL#next.->valuecxx . . $ _SYMBOL#value.; |
| 986 | } |
| 987 | } |
| 988 | if (rorg) { |
| 989 | if ((Csegmentcxx . . $ Csegment.->rflagscxx . . $ _SEGMENT#rflags. | sym->flagscxx . . $ _SYMBOL#flags.) & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) { |
| 990 | ++Redocxx . . $ Redo.; |
| 991 | Redo_whycxx . . $ Redo_why. |= REASON_ALIGN_RELOCATABLE_ORIGIN_NOT_KNOWNcxx . . $ REASON_ALIGN_RELOCATABLE_ORIGIN_NOT_KNOWN.; |
| 992 | } |
| 993 | else |
| 994 | { |
| 995 | long n = sym->valuecxx . . $ _SYMBOL#value. - (Csegmentcxx . . $ Csegment.->rorgcxx . . $ _SEGMENT#rorg. % sym->valuecxx . . $ _SYMBOL#value.); |
| 996 | if (n != sym->valuecxx . . $ _SYMBOL#value.) |
| 997 | genfillcxx . . $ genfill(86ac8c965b1a1974).(fill, n, 1); |
| 998 | } |
| 999 | } |
| 1000 | else |
| 1001 | { |
| 1002 | if ((Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. | sym->flagscxx . . $ _SYMBOL#flags.) & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) { |
| 1003 | ++Redocxx . . $ Redo.; |
| 1004 | Redo_whycxx . . $ Redo_why. |= REASON_ALIGN_NORMAL_ORIGIN_NOT_KNOWNcxx . . $ REASON_ALIGN_NORMAL_ORIGIN_NOT_KNOWN.; |
| 1005 | } |
| 1006 | else |
| 1007 | { |
| 1008 | long n = sym->valuecxx . . $ _SYMBOL#value. - (Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org. % sym->valuecxx . . $ _SYMBOL#value.); |
| 1009 | if (n != sym->valuecxx . . $ _SYMBOL#value.) |
| 1010 | genfillcxx . . $ genfill(86ac8c965b1a1974).(fill, n, 1); |
| 1011 | } |
| 1012 | } |
| 1013 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 1014 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 1015 | } |
| 1016 | |
| 1017 | void |
| 1018 | v_subroutinecxx . . $ v_subroutine(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1019 | { |
| 1020 | ++Lastlocalindexcxx . . $ Lastlocalindex.; |
| 1021 | Localindexcxx . . $ Localindex. = Lastlocalindexcxx . . $ Lastlocalindex.; |
| 1022 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 1023 | } |
| 1024 | |
| 1025 | void |
| 1026 | v_equcxx . . $ v_equ(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1027 | { |
| 1028 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 1029 | SYMBOLcxx . . $ `src/asm.h:160:9`! *lab; |
| 1030 | |
| 1031 | |
| 1032 | /* |
| 1033 | * If we encounter a line of the form |
| 1034 | * . = expr ; or . EQU expr |
| 1035 | * treat it as one of |
| 1036 | * org expr |
| 1037 | * rorg expr |
| 1038 | * depending on whether we have a relocatable origin now or not. |
| 1039 | */ |
| 1040 | if (strlencxx . . $ strlen(751346f8406fd082).(Avcxx . . $ Av.[0]) == 1 && (Avcxx . . $ Av.[0][0] == '.' |
| 1041 | || (Avcxx . . $ Av.[0][0] == '*' && (Avcxx . . $ Av.[0][0] = '.') && 1) /*AD: huh?*/ |
| 1042 | )) { |
| 1043 | /* Av[0][0] = '\0'; */ |
| 1044 | if (Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. & SF_RORGcxx . . $ `src/asm.h:311:9`!) |
| 1045 | { |
| 1046 | v_rorgcxx . . $ v_rorg(b7f07ba78920e729).(str, dummy); |
| 1047 | } |
| 1048 | else |
| 1049 | { |
| 1050 | v_orgcxx . . $ v_org(b7f07ba78920e729).(str, dummy); |
| 1051 | } |
| 1052 | return; |
| 1053 | } |
| 1054 | |
| 1055 | |
| 1056 | lab = findsymbolcxx . . $ findsymbol(83a8820e5b78665b).(Avcxx . . $ Av.[0], strlencxx . . $ strlen(751346f8406fd082).(Avcxx . . $ Av.[0])); |
| 1057 | if (!lab) |
| 1058 | lab = CreateSymbolcxx . . $ CreateSymbol(83a8820e5b78665b).( Avcxx . . $ Av.[0], strlencxx . . $ strlen(751346f8406fd082).(Avcxx . . $ Av.[0]) ); |
| 1059 | if (!(lab->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!)) |
| 1060 | { |
| 1061 | if (sym->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) |
| 1062 | { |
| 1063 | ++Redocxx . . $ Redo.; |
| 1064 | Redo_whycxx . . $ Redo_why. |= REASON_EQU_NOT_RESOLVEDcxx . . $ REASON_EQU_NOT_RESOLVED.; |
| 1065 | } |
| 1066 | else |
| 1067 | { |
| 1068 | if (lab->valuecxx . . $ _SYMBOL#value. != sym->valuecxx . . $ _SYMBOL#value.) |
| 1069 | { |
| 1070 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_EQU_VALUE_MISMATCHcxx . . $ ERROR_EQU_VALUE_MISMATCH., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ); |
| 1071 | printfcxx . . $ printf(581fddd72a8db8fc).("INFO: Label '%s' changed from $%04lx to $%04lx\n", |
| 1072 | Avcxx . . $ Av.[0], lab->valuecxx . . $ _SYMBOL#value., sym->valuecxx . . $ _SYMBOL#value.); |
| 1073 | ++Redocxx . . $ Redo.; |
| 1074 | Redo_whycxx . . $ Redo_why. |= REASON_EQU_VALUE_MISMATCHcxx . . $ REASON_EQU_VALUE_MISMATCH.; |
| 1075 | } |
| 1076 | } |
| 1077 | } |
| 1078 | |
| 1079 | lab->valuecxx . . $ _SYMBOL#value. = sym->valuecxx . . $ _SYMBOL#value.; |
| 1080 | lab->flagscxx . . $ _SYMBOL#flags. = sym->flagscxx . . $ _SYMBOL#flags. & (SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!|SYM_STRINGcxx . . $ `src/asm.h:328:9`!); |
| 1081 | lab->stringcxx . . $ _SYMBOL#string. = sym->stringcxx . . $ _SYMBOL#string.; |
| 1082 | sym->flagscxx . . $ _SYMBOL#flags. &= ~(SYM_STRINGcxx . . $ `src/asm.h:328:9`!|SYM_MACROcxx . . $ `src/asm.h:330:9`!); |
| 1083 | |
| 1084 | /* List the value */ |
| 1085 | { |
| 1086 | unsigned long v = lab->valuecxx . . $ _SYMBOL#value.; |
| 1087 | |
| 1088 | Glencxx . . $ Glen. = 0; |
| 1089 | if (v > 0x0000FFFF) |
| 1090 | { |
| 1091 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = v >> 24; |
| 1092 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = v >> 16; |
| 1093 | } |
| 1094 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = v >> 8; |
| 1095 | Gencxx . . $ Gen.[Glencxx . . $ Glen.++] = v; |
| 1096 | } |
| 1097 | |
| 1098 | |
| 1099 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 1100 | } |
| 1101 | |
| 1102 | void |
| 1103 | v_eqmcxx . . $ v_eqm(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1104 | { |
| 1105 | SYMBOLcxx . . $ `src/asm.h:160:9`! *lab; |
| 1106 | int len = strlencxx . . $ strlen(751346f8406fd082).(Avcxx . . $ Av.[0]); |
| 1107 | |
| 1108 | if ((lab = findsymbolcxx . . $ findsymbol(83a8820e5b78665b).(Avcxx . . $ Av.[0], len)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1109 | if (lab->flagscxx . . $ _SYMBOL#flags. & SYM_STRINGcxx . . $ `src/asm.h:328:9`!) |
| 1110 | freecxx . . $ free(5d22bdacc48458e8).(lab->stringcxx . . $ _SYMBOL#string.); |
| 1111 | } |
| 1112 | else |
| 1113 | { |
| 1114 | lab = CreateSymbolcxx . . $ CreateSymbol(83a8820e5b78665b).( Avcxx . . $ Av.[0], len ); |
| 1115 | } |
| 1116 | lab->valuecxx . . $ _SYMBOL#value. = 0; |
| 1117 | lab->flagscxx . . $ _SYMBOL#flags. = SYM_STRINGcxx . . $ `src/asm.h:328:9`! | SYM_SETcxx . . $ `src/asm.h:329:9`! | SYM_MACROcxx . . $ `src/asm.h:330:9`!; |
| 1118 | lab->stringcxx . . $ _SYMBOL#string. = strcpycxx . . $ strcpy(b7b3a83273496486).(ckmalloccxx . . $ ckmalloc(ff224f080444ee45).(strlencxx . . $ strlen(751346f8406fd082).(str)+1), str); |
| 1119 | } |
| 1120 | |
| 1121 | void |
| 1122 | v_echocxx . . $ v_echo(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1123 | { |
| 1124 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 1125 | SYMBOLcxx . . $ `src/asm.h:160:9`! *s; |
| 1126 | char buf[256]; |
| 1127 | |
| 1128 | for (s = sym; s; s = s->nextcxx . . $ _SYMBOL#next.) { |
| 1129 | if (!(s->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!)) { |
| 1130 | if (s->flagscxx . . $ _SYMBOL#flags. & (SYM_MACROcxx . . $ `src/asm.h:330:9`!|SYM_STRINGcxx . . $ `src/asm.h:328:9`!)) |
| 1131 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(buf,"%s", s->stringcxx . . $ _SYMBOL#string.); |
| 1132 | else |
| 1133 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(buf,"$%lx", s->valuecxx . . $ _SYMBOL#value.); |
| 1134 | if (FI_listfilecxx . . $ FI_listfile.) |
| 1135 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(FI_listfilecxx . . $ FI_listfile., " %s", buf); |
| 1136 | //printf(" %s", buf); |
| 1137 | addmsgcxx . . $ addmsg(fda57c8427c60377).(" "); // -FXQ supress output until final pass |
| 1138 | addmsgcxx . . $ addmsg(fda57c8427c60377).(buf); |
| 1139 | } |
| 1140 | } |
| 1141 | //puts(""); |
| 1142 | addmsgcxx . . $ addmsg(fda57c8427c60377).("\n"); |
| 1143 | if (FI_listfilecxx . . $ FI_listfile.) |
| 1144 | putccxx . . $ putc(b1cd03d6c470d1bd).('\n', FI_listfilecxx . . $ FI_listfile.); |
| 1145 | } |
| 1146 | |
| 1147 | void v_setcxx . . $ v_set(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1148 | { |
| 1149 | |
| 1150 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym, *lab; |
| 1151 | char dynamicname[257]; |
| 1152 | int i = 0,j; |
| 1153 | int setundefined = 0; |
| 1154 | |
| 1155 | while (str[i] && str[i] != '"' && str[i] != ' ' && str[i] != ',' ) |
| 1156 | i++; |
| 1157 | |
| 1158 | if(str[i] && str[i] == ',') // is this SET is using the "," eval-concat operator? |
| 1159 | { |
| 1160 | strncpycxx . . $ strncpy(255158a415b673b0).(dynamicname, str,256); |
| 1161 | if(i<256) |
| 1162 | dynamicname[i]=0; |
| 1163 | dynamicname[256]=0; |
| 1164 | j=strlencxx . . $ strlen(751346f8406fd082).(dynamicname); |
| 1165 | |
| 1166 | // eval-concat argument processing loop... |
| 1167 | while (str[i] && str[i] != '"' && str[i] != ' ') |
| 1168 | { |
| 1169 | if( str[i] == 0 || str[i] == ' ' ) // leave if we've processed all arguments |
| 1170 | { |
| 1171 | break; |
| 1172 | } |
| 1173 | if(str[i+1]=='"') // is this a string constant? |
| 1174 | { |
| 1175 | i=i+2; // advance to string contents |
| 1176 | while (str[i] && str[i] != '"' && str[i] != ' ' && str[i] != ',') |
| 1177 | { |
| 1178 | dynamicname[j++]=str[i++]; |
| 1179 | } |
| 1180 | if (str[i] && str[i]=='"') |
| 1181 | { |
| 1182 | dynamicname[j]=0; |
| 1183 | i++; |
| 1184 | continue; |
| 1185 | } |
| 1186 | else |
| 1187 | { |
| 1188 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_SYNTAX_ERRORcxx . . $ ERROR_SYNTAX_ERROR., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, str); |
| 1189 | continue; |
| 1190 | } |
| 1191 | } // argument was string constant |
| 1192 | else // this argument is a symbol to be evaluated |
| 1193 | { |
| 1194 | int t; |
| 1195 | char tempbuf[257]; |
| 1196 | char tempval[257]; |
| 1197 | SYMBOLcxx . . $ `src/asm.h:160:9`! *symarg; |
| 1198 | strncpycxx . . $ strncpy(255158a415b673b0).(tempbuf,str+i+1,256); |
| 1199 | tempbuf[256]=0; |
| 1200 | for(t=0;t<strlencxx . . $ strlen(751346f8406fd082).(tempbuf);t++) |
| 1201 | { |
| 1202 | if(tempbuf[t] == ',') |
| 1203 | tempbuf[t]=0; |
| 1204 | } |
| 1205 | symarg = evalcxx . . $ eval(83a8820e5b78665b).(tempbuf,0); |
| 1206 | if(symarg) |
| 1207 | { |
| 1208 | if (symarg->flagscxx . . $ _SYMBOL#flags. & SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!) // one of the arguments isn't defined yet |
| 1209 | setundefined++; // ensure the set doesn't actually happen |
| 1210 | else |
| 1211 | { |
| 1212 | snprintfcxx . . $ snprintf(ea502d73e74c754c).(tempval,256,"%d",(unsigned)symarg->valuecxx . . $ _SYMBOL#value.); |
| 1213 | strcpycxx . . $ strcpy(b7b3a83273496486).(dynamicname+j,tempval); |
| 1214 | j=j+strlencxx . . $ strlen(751346f8406fd082).(tempval); |
| 1215 | } |
| 1216 | } |
| 1217 | i++; |
| 1218 | while (str[i] && str[i] != ' ' && str[i] != ',') |
| 1219 | i++; |
| 1220 | } // argument was symbol |
| 1221 | |
| 1222 | continue; // process any remaining arguments |
| 1223 | } |
| 1224 | dynamicname[i++] = 0; |
| 1225 | if (setundefined) // not all of the arguments are defined yet, so skip this SET |
| 1226 | { |
| 1227 | return; |
| 1228 | } |
| 1229 | sym = evalcxx . . $ eval(83a8820e5b78665b).(dynamicname,0); |
| 1230 | } |
| 1231 | else // traditional SET behavior |
| 1232 | sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 1233 | |
| 1234 | lab = findsymbolcxx . . $ findsymbol(83a8820e5b78665b).(Avcxx . . $ Av.[0], strlencxx . . $ strlen(751346f8406fd082).(Avcxx . . $ Av.[0])); |
| 1235 | if (!lab) |
| 1236 | lab = CreateSymbolcxx . . $ CreateSymbol(83a8820e5b78665b).( Avcxx . . $ Av.[0], strlencxx . . $ strlen(751346f8406fd082).(Avcxx . . $ Av.[0]) ); |
| 1237 | lab->valuecxx . . $ _SYMBOL#value. = sym->valuecxx . . $ _SYMBOL#value.; |
| 1238 | lab->flagscxx . . $ _SYMBOL#flags. = sym->flagscxx . . $ _SYMBOL#flags. & (SYM_UNKNOWNcxx . . $ `src/asm.h:326:9`!|SYM_STRINGcxx . . $ `src/asm.h:328:9`!); |
| 1239 | lab->stringcxx . . $ _SYMBOL#string. = sym->stringcxx . . $ _SYMBOL#string.; |
| 1240 | sym->flagscxx . . $ _SYMBOL#flags. &= ~(SYM_STRINGcxx . . $ `src/asm.h:328:9`!|SYM_MACROcxx . . $ `src/asm.h:330:9`!); |
| 1241 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 1242 | } |
| 1243 | |
| 1244 | void v_setstrcxx . . $ v_setstr(b7f07ba78920e729).(char *symstr, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1245 | { |
| 1246 | char str[1024]; |
| 1247 | snprintfcxx . . $ snprintf(ea502d73e74c754c).(str,1024,"\"%s\"",symstr); |
| 1248 | v_setcxx . . $ v_set(b7f07ba78920e729).(str,dummy); |
| 1249 | } |
| 1250 | |
| 1251 | void |
| 1252 | v_execmaccxx . . $ v_execmac(f68f5bbf1ad34a70).(char *str, MACROcxx . . $ `src/asm.h:155:9`! *mac) |
| 1253 | { |
| 1254 | INCFILEcxx . . $ `src/asm.h:156:9`! *inc; |
| 1255 | STRLISTcxx . . $ `src/asm.h:161:9`! *base; |
| 1256 | STRLISTcxx . . $ `src/asm.h:161:9`! **psl, *sl; |
| 1257 | char *s1; |
| 1258 | |
| 1259 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 1260 | |
| 1261 | if (Mlevelcxx . . $ Mlevel. == MAXMACLEVELcxx . . $ `src/asm.h:170:9`!) { |
| 1262 | char errMsg[256]; |
| 1263 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(errMsg, " macro [%s] recursion > %d", mac->namecxx . . $ _MACRO#name., MAXMACLEVELcxx . . $ `src/asm.h:170:9`!); |
| 1264 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_RECURSION_TOO_DEEPcxx . . $ ERROR_RECURSION_TOO_DEEP., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, errMsg ); |
| 1265 | return; |
| 1266 | } |
| 1267 | ++Mlevelcxx . . $ Mlevel.; |
| 1268 | base = (STRLISTcxx . . $ `src/asm.h:161:9`! *)ckmalloccxx . . $ ckmalloc(ff224f080444ee45).(STRLISTSIZEcxx . . $ `src/asm.h:236:9`!+strlencxx . . $ strlen(751346f8406fd082).(str)+1); |
| 1269 | base->nextcxx . . $ _STRLIST#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1270 | strcpycxx . . $ strcpy(b7b3a83273496486).(base->bufcxx . . $ _STRLIST#buf., str); |
| 1271 | psl = &base->nextcxx . . $ _STRLIST#next.; |
| 1272 | while (*str && *str != '\n') { |
| 1273 | s1 = str; |
| 1274 | while (*str && *str != '\n' && *str != ',') |
| 1275 | ++str; |
| 1276 | sl = (STRLISTcxx . . $ `src/asm.h:161:9`! *)ckmalloccxx . . $ ckmalloc(ff224f080444ee45).(STRLISTSIZEcxx . . $ `src/asm.h:236:9`!+1+(str-s1)); |
| 1277 | sl->nextcxx . . $ _STRLIST#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1278 | *psl = sl; |
| 1279 | psl = &sl->nextcxx . . $ _STRLIST#next.; |
| 1280 | memcpycxx . . $ memcpy(cc817cb175f282d).(sl->bufcxx . . $ _STRLIST#buf., s1, (str-s1)); |
| 1281 | sl->bufcxx . . $ _STRLIST#buf.[str-s1] = 0; |
| 1282 | if (*str == ',') |
| 1283 | ++str; |
| 1284 | while (*str == ' ') |
| 1285 | ++str; |
| 1286 | } |
| 1287 | |
| 1288 | inc = (INCFILEcxx . . $ `src/asm.h:156:9`! *)zmalloccxx . . $ zmalloc(ff224f080444ee45).(sizeof(INCFILEcxx . . $ `src/asm.h:156:9`!)); |
| 1289 | inc->nextcxx . . $ _INCFILE#next. = pIncfilecxx . . $ pIncfile.; |
| 1290 | inc->namecxx . . $ _INCFILE#name. = mac->namecxx . . $ _MACRO#name.; |
| 1291 | inc->ficxx . . $ _INCFILE#fi. = pIncfilecxx . . $ pIncfile.->ficxx . . $ _INCFILE#fi.; /* garbage */ |
| 1292 | inc->linenocxx . . $ _INCFILE#lineno. = 0; |
| 1293 | inc->flagscxx . . $ _INCFILE#flags. = INF_MACROcxx . . $ `src/asm.h:267:9`!; |
| 1294 | inc->saveidxcxx . . $ _INCFILE#saveidx. = Localindexcxx . . $ Localindex.; |
| 1295 | |
| 1296 | inc->savedolidxcxx . . $ _INCFILE#savedolidx. = Localdollarindexcxx . . $ Localdollarindex.; |
| 1297 | |
| 1298 | inc->strlistcxx . . $ _INCFILE#strlist. = mac->strlistcxx . . $ _MACRO#strlist.; |
| 1299 | inc->argscxx . . $ _INCFILE#args. = base; |
| 1300 | pIncfilecxx . . $ pIncfile. = inc; |
| 1301 | |
| 1302 | ++Lastlocalindexcxx . . $ Lastlocalindex.; |
| 1303 | Localindexcxx . . $ Localindex. = Lastlocalindexcxx . . $ Lastlocalindex.; |
| 1304 | |
| 1305 | ++Lastlocaldollarindexcxx . . $ Lastlocaldollarindex.; |
| 1306 | Localdollarindexcxx . . $ Localdollarindex. = Lastlocaldollarindexcxx . . $ Lastlocaldollarindex.; |
| 1307 | |
| 1308 | } |
| 1309 | |
| 1310 | void v_endcxx . . $ v_end(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1311 | { |
| 1312 | /* Only ENDs current file and any macro calls within it */ |
| 1313 | |
| 1314 | while ( pIncfilecxx . . $ pIncfile.->flagscxx . . $ _INCFILE#flags. & INF_MACROcxx . . $ `src/asm.h:267:9`!) |
| 1315 | v_endmcxx . . $ v_endm(b7f07ba78920e729).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1316 | |
| 1317 | fseekcxx . . $ fseek(543fae30d249f6b1).( pIncfilecxx . . $ pIncfile.->ficxx . . $ _INCFILE#fi., 0, SEEK_ENDcxx . . $ `<external>/232824719582829767/stdio.h:112:9`!); |
| 1318 | } |
| 1319 | |
| 1320 | void |
| 1321 | v_endmcxx . . $ v_endm(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1322 | { |
| 1323 | INCFILEcxx . . $ `src/asm.h:156:9`! *inc = pIncfilecxx . . $ pIncfile.; |
| 1324 | STRLISTcxx . . $ `src/asm.h:161:9`! *args, *an; |
| 1325 | |
| 1326 | /* programlabel(); contrary to documentation */ |
| 1327 | if (inc->flagscxx . . $ _INCFILE#flags. & INF_MACROcxx . . $ `src/asm.h:267:9`!) { |
| 1328 | --Mlevelcxx . . $ Mlevel.; |
| 1329 | for (args = inc->argscxx . . $ _INCFILE#args.; args; args = an) { |
| 1330 | an = args->nextcxx . . $ _STRLIST#next.; |
| 1331 | freecxx . . $ free(5d22bdacc48458e8).(args); |
| 1332 | } |
| 1333 | Localindexcxx . . $ Localindex. = inc->saveidxcxx . . $ _INCFILE#saveidx.; |
| 1334 | |
| 1335 | Localdollarindexcxx . . $ Localdollarindex. = inc->savedolidxcxx . . $ _INCFILE#savedolidx.; |
| 1336 | |
| 1337 | pIncfilecxx . . $ pIncfile. = inc->nextcxx . . $ _INCFILE#next.; |
| 1338 | freecxx . . $ free(5d22bdacc48458e8).(inc); |
| 1339 | return; |
| 1340 | } |
| 1341 | putscxx . . $ puts(5c4306d8553b3696).("not within a macro"); |
| 1342 | } |
| 1343 | |
| 1344 | void |
| 1345 | v_mexitcxx . . $ v_mexit(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1346 | { |
| 1347 | v_endmcxx . . $ v_endm(b7f07ba78920e729).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1348 | } |
| 1349 | |
| 1350 | void |
| 1351 | v_ifconstcxx . . $ v_ifconst(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1352 | { |
| 1353 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym; |
| 1354 | |
| 1355 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 1356 | sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 1357 | pushifcxx . . $ pushif(b45ddcbc8423892c).(sym->flagscxx . . $ _SYMBOL#flags. == 0); |
| 1358 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 1359 | } |
| 1360 | |
| 1361 | void |
| 1362 | v_ifnconstcxx . . $ v_ifnconst(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1363 | { |
| 1364 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym; |
| 1365 | |
| 1366 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 1367 | sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 1368 | pushifcxx . . $ pushif(b45ddcbc8423892c).(sym->flagscxx . . $ _SYMBOL#flags. != 0); |
| 1369 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 1370 | } |
| 1371 | |
| 1372 | void |
| 1373 | v_ifcxx . . $ v_if(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1374 | { |
| 1375 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym; |
| 1376 | |
| 1377 | if (!Ifstackcxx . . $ Ifstack.->xtruecxx . . $ _IFSTACK#xtrue. || !Ifstackcxx . . $ Ifstack.->acctruecxx . . $ _IFSTACK#acctrue.) { |
| 1378 | pushifcxx . . $ pushif(b45ddcbc8423892c).(0); |
| 1379 | return; |
| 1380 | } |
| 1381 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 1382 | sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 1383 | if (sym->flagscxx . . $ _SYMBOL#flags.) { |
| 1384 | ++Redocxx . . $ Redo.; |
| 1385 | Redo_whycxx . . $ Redo_why. |= REASON_IF_NOT_RESOLVEDcxx . . $ REASON_IF_NOT_RESOLVED.; |
| 1386 | pushifcxx . . $ pushif(b45ddcbc8423892c).(0); |
| 1387 | Ifstackcxx . . $ Ifstack.->acctruecxx . . $ _IFSTACK#acctrue. = 0; |
| 1388 | |
| 1389 | Redo_ifcxx . . $ Redo_if. |= 1; |
| 1390 | |
| 1391 | } |
| 1392 | else |
| 1393 | { |
| 1394 | pushifcxx . . $ pushif(b45ddcbc8423892c).(!!sym->valuecxx . . $ _SYMBOL#value.); |
| 1395 | } |
| 1396 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 1397 | } |
| 1398 | |
| 1399 | void v_elsecxx . . $ v_else(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1400 | { |
| 1401 | if (Ifstackcxx . . $ Ifstack.->acctruecxx . . $ _IFSTACK#acctrue. && !(Ifstackcxx . . $ Ifstack.->flagscxx . . $ _IFSTACK#flags. & IFF_BASEcxx . . $ `src/asm.h:298:9`!)) { |
| 1402 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 1403 | Ifstackcxx . . $ Ifstack.->xtruecxx . . $ _IFSTACK#xtrue. = !Ifstackcxx . . $ Ifstack.->xtruecxx . . $ _IFSTACK#xtrue.; |
| 1404 | } |
| 1405 | } |
| 1406 | |
| 1407 | void |
| 1408 | v_endifcxx . . $ v_endif(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1409 | { |
| 1410 | IFSTACKcxx . . $ `src/asm.h:158:9`! *ifs = Ifstackcxx . . $ Ifstack.; |
| 1411 | |
| 1412 | if (!(ifs->flagscxx . . $ _IFSTACK#flags. & IFF_BASEcxx . . $ `src/asm.h:298:9`!)) { |
| 1413 | if (ifs->acctruecxx . . $ _IFSTACK#acctrue.) |
| 1414 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 1415 | if (ifs->filecxx . . $ _IFSTACK#file. != pIncfilecxx . . $ pIncfile.) { |
| 1416 | putscxx . . $ puts(5c4306d8553b3696).("too many endif's"); |
| 1417 | } |
| 1418 | else |
| 1419 | { |
| 1420 | Ifstackcxx . . $ Ifstack. = ifs->nextcxx . . $ _IFSTACK#next.; |
| 1421 | freecxx . . $ free(5d22bdacc48458e8).(ifs); |
| 1422 | } |
| 1423 | } |
| 1424 | } |
| 1425 | |
| 1426 | void v_repeatcxx . . $ v_repeat(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1427 | { |
| 1428 | REPLOOPcxx . . $ `src/asm.h:157:9`! *rp; |
| 1429 | SYMBOLcxx . . $ `src/asm.h:160:9`! *sym; |
| 1430 | |
| 1431 | if (!Ifstackcxx . . $ Ifstack.->xtruecxx . . $ _IFSTACK#xtrue. || !Ifstackcxx . . $ Ifstack.->acctruecxx . . $ _IFSTACK#acctrue.) { |
| 1432 | pushifcxx . . $ pushif(b45ddcbc8423892c).(0); |
| 1433 | return; |
| 1434 | } |
| 1435 | programlabelcxx . . $ programlabel(49f6e7a06ebc5aa8).(); |
| 1436 | sym = evalcxx . . $ eval(83a8820e5b78665b).(str, 0); |
| 1437 | if (sym->valuecxx . . $ _SYMBOL#value. == 0) { |
| 1438 | pushifcxx . . $ pushif(b45ddcbc8423892c).(0); |
| 1439 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 1440 | return; |
| 1441 | } |
| 1442 | |
| 1443 | #ifdef DADcxx . . $ `src/asm.h:55:9`! |
| 1444 | |
| 1445 | /* Don't allow negative values for REPEAT loops */ |
| 1446 | |
| 1447 | if ( sym->valuecxx . . $ _SYMBOL#value. < 0 ) |
| 1448 | { |
| 1449 | pushifcxx . . $ pushif(b45ddcbc8423892c).( 0 ); |
| 1450 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).( sym ); |
| 1451 | |
| 1452 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_REPEAT_NEGATIVEcxx . . $ ERROR_REPEAT_NEGATIVE., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ); |
| 1453 | return; |
| 1454 | } |
| 1455 | |
| 1456 | #endif |
| 1457 | |
| 1458 | rp = (REPLOOPcxx . . $ `src/asm.h:157:9`! *)zmalloccxx . . $ zmalloc(ff224f080444ee45).(sizeof(REPLOOPcxx . . $ `src/asm.h:157:9`!)); |
| 1459 | rp->nextcxx . . $ _REPLOOP#next. = Reploopcxx . . $ Reploop.; |
| 1460 | rp->filecxx . . $ _REPLOOP#file. = pIncfilecxx . . $ pIncfile.; |
| 1461 | if (pIncfilecxx . . $ pIncfile.->flagscxx . . $ _INCFILE#flags. & INF_MACROcxx . . $ `src/asm.h:267:9`!) |
| 1462 | rp->seekcxx . . $ _REPLOOP#seek. = (long)pIncfilecxx . . $ pIncfile.->strlistcxx . . $ _INCFILE#strlist.; |
| 1463 | else |
| 1464 | rp->seekcxx . . $ _REPLOOP#seek. = ftellcxx . . $ ftell(1dcafcd8ef4c6e6c).(pIncfilecxx . . $ pIncfile.->ficxx . . $ _INCFILE#fi.); |
| 1465 | rp->linenocxx . . $ _REPLOOP#lineno. = pIncfilecxx . . $ pIncfile.->linenocxx . . $ _INCFILE#lineno.; |
| 1466 | rp->countcxx . . $ _REPLOOP#count. = sym->valuecxx . . $ _SYMBOL#value.; |
| 1467 | if ((rp->flagscxx . . $ _REPLOOP#flags. = sym->flagscxx . . $ _SYMBOL#flags.) != 0) { |
| 1468 | ++Redocxx . . $ Redo.; |
| 1469 | Redo_whycxx . . $ Redo_why. |= REASON_REPEAT_NOT_RESOLVEDcxx . . $ REASON_REPEAT_NOT_RESOLVED.; |
| 1470 | } |
| 1471 | Reploopcxx . . $ Reploop. = rp; |
| 1472 | FreeSymbolListcxx . . $ FreeSymbolList(54782e8e250fbf33).(sym); |
| 1473 | pushifcxx . . $ pushif(b45ddcbc8423892c).(1); |
| 1474 | } |
| 1475 | |
| 1476 | void |
| 1477 | v_rependcxx . . $ v_repend(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1478 | { |
| 1479 | if (!Ifstackcxx . . $ Ifstack.->xtruecxx . . $ _IFSTACK#xtrue. || !Ifstackcxx . . $ Ifstack.->acctruecxx . . $ _IFSTACK#acctrue.) { |
| 1480 | v_endifcxx . . $ v_endif(b7f07ba78920e729).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1481 | return; |
| 1482 | } |
| 1483 | if (Reploopcxx . . $ Reploop. && Reploopcxx . . $ Reploop.->filecxx . . $ _REPLOOP#file. == pIncfilecxx . . $ pIncfile.) { |
| 1484 | if (Reploopcxx . . $ Reploop.->flagscxx . . $ _REPLOOP#flags. == 0 && --Reploopcxx . . $ Reploop.->countcxx . . $ _REPLOOP#count.) { |
| 1485 | if (pIncfilecxx . . $ pIncfile.->flagscxx . . $ _INCFILE#flags. & INF_MACROcxx . . $ `src/asm.h:267:9`!) |
| 1486 | pIncfilecxx . . $ pIncfile.->strlistcxx . . $ _INCFILE#strlist. = (STRLISTcxx . . $ `src/asm.h:161:9`! *)Reploopcxx . . $ Reploop.->seekcxx . . $ _REPLOOP#seek.; |
| 1487 | else |
| 1488 | fseekcxx . . $ fseek(543fae30d249f6b1).(pIncfilecxx . . $ pIncfile.->ficxx . . $ _INCFILE#fi.,Reploopcxx . . $ Reploop.->seekcxx . . $ _REPLOOP#seek.,0); |
| 1489 | pIncfilecxx . . $ pIncfile.->linenocxx . . $ _INCFILE#lineno. = Reploopcxx . . $ Reploop.->linenocxx . . $ _REPLOOP#lineno.; |
| 1490 | } |
| 1491 | else |
| 1492 | { |
| 1493 | rmnodecxx . . $ rmnode(c5057b5a64f892f7).((void **)&Reploopcxx . . $ Reploop., sizeof(REPLOOPcxx . . $ `src/asm.h:157:9`!)); |
| 1494 | v_endifcxx . . $ v_endif(b7f07ba78920e729).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1495 | } |
| 1496 | return; |
| 1497 | } |
| 1498 | putscxx . . $ puts(5c4306d8553b3696).("no repeat"); |
| 1499 | } |
| 1500 | |
| 1501 | |
| 1502 | |
| 1503 | STRLISTcxx . . $ `src/asm.h:161:9`! *incdirlistcxx . . $ incdirlist.; |
| 1504 | |
| 1505 | void |
| 1506 | v_incdircxx . . $ v_incdir(b7f07ba78920e729).(char *str, MNEMONICcxx . . $ `src/asm.h:154:9`! *dummy) |
| 1507 | { |
| 1508 | STRLISTcxx . . $ `src/asm.h:161:9`! **tail; |
| 1509 | char *buf; |
| 1510 | int found = 0; |
| 1511 | |
| 1512 | buf = getfilenamecxx . . $ getfilename(7a9722d75b371431).(str); |
| 1513 | |
| 1514 | for (tail = &incdirlistcxx . . $ incdirlist.; *tail; tail = &(*tail)->nextcxx . . $ _STRLIST#next.) { |
| 1515 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).((*tail)->bufcxx . . $ _STRLIST#buf., buf) == 0) |
| 1516 | found = 1; |
| 1517 | } |
| 1518 | |
| 1519 | if (!found) { |
| 1520 | STRLISTcxx . . $ `src/asm.h:161:9`! *newdir; |
| 1521 | |
| 1522 | newdir = (STRLISTcxx . . $ `src/asm.h:161:9`! *)permalloccxx . . $ permalloc(ff224f080444ee45).(STRLISTSIZEcxx . . $ `src/asm.h:236:9`! + 1 + strlencxx . . $ strlen(751346f8406fd082).(buf)); |
| 1523 | strcpycxx . . $ strcpy(b7b3a83273496486).(newdir->bufcxx . . $ _STRLIST#buf., buf); |
| 1524 | *tail = newdir; |
| 1525 | } |
| 1526 | |
| 1527 | if (buf != str) |
| 1528 | freecxx . . $ free(5d22bdacc48458e8).(buf); |
| 1529 | } |
| 1530 | |
| 1531 | static void |
| 1532 | addpartcxx . . $ addpart(1c63c3373ac92ead).(char *dest, const char *dir, const char *file) |
| 1533 | { |
| 1534 | #if 0 /* not needed here */ |
| 1535 | if (strchr(file, ':')) { |
| 1536 | strcpy(dest, file); |
| 1537 | } |
| 1538 | else |
| 1539 | #endif |
| 1540 | { |
| 1541 | int pos; |
| 1542 | |
| 1543 | strcpycxx . . $ strcpy(b7b3a83273496486).(dest, dir); |
| 1544 | pos = strlencxx . . $ strlen(751346f8406fd082).(dest); |
| 1545 | if (pos > 0 && dest[pos-1] != ':' && dest[pos-1] != '/') { |
| 1546 | dest[pos] = '/'; |
| 1547 | pos++; |
| 1548 | } |
| 1549 | strcpycxx . . $ strcpy(b7b3a83273496486).(dest + pos, file); |
| 1550 | } |
| 1551 | } |
| 1552 | |
| 1553 | FILEcxx . . $ FILE# * |
| 1554 | pfopencxx . . $ pfopen(82ec0787cd37e0a3).(const char *name, const char *mode) |
| 1555 | { |
| 1556 | FILEcxx . . $ FILE# *f; |
| 1557 | STRLISTcxx . . $ `src/asm.h:161:9`! *incdir; |
| 1558 | char *buf; |
| 1559 | |
| 1560 | f = fopencxx . . $ fopen(82ec0787cd37e0a3).(name, mode); |
| 1561 | if (f) |
| 1562 | return f; |
| 1563 | |
| 1564 | /* Don't use the incdirlist for absolute pathnames */ |
| 1565 | if (strchrcxx . . $ strchr(2050848944e00d54).(name, ':')) |
| 1566 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1567 | |
| 1568 | buf = zmalloccxx . . $ zmalloc(ff224f080444ee45).(512); |
| 1569 | |
| 1570 | for (incdir = incdirlistcxx . . $ incdirlist.; incdir; incdir = incdir->nextcxx . . $ _STRLIST#next.) { |
| 1571 | addpartcxx . . $ addpart(1c63c3373ac92ead).(buf, incdir->bufcxx . . $ _STRLIST#buf., name); |
| 1572 | |
| 1573 | f = fopencxx . . $ fopen(82ec0787cd37e0a3).(buf, mode); |
| 1574 | if (f) |
| 1575 | break; |
| 1576 | } |
| 1577 | |
| 1578 | freecxx . . $ free(5d22bdacc48458e8).(buf); |
| 1579 | return f; |
| 1580 | } |
| 1581 | |
| 1582 | |
| 1583 | static long Seglencxx . . $ Seglen.; |
| 1584 | static long Seekbackcxx . . $ Seekback.; |
| 1585 | |
| 1586 | void |
| 1587 | generatecxx . . $ generate(49f6e7a06ebc5aa8).(void) |
| 1588 | { |
| 1589 | long seekpos; |
| 1590 | static unsigned long org; |
| 1591 | int i; |
| 1592 | |
| 1593 | if (!Redocxx . . $ Redo.) |
| 1594 | { |
| 1595 | if (!(Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. & SF_BSScxx . . $ `src/asm.h:310:9`!)) |
| 1596 | { |
| 1597 | for (i = Glencxx . . $ Glen. - 1; i >= 0; --i) |
| 1598 | CheckSumcxx . . $ CheckSum. += Gencxx . . $ Gen.[i]; |
| 1599 | |
| 1600 | if (Fisclearcxx . . $ Fisclear.) |
| 1601 | { |
| 1602 | Fisclearcxx . . $ Fisclear. = 0; |
| 1603 | if (Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. & SF_UNKNOWNcxx . . $ `src/asm.h:308:9`!) |
| 1604 | { |
| 1605 | ++Redocxx . . $ Redo.; |
| 1606 | Redo_whycxx . . $ Redo_why. |= REASON_OBSCUREcxx . . $ REASON_OBSCURE.; |
| 1607 | return; |
| 1608 | } |
| 1609 | |
| 1610 | org = Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org.; |
| 1611 | |
| 1612 | if ( F_formatcxx . . $ F_format. < FORMAT_RAWcxx . . $ FORMAT_RAW. ) |
| 1613 | { |
| 1614 | putccxx . . $ putc(b1cd03d6c470d1bd).((org & 0xFF), FI_tempcxx . . $ FI_temp.); |
| 1615 | putccxx . . $ putc(b1cd03d6c470d1bd).(((org >> 8) & 0xFF), FI_tempcxx . . $ FI_temp.); |
| 1616 | |
| 1617 | if ( F_formatcxx . . $ F_format. == FORMAT_RAScxx . . $ FORMAT_RAS. ) |
| 1618 | { |
| 1619 | Seekbackcxx . . $ Seekback. = ftellcxx . . $ ftell(1dcafcd8ef4c6e6c).(FI_tempcxx . . $ FI_temp.); |
| 1620 | Seglencxx . . $ Seglen. = 0; |
| 1621 | putccxx . . $ putc(b1cd03d6c470d1bd).(0, FI_tempcxx . . $ FI_temp.); |
| 1622 | putccxx . . $ putc(b1cd03d6c470d1bd).(0, FI_tempcxx . . $ FI_temp.); |
| 1623 | } |
| 1624 | } |
| 1625 | } |
| 1626 | |
| 1627 | switch(F_formatcxx . . $ F_format.) |
| 1628 | { |
| 1629 | |
| 1630 | default: |
| 1631 | |
| 1632 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_BAD_FORMATcxx . . $ ERROR_BAD_FORMAT., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, "Unhandled internal format specifier" ); |
| 1633 | break; |
| 1634 | |
| 1635 | case FORMAT_RAWcxx . . $ FORMAT_RAW.: |
| 1636 | case FORMAT_DEFAULTcxx . . $ FORMAT_DEFAULT.: |
| 1637 | |
| 1638 | if (Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org. < org) |
| 1639 | { |
| 1640 | printfcxx . . $ printf(581fddd72a8db8fc).("segment: %s %s vs current org: %04lx\n", |
| 1641 | Csegmentcxx . . $ Csegment.->namecxx . . $ _SEGMENT#name., sftoscxx . . $ sftos(ef4cfbd1f56d9042).(Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org., Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags.), org); |
| 1642 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ORIGIN_REVERSE_INDEXEDcxx . . $ ERROR_ORIGIN_REVERSE_INDEXED., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ); |
| 1643 | exitcxx . . $ exit(3ca292c338df9bb3).(1); |
| 1644 | } |
| 1645 | |
| 1646 | while (Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org. != org) |
| 1647 | { |
| 1648 | putccxx . . $ putc(b1cd03d6c470d1bd).(OrgFillcxx . . $ OrgFill., FI_tempcxx . . $ FI_temp.); |
| 1649 | ++org; |
| 1650 | } |
| 1651 | |
| 1652 | fwritecxx . . $ fwrite(ab0609fa07c47d6e).(Gencxx . . $ Gen., Glencxx . . $ Glen., 1, FI_tempcxx . . $ FI_temp.); |
| 1653 | break; |
| 1654 | |
| 1655 | case FORMAT_RAScxx . . $ FORMAT_RAS.: |
| 1656 | |
| 1657 | if (org != Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org.) |
| 1658 | { |
| 1659 | org = Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org.; |
| 1660 | seekpos = ftellcxx . . $ ftell(1dcafcd8ef4c6e6c).(FI_tempcxx . . $ FI_temp.); |
| 1661 | fseekcxx . . $ fseek(543fae30d249f6b1).(FI_tempcxx . . $ FI_temp., Seekbackcxx . . $ Seekback., 0); |
| 1662 | putccxx . . $ putc(b1cd03d6c470d1bd).((Seglencxx . . $ Seglen. & 0xFF), FI_tempcxx . . $ FI_temp.); |
| 1663 | putccxx . . $ putc(b1cd03d6c470d1bd).(((Seglencxx . . $ Seglen. >> 8) & 0xFF), FI_tempcxx . . $ FI_temp.); |
| 1664 | fseekcxx . . $ fseek(543fae30d249f6b1).(FI_tempcxx . . $ FI_temp., seekpos, 0); |
| 1665 | putccxx . . $ putc(b1cd03d6c470d1bd).((org & 0xFF), FI_tempcxx . . $ FI_temp.); |
| 1666 | putccxx . . $ putc(b1cd03d6c470d1bd).(((org >> 8) & 0xFF), FI_tempcxx . . $ FI_temp.); |
| 1667 | Seekbackcxx . . $ Seekback. = ftellcxx . . $ ftell(1dcafcd8ef4c6e6c).(FI_tempcxx . . $ FI_temp.); |
| 1668 | Seglencxx . . $ Seglen. = 0; |
| 1669 | putccxx . . $ putc(b1cd03d6c470d1bd).(0, FI_tempcxx . . $ FI_temp.); |
| 1670 | putccxx . . $ putc(b1cd03d6c470d1bd).(0, FI_tempcxx . . $ FI_temp.); |
| 1671 | } |
| 1672 | |
| 1673 | fwritecxx . . $ fwrite(ab0609fa07c47d6e).(Gencxx . . $ Gen., Glencxx . . $ Glen., 1, FI_tempcxx . . $ FI_temp.); |
| 1674 | Seglencxx . . $ Seglen. += Glencxx . . $ Glen.; |
| 1675 | break; |
| 1676 | |
| 1677 | } |
| 1678 | org += Glencxx . . $ Glen.; |
| 1679 | } |
| 1680 | } |
| 1681 | |
| 1682 | Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org. += Glencxx . . $ Glen.; |
| 1683 | |
| 1684 | if (Csegmentcxx . . $ Csegment.->flagscxx . . $ _SEGMENT#flags. & SF_RORGcxx . . $ `src/asm.h:311:9`!) |
| 1685 | Csegmentcxx . . $ Csegment.->rorgcxx . . $ _SEGMENT#rorg. += Glencxx . . $ Glen.; |
| 1686 | |
| 1687 | if (Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org. > maxFileSizecxx . . $ maxFileSize.) { |
| 1688 | char errMsg[128]; |
| 1689 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(errMsg, "code segment growing larger (%ld) than max. allowed file size (%ld)\n" |
| 1690 | ,Csegmentcxx . . $ Csegment.->orgcxx . . $ _SEGMENT#org., maxFileSizecxx . . $ maxFileSize.); |
| 1691 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_RECURSION_TOO_DEEPcxx . . $ ERROR_RECURSION_TOO_DEEP., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, errMsg ); |
| 1692 | return; |
| 1693 | } |
| 1694 | } |
| 1695 | |
| 1696 | void closegeneratecxx . . $ closegenerate(49f6e7a06ebc5aa8).(void) |
| 1697 | { |
| 1698 | if (!Redocxx . . $ Redo.) |
| 1699 | { |
| 1700 | if ( F_formatcxx . . $ F_format. == FORMAT_RAScxx . . $ FORMAT_RAS. ) |
| 1701 | { |
| 1702 | fseekcxx . . $ fseek(543fae30d249f6b1).(FI_tempcxx . . $ FI_temp., Seekbackcxx . . $ Seekback., 0); |
| 1703 | putccxx . . $ putc(b1cd03d6c470d1bd).((Seglencxx . . $ Seglen. & 0xFF), FI_tempcxx . . $ FI_temp.); |
| 1704 | putccxx . . $ putc(b1cd03d6c470d1bd).(((Seglencxx . . $ Seglen. >> 8) & 0xFF), FI_tempcxx . . $ FI_temp.); |
| 1705 | fseekcxx . . $ fseek(543fae30d249f6b1).(FI_tempcxx . . $ FI_temp., 0L, 2); |
| 1706 | } |
| 1707 | } |
| 1708 | } |
| 1709 | |
| 1710 | void |
| 1711 | genfillcxx . . $ genfill(86ac8c965b1a1974).(long fill, long entries, int size) |
| 1712 | { |
| 1713 | long bytes = entries; /* multiplied later */ |
| 1714 | int i; |
| 1715 | unsigned char c3,c2,c1,c0; |
| 1716 | |
| 1717 | if (bytes == 0) { |
| 1718 | // nothing to do |
| 1719 | return; |
| 1720 | } |
| 1721 | if (bytes < 0) { |
| 1722 | asmerrcxx . . $ asmerr(1daa6892c969c96d).( ERROR_ORIGIN_REVERSE_INDEXEDcxx . . $ ERROR_ORIGIN_REVERSE_INDEXED., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ); |
| 1723 | return; |
| 1724 | } |
| 1725 | |
| 1726 | c3 = fill >> 24; |
| 1727 | c2 = fill >> 16; |
| 1728 | c1 = fill >> 8; |
| 1729 | c0 = fill; |
| 1730 | switch(size) |
| 1731 | { |
| 1732 | case 1: |
| 1733 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(Gencxx . . $ Gen., c0, sizeof(Gencxx . . $ Gen.)); |
| 1734 | break; |
| 1735 | |
| 1736 | case 2: |
| 1737 | bytes <<= 1; |
| 1738 | for (i = 0; i < sizeof(Gencxx . . $ Gen.); i += 2) |
| 1739 | { |
| 1740 | if (MsbOrdercxx . . $ MsbOrder.) |
| 1741 | { |
| 1742 | Gencxx . . $ Gen.[i+0] = c1; |
| 1743 | Gencxx . . $ Gen.[i+1] = c0; |
| 1744 | } |
| 1745 | else |
| 1746 | { |
| 1747 | Gencxx . . $ Gen.[i+0] = c0; |
| 1748 | Gencxx . . $ Gen.[i+1] = c1; |
| 1749 | } |
| 1750 | } |
| 1751 | break; |
| 1752 | |
| 1753 | case 4: |
| 1754 | bytes <<= 2; |
| 1755 | for (i = 0; i < sizeof(Gencxx . . $ Gen.); i += 4) |
| 1756 | { |
| 1757 | if (MsbOrdercxx . . $ MsbOrder.) |
| 1758 | { |
| 1759 | Gencxx . . $ Gen.[i+0] = c3; |
| 1760 | Gencxx . . $ Gen.[i+1] = c2; |
| 1761 | Gencxx . . $ Gen.[i+2] = c1; |
| 1762 | Gencxx . . $ Gen.[i+3] = c0; |
| 1763 | } |
| 1764 | else |
| 1765 | { |
| 1766 | Gencxx . . $ Gen.[i+0] = c0; |
| 1767 | Gencxx . . $ Gen.[i+1] = c1; |
| 1768 | Gencxx . . $ Gen.[i+2] = c2; |
| 1769 | Gencxx . . $ Gen.[i+3] = c3; |
| 1770 | } |
| 1771 | } |
| 1772 | break; |
| 1773 | } |
| 1774 | |
| 1775 | for (Glencxx . . $ Glen. = sizeof(Gencxx . . $ Gen.); bytes > sizeof(Gencxx . . $ Gen.); bytes -= sizeof(Gencxx . . $ Gen.)) |
| 1776 | generatecxx . . $ generate(49f6e7a06ebc5aa8).(); |
| 1777 | Glencxx . . $ Glen. = bytes; |
| 1778 | generatecxx . . $ generate(49f6e7a06ebc5aa8).(); |
| 1779 | } |
| 1780 | |
| 1781 | void |
| 1782 | pushifcxx . . $ pushif(b45ddcbc8423892c).(boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xbool) |
| 1783 | { |
| 1784 | IFSTACKcxx . . $ `src/asm.h:158:9`! *ifs = (IFSTACKcxx . . $ `src/asm.h:158:9`! *)zmalloccxx . . $ zmalloc(ff224f080444ee45).(sizeof(IFSTACKcxx . . $ `src/asm.h:158:9`!)); |
| 1785 | ifs->nextcxx . . $ _IFSTACK#next. = Ifstackcxx . . $ Ifstack.; |
| 1786 | ifs->filecxx . . $ _IFSTACK#file. = pIncfilecxx . . $ pIncfile.; |
| 1787 | ifs->flagscxx . . $ _IFSTACK#flags. = 0; |
| 1788 | ifs->xtruecxx . . $ _IFSTACK#xtrue. = xbool; |
| 1789 | ifs->acctruecxx . . $ _IFSTACK#acctrue. = Ifstackcxx . . $ Ifstack.->acctruecxx . . $ _IFSTACK#acctrue. && Ifstackcxx . . $ Ifstack.->xtruecxx . . $ _IFSTACK#xtrue.; |
| 1790 | Ifstackcxx . . $ Ifstack. = ifs; |
| 1791 | } |