PLAY START RPUSH ; Argument field1 ST GR1,ARG1 ST GR2,ARG2 ; Argument field2 ST GR3,ARG3 ST GR4,ARG4 ; Init Variable XOR GR0,GR0 ST GR0,I001 ; For i = 0 To (Len(field1) - 1) Step 1 LD GR7,ARG1 LD GR7,0,GR7 LAD GR7,-1,GR7 ST GR7,T001 XOR GR7,GR7 ST GR7,I001 J001 NOP LD GR1,I001 CPA GR1,T001 JPL J003 ; If ((field1(i - 1) + field1(i + 1)) = ("*"c + "."c)) Then LD GR7,I001 LAD GR7,-1,GR7 LD GR1,GR7 LD GR2,ARG1 LD GR2,0,GR2 LD GR3,ARG2 CALL C011 LD GR7,GR0 LD GR6,I001 LAD GR6,1,GR6 LD GR1,GR6 LD GR2,ARG1 LD GR2,0,GR2 LD GR3,ARG2 CALL C011 LD GR6,GR0 ADDA GR7,GR6 LD GR6,='*' ADDA GR6,='.' SUBA GR7,GR6 JZE J010 LAD GR7,#FFFF J010 XOR GR7,=#FFFF AND GR7,GR7 JZE J005 ; field2( i ) = "*"c LD GR7,I001 LD GR1,GR7 LD GR2,ARG3 LD GR2,0,GR2 CALL C013 LD GR7,ARG4 ADDL GR7,GR0 LD GR6,='*' ST GR6,0,GR7 JUMP J004 ; Else J005 NOP ; field2( i ) = "."c LD GR7,I001 LD GR1,GR7 LD GR2,ARG3 LD GR2,0,GR2 CALL C013 LD GR7,ARG4 ADDL GR7,GR0 LD GR6,='.' ST GR6,0,GR7 ; End If J004 NOP ; Next i J002 NOP LAD GR1,I001 LD GR2,0,GR1 LAD GR2,1,GR2 ST GR2,0,GR1 JUMP J001 J003 NOP EXIT NOP RPOP RET ; ByRef field1 As String [GR1,GR2] ARG1 DS 1 ARG2 DS 1 ; ByRef field2 As String [GR3,GR4] ARG3 DS 1 ARG4 DS 1 ; Dim i As Integer I001 DS 1 T001 DS 1 ; UtilLoadElement C011 AND GR2,GR2 JNZ J006 XOR GR0,GR0 RET J006 CALL C013 PUSH 0,GR3 ADDL GR3,GR0 LD GR0,0,GR3 POP GR3 RET ; UtilSafeIndex C013 AND GR2,GR2 JNZ J007 XOR GR0,GR0 RET J007 LD GR0,GR1 JPL J008 XOR GR0,GR0 RET J008 CPL GR0,GR2 JMI J009 LAD GR0,-1 ADDL GR0,GR2 J009 RET END