22 scripts source code–write_reconnect label, 23 scripts source code–reserve_unit label, 24 scripts source code–release_unit command – Avago Technologies LSI53C1010 User Manual
Page 264
![background image](https://www.manualsdir.com/files/864554/content/doc264.png)
11-14
Using the SCRIPTS Processor in Target Applications
The
write_reconnect
label,
, operates the same as
read_reconnect
.
Figure 11.22 SCRIPTS Source Code–write_reconnect Label
The
reserve_unit
label,
, sets a reservation flag, gets the
ID of the initiator that sent the command, jumps to Test Unit Ready, and
completes the command.
Figure 11.23 SCRIPTS Source Code–reserve_unit Label
The
release_unit
command,
, clears the reserved flag and
goes to Test Unit Ready.
Figure 11.24 SCRIPTS Source Code–release_unit Command
The
abort
label turns off the halt on parity or ATN bit, and disconnects
from the bus, as shown in
. The chip executes this command
when it receives an Abort message for the command in process. The
interrupt service routine then cleans up the job.
write_reconnect:
reselect from selector_id, rel(alt_got_selected) ;reselect the initiator
move scntl1 & 0xdf to scntl1
;turns on the halt on parity
;error or atn
move from identify_msg_in_buf, with msg_in
;move in identify message
move scratchb1 to sfbr
;get the 'finished' flag
jump rel(tur) if 0x00
;jump to status and message
;if transfer complete
jump rel(write_return)
;jump to get data
reserve_unit:
move 0x01 to scratchb2
;set 'reserved' in reservation flag
move ssid & 0x7f to sfbr
;get the ID of who reserved us
move sfbr to scratchb3
;move ID into storage buffer
jump rel(tur)
;go to status and message
release_unit:
move 0x00 to scratchb2
;set 'not reserved' in reservation flag
jump rel(tur)
;go to status and message