uptown47
Lifetime Supporting Member
Hi all,
I'm trying to convert a "DO" instruction in S5.
I was always told there was no easy way to do this but the in-built S5-S7 converter did it without complaint. I just wondered if someone could confirm that what it has come up with is correct and I also have a question as to why it has transferred the Status Word to the accumulator during the procedure.
I'll show the old S5 code and then the new S7 code as per the in-built converter:
Anyone any ideas with regards the questions here and whether this will actually perform as per the S5 code?
Many thanks for anyone who can get their head around this!
Cheers
;-)
I'm trying to convert a "DO" instruction in S5.
I was always told there was no easy way to do this but the in-built S5-S7 converter did it without complaint. I just wondered if someone could confirm that what it has come up with is correct and I also have a question as to why it has transferred the Status Word to the accumulator during the procedure.
I'll show the old S5 code and then the new S7 code as per the in-built converter:
Code:
Old S5 code:
L KF+20
L DW 70
+F
T FW 194
C DB 10
DO FW 194
L DW 0
C DB 99
DO DW 99
A F 0.0
= F 254.7
The S7 in-built converter came up with the following conversion:
L 20
L DBW 140
+I
T MW 194
OPN DB 10
T #conv_akku1 (a temp double word)
L STW (why are we loading the Status Word into the accumulator??)
T #conv_stw (a temp word)
L MB 195 (why are we only loading the byte and not the full word??)
SLW 4
LAR1
L #conv_stw
T STW (putting the status word back - but why ??)
L #conv_akku1
L DBW[AR1,P#0.0]
OPN DB 100
T DBW 198
T #conv_akku1
TAK
T #conv_akku2
L STW
T #conv_stw
L DBB 198
SLW 13
SRW 13 (why shift left and then shift right??)
L DBB 199
SLW 3
OW
LAR1
L #conv_stw
T STW (again? Why?)
L #conv_akku2
L #conv_akku1
A M[AR1,P#0.0]
= M254.7
Anyone any ideas with regards the questions here and whether this will actually perform as per the S5 code?
Many thanks for anyone who can get their head around this!
Cheers
;-)