From eee09a56076f40beabea1f9f677d7d6463265bb0 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 27 Sep 2020 22:05:11 -0700 Subject: 6887 subx.md distinguishes between operands and arguments. Let's use that terminology more consistently in the sources. --- 036labels.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to '036labels.cc') diff --git a/036labels.cc b/036labels.cc index 2f8a25e8..c269538a 100644 --- a/036labels.cc +++ b/036labels.cc @@ -41,7 +41,7 @@ void test_Entry_label() { if (SIZE(s) == 2) return true; :(code) -void test_pack_immediate_ignores_single_byte_nondigit_operand() { +void test_pack_immediate_ignores_single_byte_nondigit_argument() { Hide_errors = true; transform( "== code 0x1\n" @@ -54,7 +54,7 @@ void test_pack_immediate_ignores_single_byte_nondigit_operand() { ); } -void test_pack_immediate_ignores_3_hex_digit_operand() { +void test_pack_immediate_ignores_3_hex_digit_argument() { Hide_errors = true; transform( "== code 0x1\n" @@ -67,7 +67,7 @@ void test_pack_immediate_ignores_3_hex_digit_operand() { ); } -void test_pack_immediate_ignores_non_hex_operand() { +void test_pack_immediate_ignores_non_hex_argument() { Hide_errors = true; transform( "== code 0x1\n" @@ -136,17 +136,17 @@ void compute_byte_indices_for_labels(const segment& code, map& Source_lines_file << "0x" << HEXWORD << (code.start + current_byte) << ' ' << inst.original << '\n'; for (int j = 0; j < SIZE(inst.words); ++j) { const word& curr = inst.words.at(j); - // hack: if we have any operand metadata left after previous transforms, + // hack: if we have any argument metadata left after previous transforms, // deduce its size // Maybe we should just move this transform to before instruction - // packing, and deduce the size of *all* operands. But then we'll also + // packing, and deduce the size of *all* arguments. But then we'll also // have to deal with bitfields. - if (has_operand_metadata(curr, "disp32") || has_operand_metadata(curr, "imm32")) { + if (has_argument_metadata(curr, "disp32") || has_argument_metadata(curr, "imm32")) { if (*curr.data.rbegin() == ':') raise << "'" << to_string(inst) << "': don't use ':' when jumping to labels\n" << end(); current_byte += 4; } - else if (has_operand_metadata(curr, "disp16")) { + else if (has_argument_metadata(curr, "disp16")) { if (*curr.data.rbegin() == ':') raise << "'" << to_string(inst) << "': don't use ':' when jumping to labels\n" << end(); current_byte += 2; @@ -160,8 +160,8 @@ void compute_byte_indices_for_labels(const segment& code, map& // ensure labels look sufficiently different from raw hex check_valid_name(label); if (trace_contains_errors()) return; - if (contains_any_operand_metadata(curr)) - raise << "'" << to_string(inst) << "': label definition (':') not allowed in operand\n" << end(); + if (contains_any_argument_metadata(curr)) + raise << "'" << to_string(inst) << "': label definition (':') not allowed in argument\n" << end(); if (j > 0) raise << "'" << to_string(inst) << "': labels can only be the first word in a line.\n" << end(); if (Labels_file.is_open()) @@ -224,21 +224,21 @@ void replace_labels_with_displacements(segment& code, const map const word& curr = inst.words.at(j); if (contains_key(byte_index, curr.data)) { int32_t displacement = static_cast(get(byte_index, curr.data)) - byte_index_next_instruction_starts_at; - if (has_operand_metadata(curr, "disp8")) { + if (has_argument_metadata(curr, "disp8")) { if (displacement > 0x7f || displacement < -0x7f) raise << "'" << to_string(inst) << "': label too far away for displacement " << std::hex << displacement << " to fit in 8 signed bits\n" << end(); else emit_hex_bytes(new_inst, displacement, 1); } - else if (has_operand_metadata(curr, "disp16")) { + else if (has_argument_metadata(curr, "disp16")) { if (displacement > 0x7fff || displacement < -0x7fff) raise << "'" << to_string(inst) << "': label too far away for displacement " << std::hex << displacement << " to fit in 16 signed bits\n" << end(); else emit_hex_bytes(new_inst, displacement, 2); } - else if (has_operand_metadata(curr, "disp32")) { + else if (has_argument_metadata(curr, "disp32")) { emit_hex_bytes(new_inst, displacement, 4); - } else if (has_operand_metadata(curr, "imm32")) { + } else if (has_argument_metadata(curr, "imm32")) { emit_hex_bytes(new_inst, code.start + get(byte_index, curr.data), 4); } } -- cgit 1.4.1-2-gfad0 /a> 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290