about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-04-08 01:26:59 -0700
committerKartik Agaram <vc@akkartik.com>2020-04-08 01:26:59 -0700
commit667346087120d2296c2b9ae0dcd9c0965efab7e5 (patch)
tree04a1ad4290805ebc5e5bdee2effdbf5babdbe9b9
parent5ff8a99178991b1c6302b26c66ddf0d7b81d66c6 (diff)
downloadmu-667346087120d2296c2b9ae0dcd9c0965efab7e5.tar.gz
6198
-rwxr-xr-xapps/surveybin49862 -> 49863 bytes
-rw-r--r--apps/survey.subx24
2 files changed, 10 insertions, 14 deletions
diff --git a/apps/survey b/apps/survey
index 4b0d91ea..b1fd77a7 100755
--- a/apps/survey
+++ b/apps/survey
Binary files differdiff --git a/apps/survey.subx b/apps/survey.subx
index 0639fe92..a8c8f8af 100644
--- a/apps/survey.subx
+++ b/apps/survey.subx
@@ -1508,14 +1508,14 @@ $compute-addresses:segment-break:
 #?     # }}}
     # esi = labels
     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           6/r32/esi   0xc/disp8       .                 # copy *(ebp+12) to esi
-    # var lrow/eax: (addr label-row) = labels->data
-    8d/copy-address                 1/mod/*+disp8   6/rm32/esi    .           .             .           0/r32/eax   0xc/disp8       .                 # copy esi+12 to eax
     # var max/ecx: (addr byte) = &labels->data[labels->write]
     8b/copy                         0/mod/indirect  6/rm32/esi    .           .             .           1/r32/ecx   .               .                 # copy *esi to ecx
-    01/add                          3/mod/direct    1/rm32/ecx    .           .             .           6/r32/esi   .               .                 # add esi to ecx
+    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    6/base/esi  1/index/ecx   .           1/r32/ecx   0xc/disp8       .                 # copy esi+ecx+12 to ecx
+    # var lrow/esi: (addr label-row) = labels->data
+    8d/copy-address                 1/mod/*+disp8   6/rm32/esi    .           .             .           6/r32/esi   0xc/disp8       .                 # copy esi+12 to esi
 $compute-addresses:label-loop:
     # if (lrow >= max) break
-    39/compare                      3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # compare eax with ecx
+    39/compare                      3/mod/direct    6/rm32/esi    .           .             .           1/r32/ecx   .               .                 # compare esi with ecx
     0f 83/jump-if-addr>=  $compute-addresses:end/disp32
 #?     # dump lrow->key {{{
 #?     # . write(2/stderr, "label: ")
@@ -1528,7 +1528,7 @@ $compute-addresses:label-loop:
 #?     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 #?     # . write(2/stderr, lrow->key)
 #?     # . . push args
-#?     ff          6/subop/push        0/mod/indirect  0/rm32/eax    .           .             .           .           .               .                 # push *eax
+#?     ff          6/subop/push        0/mod/indirect  6/rm32/esi    .           .             .           .           .               .                 # push *esi
 #?     68/push  2/imm32/stderr
 #?     # . . call
 #?     e8/call  write/disp32
@@ -1544,7 +1544,7 @@ $compute-addresses:label-loop:
 #?     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 #?     # }}}
     # var seg-name/edx: (addr array byte) = lrow->segment-name
-    8b/copy                         1/mod/*+disp8   0/rm32/eax    .           .             .           2/r32/edx   4/disp8         .                 # copy *eax to edx
+    8b/copy                         1/mod/*+disp8   6/rm32/esi    .           .             .           2/r32/edx   4/disp8         .                 # copy *esi to edx
 #?     # dump seg-name {{{
 #?     # . write(2/stderr, "compute-addresses: seg-name: ")
 #?     # . . push args
@@ -1572,8 +1572,6 @@ $compute-addresses:label-loop:
 #?     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 #?     # }}}
     # var label-seg/edx: (addr segment-info) = get(segments, seg-name, row-size=16, "segment table")
-    # . save eax
-    50/push-eax
     # . eax = get(segments, seg-name, row-size=16)
     # . . push args
     68/push  "segment table"/imm32
@@ -1586,27 +1584,25 @@ $compute-addresses:label-loop:
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
     # . edx = eax
     89/copy                         3/mod/direct    2/rm32/edx    .           .             .           0/r32/eax   .               .                 # copy eax to edx
-    # . restore eax
-    58/pop-to-eax
     # ebx = label-seg->address
     8b/copy                         0/mod/indirect  2/rm32/edx    .           .             .           3/r32/ebx   .               .                 # copy *edx to ebx
     # ebx += lrow->segment-offset
-    03/add                          1/mod/*+disp8   0/rm32/eax    .           .             .           3/r32/ebx   8/disp8         .                 # add *(eax+8) to ebx
+    03/add                          1/mod/*+disp8   6/rm32/esi    .           .             .           3/r32/ebx   8/disp8         .                 # add *(esi+8) to ebx
     # lrow->address = ebx
-    89/copy                         1/mod/*+disp8   0/rm32/eax    .           .             .           3/r32/ebx   0xc/disp8       .                 # copy ebx to *(eax+12)
+    89/copy                         1/mod/*+disp8   6/rm32/esi    .           .             .           3/r32/ebx   0xc/disp8       .                 # copy ebx to *(esi+12)
     # trace-sssns("label " lrow->key " is at address " lrow->address ".")
     # . . push args
     68/push  "."/imm32
     53/push-ebx
     68/push  "' is at address "/imm32
-    ff          6/subop/push        0/mod/indirect  0/rm32/eax    .           .             .           .           .               .                 # push *eax
+    ff          6/subop/push        0/mod/indirect  6/rm32/esi    .           .             .           .           .               .                 # push *esi
     68/push  "label '"/imm32
     # . . call
     e8/call  trace-sssns/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x14/imm32        # add to esp
     # lrow += 16  # size of row
-    05/add-to-eax  0x10/imm32
+    81          0/subop/add         3/mod/direct    6/rm32/esi    .           .             .           .           .               0x10/imm32        # add to esi
     e9/jump  $compute-addresses:label-loop/disp32
 $compute-addresses:end:
     # . restore registers
id='n362' href='#n362'>362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664