Skip to content

Commit a19c0d2

Browse files
committed
In e64, rename addr -> start_addr, addr -> end_addr for clarity.
1 parent 42f48a8 commit a19c0d2

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

e64.cpp

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -205,20 +205,20 @@ static double real_exponent(double value, int &exponent)
205205
// Print string in ITM format.
206206
// Return next data address.
207207
//
208-
unsigned Processor::e64_print_itm(unsigned addr0, unsigned addr1)
208+
unsigned Processor::e64_print_itm(unsigned start_addr, unsigned end_addr)
209209
{
210-
BytePointer bp(memory, addr0);
210+
BytePointer bp(memory, start_addr);
211211
uint8_t last_ch = GOST_SPACE;
212212

213213
while (bp.word_addr) {
214214
// No data to print.
215-
if (addr1 && bp.word_addr == addr1 + 1) {
215+
if (end_addr && bp.word_addr == end_addr + 1) {
216216
return bp.word_addr;
217217
}
218218

219219
// No space left on the line.
220220
if (e64_position == LINE_WIDTH) {
221-
if (!addr1) {
221+
if (!end_addr) {
222222
if (bp.byte_index) {
223223
++bp.word_addr;
224224
}
@@ -265,27 +265,27 @@ unsigned Processor::e64_print_itm(unsigned addr0, unsigned addr1)
265265
// Print word(s) in octal format.
266266
// Return next data address.
267267
//
268-
unsigned Processor::e64_print_octal(unsigned addr0, unsigned addr1, unsigned digits, unsigned width,
269-
unsigned repeat)
268+
unsigned Processor::e64_print_octal(unsigned start_addr, unsigned end_addr, unsigned digits,
269+
unsigned width, unsigned repeat)
270270
{
271271
if (digits > 16) {
272272
digits = 16;
273273
}
274-
while (addr0) {
274+
while (start_addr) {
275275
// No data to print.
276-
if (addr1 && addr0 == addr1 + 1) {
277-
return addr0;
276+
if (end_addr && start_addr == end_addr + 1) {
277+
return start_addr;
278278
}
279279

280280
// No space left on the line.
281281
if (e64_position >= LINE_WIDTH) {
282-
if (!addr1) {
282+
if (!end_addr) {
283283
return 0;
284284
}
285-
return addr0;
285+
return start_addr;
286286
}
287-
Word word = machine.mem_load(addr0);
288-
++addr0;
287+
Word word = machine.mem_load(start_addr);
288+
++start_addr;
289289

290290
word <<= 64 - digits * 3;
291291
for (unsigned i = 0; i < digits; ++i) {
@@ -294,7 +294,7 @@ unsigned Processor::e64_print_octal(unsigned addr0, unsigned addr1, unsigned dig
294294
}
295295

296296
if (!repeat) {
297-
return addr0;
297+
return start_addr;
298298
}
299299
--repeat;
300300
if (width > digits) {
@@ -308,8 +308,8 @@ unsigned Processor::e64_print_octal(unsigned addr0, unsigned addr1, unsigned dig
308308
// Print word(s) in hexadecimal format.
309309
// Return next data address.
310310
//
311-
unsigned Processor::e64_print_hex(unsigned addr0, unsigned addr1, unsigned digits, unsigned width,
312-
unsigned repeat)
311+
unsigned Processor::e64_print_hex(unsigned start_addr, unsigned end_addr, unsigned digits,
312+
unsigned width, unsigned repeat)
313313
{
314314
static const char hex_digit[16] = {
315315
GOST_0, GOST_1, GOST_2, GOST_3, GOST_4, GOST_5, GOST_6, GOST_7,
@@ -319,21 +319,21 @@ unsigned Processor::e64_print_hex(unsigned addr0, unsigned addr1, unsigned digit
319319
if (digits > 12) {
320320
digits = 12;
321321
}
322-
while (addr0) {
322+
while (start_addr) {
323323
// No data to print.
324-
if (addr1 && addr0 == addr1 + 1) {
325-
return addr0;
324+
if (end_addr && start_addr == end_addr + 1) {
325+
return start_addr;
326326
}
327327

328328
// No space left on the line.
329329
if (e64_position >= LINE_WIDTH) {
330-
if (!addr1) {
330+
if (!end_addr) {
331331
return 0;
332332
}
333-
return addr0;
333+
return start_addr;
334334
}
335-
Word word = machine.mem_load(addr0);
336-
++addr0;
335+
Word word = machine.mem_load(start_addr);
336+
++start_addr;
337337

338338
word <<= 64 - digits * 4;
339339
for (unsigned i = 0; i < digits; ++i) {
@@ -343,7 +343,7 @@ unsigned Processor::e64_print_hex(unsigned addr0, unsigned addr1, unsigned digit
343343
}
344344

345345
if (!repeat) {
346-
return addr0;
346+
return start_addr;
347347
}
348348
--repeat;
349349
if (width > digits) {
@@ -357,33 +357,33 @@ unsigned Processor::e64_print_hex(unsigned addr0, unsigned addr1, unsigned digit
357357
// Print CPU instruction(s).
358358
// Return next data address.
359359
//
360-
unsigned Processor::e64_print_instructions(unsigned addr0, unsigned addr1, unsigned width,
360+
unsigned Processor::e64_print_instructions(unsigned start_addr, unsigned end_addr, unsigned width,
361361
unsigned repeat)
362362
{
363-
while (addr0) {
363+
while (start_addr) {
364364
// No data to print.
365-
if (addr1 && addr0 == addr1 + 1) {
366-
return addr0;
365+
if (end_addr && start_addr == end_addr + 1) {
366+
return start_addr;
367367
}
368368

369369
// No space left on the line.
370370
if (e64_position >= LINE_WIDTH) {
371-
if (!addr1) {
371+
if (!end_addr) {
372372
return 0;
373373
}
374-
return addr0;
374+
return start_addr;
375375
}
376-
Word word = machine.mem_load(addr0);
376+
Word word = machine.mem_load(start_addr);
377377
unsigned a = word >> 24;
378378
unsigned b = word & BITS(24);
379-
++addr0;
379+
++start_addr;
380380

381381
e64_print_cmd(a);
382382
e64_putchar(GOST_SPACE);
383383
e64_print_cmd(b);
384384

385385
if (!repeat) {
386-
return addr0;
386+
return start_addr;
387387
}
388388
--repeat;
389389
if (width > 23) {
@@ -397,30 +397,30 @@ unsigned Processor::e64_print_instructions(unsigned addr0, unsigned addr1, unsig
397397
// Print real number(s).
398398
// Return next data address.
399399
//
400-
unsigned Processor::e64_print_real(unsigned addr0, unsigned addr1, unsigned digits, unsigned width,
401-
unsigned repeat)
400+
unsigned Processor::e64_print_real(unsigned start_addr, unsigned end_addr, unsigned digits,
401+
unsigned width, unsigned repeat)
402402
{
403403
if (digits > 20) {
404404
digits = 20;
405405
}
406406
if (digits < 4) {
407407
digits = 4;
408408
}
409-
while (addr0) {
409+
while (start_addr) {
410410
// No data to print.
411-
if (addr1 && addr0 == addr1 + 1) {
412-
return addr0;
411+
if (end_addr && start_addr == end_addr + 1) {
412+
return start_addr;
413413
}
414414

415415
// No space left on the line.
416416
if (e64_position >= LINE_WIDTH) {
417-
if (!addr1) {
417+
if (!end_addr) {
418418
return 0;
419419
}
420-
return addr0;
420+
return start_addr;
421421
}
422422

423-
Word word = machine.mem_load(addr0);
423+
Word word = machine.mem_load(start_addr);
424424
bool negative = (word & BIT41);
425425
double value = 0;
426426
int exponent = 0;
@@ -432,7 +432,7 @@ unsigned Processor::e64_print_real(unsigned addr0, unsigned addr1, unsigned digi
432432
}
433433
value = real_exponent(value, exponent);
434434
}
435-
++addr0;
435+
++start_addr;
436436

437437
e64_putchar(GOST_SPACE);
438438
e64_putchar(negative ? GOST_MINUS : GOST_PLUS);
@@ -464,11 +464,11 @@ unsigned Processor::e64_print_real(unsigned addr0, unsigned addr1, unsigned digi
464464
e64_putchar(exponent % 10);
465465

466466
if (!repeat) {
467-
if (addr1 && addr0 <= addr1) {
467+
if (end_addr && start_addr <= end_addr) {
468468
e64_emit_line();
469469
repeat = 1;
470470
} else {
471-
return addr0;
471+
return start_addr;
472472
}
473473
}
474474
--repeat;
@@ -483,17 +483,17 @@ unsigned Processor::e64_print_real(unsigned addr0, unsigned addr1, unsigned digi
483483
// Print string in GOST format.
484484
// Return next data address.
485485
//
486-
unsigned Processor::e64_print_gost(unsigned addr0, unsigned addr1)
486+
unsigned Processor::e64_print_gost(unsigned start_addr, unsigned end_addr)
487487
{
488-
BytePointer bp(memory, addr0);
488+
BytePointer bp(memory, start_addr);
489489
unsigned char last_ch = GOST_SPACE;
490490

491491
for (;;) {
492492
if (bp.word_addr == 0)
493493
return 0;
494494

495495
// No data to print.
496-
if (addr1 && bp.word_addr == addr1 + 1)
496+
if (end_addr && bp.word_addr == end_addr + 1)
497497
return bp.word_addr;
498498

499499
unsigned char ch = bp.get_byte();
@@ -589,17 +589,17 @@ unsigned Processor::e64_print_gost(unsigned addr0, unsigned addr1)
589589
//
590590
// Print string in Dubna mode.
591591
//
592-
void Processor::e64_print_dubna(unsigned addr0, unsigned addr1)
592+
void Processor::e64_print_dubna(unsigned start_addr, unsigned end_addr)
593593
{
594-
BytePointer bp(memory, addr0);
594+
BytePointer bp(memory, start_addr);
595595

596596
unsigned char ch = bp.get_byte();
597597
if (ch > 0 && e64_line_dirty) {
598598
// Emit previous line.
599599
e64_emit_line();
600600
}
601601
for (;;) {
602-
if (addr1 && bp.word_addr == addr1 + 1) {
602+
if (end_addr && bp.word_addr == end_addr + 1) {
603603
// No data to print.
604604
return;
605605
}

0 commit comments

Comments
 (0)