The code you have put in is a block move where the data parameters are sent in via the I/O parameters. It uses SCF20, a system Function for moving blocks of data.
L #START_ADDR // Probably an integer or word, this will be an IN, START_ADDR value is stored into ACCU1 (accumulator) and is pointing to the first word that is required to be moved.
T #SRCADDR // A Temp int or word, so ACCU1 is transferred into SCRADDR (basically START_ADD is transferred into SRCADDR via the accumulator), later code looks like a loop so perhaps this will change as the program loops.
L 0 // 0 is loaded into the accumulator
ADD: L W#16#1002 // ADD: is a jump label, 1002 HEX is added to the contents of the accumulator. NOTE 1002 is usually the first word of an ANY parameter (block address pointer), which stipulates Step 7 format (10) and the data is in Bytes (02).
T LW 0 // the contents of the accumulator are loaded into LW0 (LW0 is the first TEMP word directly addressed, this is usually seen as bad programming because if a modification is done where a new TEMP is put in before the curremt first TEMP, then this will then be a program error). I presume the first TEMP is in ANY format.
L #NO_BYTES //This will be another IN, which stipulates how many bytes will be moved.
T LW 2 // 2nd TEMP word, which is the second word in the ANY parameter (ANY = 10 bytes, or 5 words). This is the length field of the ANY.
L #SRC_DB // This is another IN, stipulating the Data block address.
T LW 4 // 3rd TEMP word, or 3rd word in the ANY parameter, which is Data Block Address.
L #SRCADDR // IN parameter, stipulating the start address of the block move
SLD 3 //The right hand 3 bits of the last two words in the ANY parameter are the bit address (000=bit 0 through to 111=bit 7), so this shilft left double is placing the byte address into the correct position in double word.
OD DW#16#84000000 // The first byte of the last two words in the ANY parameter is the data type, 84=data block. This OR's the value with the current conents of the accumulator, making ithe first byte 84.
T LD 6 // the result of the last few instructions is loaded into local double 6, which is the last two words of the ANY parameter, block type and start address.
The bold below is then repeating the same for the second ANY parameter, which is the second TEMP parameter defined.
L W#16#1002
T LW 10
L #NO_BYTES
T LW 12
L #DEST_DB
T LW 14
L #DEST_START_ADDR
SLD 3
OD DW#16#84000000
T LD 16
Below
BLKMOV = SFC20, system FC20 = Block Move.
SRCBLK = ANY parameter pointing to the start address to move and the length of data to move. Seen above that SANY is the first TEMP.
DSTBLK = ANY parameter pointing to the start address to receive and the length of data to receive. Seen above that DANY is the second TEMP.
CALL "BLKMOV"
SRCBLK :=#SANY
RET_VAL:=#RET_VAL
DSTBLK :=#DANY
Calls an FC, presume NM_BREAKER_1 is an IN?? "DEVICE" = DB in symbol format, NM_breaker is probably a bit in the DB, in symbol format.
CALL FC 2
NM_BREAKER_1:="DEVICE".NM_breaker
The data moved before is now transferred back
CALL "BLKMOV"
SRCBLK :=#DANY
RET_VAL:=#RET_VAL
DSTBLK :=#SANY
Below offsets the start address by the number of bytes moved.
L #SRCADDR
L #NO_BYTES
+I
T #SRCADDR
Below, increments device count, don't like this as I cannot see where device count was preset to zero before the start.
L #DEV_CNT
L 1
+I
T #DEV_CNT
Below, jump back to the label ADD: if all the devices have not been processed. If they have then jump to end. Not sure why they put the BLD there, normally for display purposes for ladder.
L #NODEV
>=I
JC A001
JU ADD
A001: BLD 130