This page represents examples 72, 73, and 74 of Halstead's "Machine-Independent Computer Programming". Comments in italics, as well as the disassembly and Algol hand translation, have been added by MikeVanEmmerik.

  EXAMPLE 72.
  Address         ff  jkb  yyyyy              Ad.dress    ff   jkb   yyyyy
  00522           00  000  00000              00565       12   130   00130
  00523           65  000  00352              00566       10   030   00132
  00524           65  000  00211              00567       14   031   00000
  00525           16  030  00130              00570       61   000   00526
  00526           16  030  00131              00571       65   000   00346
  00527           16  030  00132              00572       12   500   00007
  00530           12  300  00000              00573       10   030   00130
  00531           10  030  00130              00574       27   515   00133
  00532           27  500  00051              00575       61   000   00541
  00533           61  000  00571              00576       72   500   00573
  00534           10  030  00130              00577       11   530   00130
  00535           27  500  00045              00600       61   000   00571
  00536           61  000  00571              00601       10   030   00130
  00537           65  000  00346              0060?       27   500   00004
  00540           61  000  00526              00603       61   000   00571
  00541           10  003  00000              00604       10   030   00130
  00542           27  700  00005              00605       27   500   00057
  00543           61  000  00553              00606       61   000   00571
  00544           10  030  00131              00607       10   030   00130
  00545           05  000  00003              00610       27   500   00047
  00546           14  030  00467              00611       61   000   00571
  00547           10  005  00000              00612       10   030   00130
  00550           26  030  00467              00613       27   500   00077
  00551           14  030  00131              00614       61   000   00571
  00552           61  000  00561              00615       10   030   00130
  00553           10  030  00132              00616       27   400   00042
  00554           05  000  00003              00617       61   000   00526
  00555           14  030  00467              00620       65   000   00346
  00556           10  005  00000              00621       10   030   00130
  00557           26  030  00467              00622       27   400   00042
  00560           14  030  00132              00623       61   000   00526
  00561           12  303  00001              00624       65   000   00265
  00562           10  003  00000              00625       65   000   00363
  00563           27  400  00017              00626       61   010   00522
  00564           61  000  00571              00627       00   000   00000

Again, here is MikeVanEmmerik's hand disassembly of the above:

00522 START:  .word   0
00523         call    SUB_A
00524         call    SUB_B
00525         st      b,AA
00526 ENT_A:  st      b,AB
00527         st      b,AC
00530         ld      b,#0           ; Why is j=3?
00531         ld      q,AA
00532         sub     <>,q,#00051    ; Subtract and skip if result not equal to 0
00533         jmp     ENT_B
00534         ld      q,AA
00535         sub     <>,q,#00045
00536         jmp     ENT_B
00537         call    SUB_C
00540         jmp     ENT_A
00541 ENT_D:  

ex73_1.jpg

EXAMPLE 74.
SUB A  0 352
SUB B  0 211
SUB C  0 346
ENT A  0 526
ENT B  0 571
SUB D  0 265
SUB E  0 363
ENT C  0 522
ENT D  0 541
ENT E  0 561
ENT F  0 553
START  0 522
AA    3 130
AB    3 131
AC    3 132
AD    3 467
AE    3 133

Revision: r1.1 - 23 Aug 2004 - 04:55 - MikeVanEmmerik
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback