CHECK START ; Argument ok ST GR1,ARG1 ; Argument steps ST GR2,ARG2 ; Argument field ST GR3,ARG3 ; For i = 0 To 15 Step 1 XOR GR7,GR7 ST GR7,I001 J001 NOP LD GR1,I001 CPA GR1,=15 JPL J003 ; If (field(i) <> ((i + 1) And 15)) Then LD GR7,I001 LD GR1,GR7 LAD GR2,16 CALL C013 LD GR7,ARG3 ADDL GR7,GR0 LD GR7,0,GR7 LD GR6,I001 LAD GR6,1,GR6 AND GR6,=15 SUBA GR7,GR6 JZE J008 LAD GR7,#FFFF J008 NOP AND GR7,GR7 JZE J004 ; ok = False XOR GR7,GR7 LD GR6,ARG1 ST GR7,0,GR6 ; Exit Sub JUMP EXIT ; 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 ; ok = True LAD GR7,#FFFF LD GR6,ARG1 ST GR7,0,GR6 EXIT NOP RET ; ByRef ok As Boolean [GR1] ARG1 DS 1 ; ByVal steps As Integer [GR2] ARG2 DS 1 ; ByRef field(15) As Integer [GR3] ARG3 DS 1 ; Dim i As Integer I001 DS 1 ; UtilSafeIndex C013 AND GR2,GR2 JNZ J005 XOR GR0,GR0 RET J005 LD GR0,GR1 JPL J006 XOR GR0,GR0 RET J006 CPL GR0,GR2 JMI J007 LAD GR0,-1 ADDL GR0,GR2 J007 RET END