# This patch is called from inside the script that build U/W FOCAL.
# So it modifies the UWF16K.SV file on RKA1 where it is built.

# The following patch fixes a problem if U/W FOCAL is started
# after another program has left the EAE in Mode B.
# For example, the FORTRAN IV runtime system ALWAYS does this!
# At location 5400 is a block of 20 Zeroes that apparently
# get populated with code to "CLEAR ANNOYING FLAGS".
# This seems a fit for that need.
# I expect device overlays would fill that in.
# The U/W FOCAL build we have at the moment has no such overlays.
# So we grab the first location and put in the following contents:
#  7447    SWBA  /SET MODE B
#  7000    NOP   /PREVIOUS INSTRUCTION IS DVI ON 8/I
#  7621    CAM   /CLEAR AC MQ AFTER DVI.

.GET RKA1 UWF16K.SV
.ODT
05400/0000 7447
05401/0000 7000
05402/0000 7621
\c
.SAVE RKA1 UWF16K.SV
