# File: mem_dump.src
#	
# HISTORY:
#       Written Aug-96 (?) by D.Mathur
#       15-Nov-96 (MDM) - Modified to do the low portion of the address
#                         properly
#	19-Nov-96 (MDM) - Changed size of downlink from 0x30008 to 0x39999
#			- Changed wait from 120 sec to 65 sec
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/dev/src/mem_dump.src"
descr "mem_dump - Menu tool to select a page to be dumped"

display " "

set !LI9 = getint(mksqintc)
if !LI9 > 85 then 
    goto skip
end if
if !LI9 < 8  then 
    goto skip
end if

set !LI9 = getint(mksqrg3)
if !LI9 = 0 then
    display "Exiting...High Rate channel unavailable"
    return
end if

ask !LI0  "Enter Page to be dumped"

set !LI1 = !LI0 * 2048
for !LI9 = 0 to 5
    set !LI2 = !LI9 * 0x39999
    set !LI3 = !LI2 / 0x10000           ## high word of addr
    set !LI6 = !LI3 * 0x10000
    set !LI4 = !LI2 - !LI6              ## low word of addr
    set !LI5 = !LI3 + !LI1              ## high word of addr + page #
    tcblock mbipldin 0x1b2 1860 4 0x0001 0x4000 !LI4   !LI5
    tcblock mbipldin 0x1b2 1864 5 0x9999 0x0003 0x0000 0x6500 0x0000
    tcblock mbipldin 0x140 1804 1
    display "Dumping from address: %6x" !LI2
    wait time 65
end for

skip:
display "Exiting...Too close to ALT time"
return
