home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / CPMUG / CPMUG078.ARK / DUH.Z80 < prev    next >
Text File  |  1984-04-29  |  3KB  |  129 lines

  1. ;    Program name is DUH:
  2. ;    as in DU for Heath
  3. ;    as in duhhh (stupido)... because:
  4. ;        It requires two (TWO !) copies
  5. ;        of the DU com file and uses the
  6. ;        proper one instead of relocating
  7. ;        a much smaller file. (~5k vs. 10k)
  8. ;        Try using this technique with your
  9. ;        favorite 24-K interpreter. ( Could
  10. ;        not do it even with a 48-k H-89. )
  11. ;    but:    This program uses only 8080 code
  12. ;        so the user can trace it with DDT,
  13. ;        even though it is running on a Z-80.
  14. ;    and:    The program does not conditionally 
  15. ;        execute any code based on examining
  16. ;        RAM/ROM.
  17. ;
  18. ;    Progammed by:    Bill Norris
  19. ;    Date:        June 19,1981
  20. ;    Assemble info:    Cromemco assembler using dummy
  21. ;            parameter in command line:
  22. ;            e.g.    "ASMB DUH HEX=3333"    
  23. ;            produces nifty little hex file.
  24. ;    Usage:        Using DEBUG or DDT, load both
  25. ;            versions of DU into memory as
  26. ;            follows:
  27. ;
  28. ;            High version at 1400 hex,
  29. ;            Low version at 200 hex,
  30. ;            then read in DUH.HEX.
  31. ;            Return to operating system
  32. ;            Say "SAVE 37 DUH.COM" for CP/M or
  33. ;            Say "SAVE DUH.COM 37" for CDOS.
  34. ;
  35. ;        Transfer it somehow to Heath disk.
  36. ;        DUH.COM should now execute properly with
  37. ;        all versions of CP/M for Heath H-89 with
  38. ;        5 inch single sided single density disks.
  39. ;
  40. cr    equ    13
  41. lf    equ    10
  42. ;
  43.     org    100h    ; Defeat dummy ORG parameter.
  44. ;
  45. start:
  46. ;    Start of code which may modify the relocater.
  47.     ld    hl,5600h    ; modify the
  48.     ld    (hloopa),hl    ; following
  49.     ld    hl,4300h    ; block move
  50.     ld    (hloopb),hl    ; routines if
  51.     ld    (hloopf),hl    ; loaded at
  52.     ld    a,68h        ; 4300 hex.
  53.     ld    (hloopd),a    ;
  54.     ;
  55.     ld    hl,4200h
  56.     ld    (hlpb),hl
  57.     ld    (hlpf),hl
  58.     ld    hl,6800h
  59.     ld    (hlpc),hl
  60.     ld    (hlph),hl
  61.     ld    hl,4205h
  62.     ld    (hlpg),hl
  63.     ld    hl,[hlpd-1]
  64.     ld    (hlpe),hl
  65.     ;
  66. ;    Not done yet.  Hloope instruction needs
  67. ;    modification if above 4300 only.  Would
  68. ;    not be necessary if relative jump used.
  69. ;
  70. lpa:    ld    hl,loopa
  71. lpb:    ld    de,0
  72.     add    hl,de
  73. lpc:    ld    de,2600h    ; (6800h)
  74.     ld    b,[loopg-loopa]
  75. lpd:    ld    a,(hl)
  76.     ld    (de),a
  77.     inc    hl
  78.     inc    de
  79.     dec    b
  80. lpe:    jp    nz,lpd
  81. ;
  82. ;    Now Hloope may be zapped.
  83.     ld    hl,[2600h+4200h+loopc-loopa]
  84.     ld    ([6800h+loope-loopa+1]),hl
  85. ;
  86. lpf:    ld    hl,0
  87.     ld    de,msg
  88.     add    hl,de
  89.     ex    de,hl
  90.     ld    c,9
  91. lpg:    call    5
  92. lph:    jp    2600h    ; (6800h)
  93. msg:    db    cr,lf
  94.     db    'DUH Loader (omniscient object)',cr,lf
  95.     db    '06/19/81 - brn',cr,lf,cr,lf,'$'
  96. ;
  97. ;    This 'loop' block must be moved above
  98. ;    the composite DU code blocks.
  99. ;    ORG is 2600 hex. (6800 hex)
  100. loopa:    ld    hl,200h    ; 5600h - start of DU is
  101. loopb:    ld    de,100h    ; 4300h    - moved to here.
  102. loopc:    ld    a,(hl)    ; start of block move
  103.     ld    (de),a
  104.     inc    hl
  105.     inc    de
  106. loopd:    ld    a,14h    ; 68h - top of DU
  107.     cp    h
  108. loope:    jp    nz,[2600h+loopc-loopa]    ; end of loop
  109. loopf:    jp    100h    ; 4300h - execute DU
  110. loopg:    nop
  111. ;
  112. mbase    equ    4201h
  113. hloopa    equ    mbase+loopa
  114. hloopb    equ    mbase+loopb
  115. hloopc    equ    mbase+loopc
  116. hloopd    equ    mbase+loopd
  117. hloope    equ    mbase+loope
  118. hloopf    equ    mbase+loopf
  119. hlpa    equ    mbase+lpa
  120. hlpb    equ    mbase+lpb
  121. hlpc    equ    mbase+lpc
  122. hlpd    equ    mbase+lpd
  123. hlpe    equ    mbase+lpe
  124. hlpf    equ    mbase+lpf
  125. hlpg    equ    mbase+lpg
  126. hlph    equ    mbase+lph
  127. ;
  128.     end    start
  129.