INIT START RPUSH ; Argument field1 ST GR1,ARG1 ST GR2,ARG2 ; Argument field2 ST GR3,ARG3 ST GR4,ARG4 ; Argument speed ST GR5,ARG5 ; Init Variables LAD GR1,B005 XOR GR2,GR2 LAD GR3,5 CALL C010 ; Print "Seed? (1 - 999)" OUT LB001,LL001 ; Input seed IN TB001,TL001 XOR GR0,GR0 ST GR0,EOF LAD GR1,TB001 LD GR2,TL001 JPL J004 JZE J004 ST GR2,EOF XOR GR2,GR2 J004 CALL C000 ST GR0,I003 ; Call RAND ; ByVal init As Boolean [GR1] ; init = True LAD GR7,#FFFF ST GR7,T001 ; ByRef value As Integer [GR2] ; value = Max(101, Min(1099, (seed + 100))) LAD GR7,101 LAD GR6,1099 LD GR5,I003 LAD GR5,100,GR5 CPA GR6,GR5 JMI J005 LD GR6,GR5 J005 NOP CPA GR7,GR6 JPL J006 LD GR7,GR6 J006 NOP ST GR7,T002 ; Set Arguments And Call RAND LD GR1,T001 LAD GR2,T002 CALL RAND ; field1 = String(64, "."c) LAD GR7,64 LD GR6,='.' LD GR3,GR6 LD GR1,GR7 LAD GR2,257 CALL C013 ST GR0,TL001 LAD GR1,TB001 LD GR2,GR3 LD GR3,GR0 CALL C010 LD GR1,ARG2 LD GR2,ARG1 LAD GR3,TB001 LD GR4,TL001 CALL C007 ; field2 = field1 LD GR1,ARG4 LD GR2,ARG3 LD GR3,ARG2 LD GR4,ARG1 LD GR4,0,GR4 CALL C007 ; For k = 1 To 100 Step 1 LAD GR7,1 ST GR7,I002 J014 NOP LD GR1,I002 CPA GR1,=100 JPL J016 ; For i = 0 To 63 Step 1 XOR GR7,GR7 ST GR7,I001 J017 NOP LD GR1,I001 CPA GR1,=63 JPL J019 ; value = 1000 LAD GR7,1000 ST GR7,I004 ; Call RAND ; ByVal init As Boolean [GR1] ; init = False XOR GR7,GR7 ST GR7,T001 ; ByRef value As Integer [GR2] ; value = value ; Set Arguments And Call RAND LD GR1,T001 LAD GR2,I004 CALL RAND ; If ((value And 28) = 0) Then LD GR7,I004 AND GR7,=28 XOR GR6,GR6 SUBA GR7,GR6 JZE J022 LAD GR7,#FFFF J022 XOR GR7,=#FFFF AND GR7,GR7 JZE J021 ; field1( (i And 63) ) = "*"c LD GR7,I001 AND GR7,=63 LD GR1,GR7 LD GR2,ARG1 LD GR2,0,GR2 CALL C013 LD GR7,ARG2 ADDL GR7,GR0 LD GR6,='*' ST GR6,0,GR7 JUMP J020 ; Else J021 NOP ; field1( (i And 63) ) = "."c LD GR7,I001 AND GR7,=63 LD GR1,GR7 LD GR2,ARG1 LD GR2,0,GR2 CALL C013 LD GR7,ARG2 ADDL GR7,GR0 LD GR6,='.' ST GR6,0,GR7 ; End If J020 NOP ; seed = (seed Xor value) LD GR7,I003 LD GR6,I004 XOR GR7,GR6 ST GR7,I003 ; Next i J018 NOP LAD GR1,I001 LD GR2,0,GR1 LAD GR2,1,GR2 ST GR2,0,GR1 JUMP J017 J019 NOP ; Call CHECK ; ByRef field As String [GR1,GR2] ; field = field1 ; ByRef over As Boolean [GR3] ; over = over ; Set Arguments And Call CHECK LD GR1,ARG1 LD GR2,ARG2 LAD GR3,B005 CALL CHECK ; If Not(over) Then LD GR7,B005 XOR GR7,=#FFFF AND GR7,GR7 JZE J023 ; Exit For JUMP J016 ; End If J023 NOP ; If ((k And 3) = 0) Then LD GR7,I002 AND GR7,=3 XOR GR6,GR6 SUBA GR7,GR6 JZE J025 LAD GR7,#FFFF J025 XOR GR7,=#FFFF AND GR7,GR7 JZE J024 ; Call RAND ; ByVal init As Boolean [GR1] ; init = True LAD GR7,#FFFF ST GR7,T001 ; ByRef value As Integer [GR2] ; value = seed ; Set Arguments And Call RAND LD GR1,T001 LAD GR2,I003 CALL RAND ; End If J024 NOP ; Next k J015 NOP LAD GR1,I002 LD GR2,0,GR1 LAD GR2,1,GR2 ST GR2,0,GR1 JUMP J014 J016 NOP ; Print "Speed? (1 - 30000)" OUT LB002,LL002 ; Input speed IN TB001,TL001 XOR GR0,GR0 ST GR0,EOF LAD GR1,TB001 LD GR2,TL001 JPL J026 JZE J026 ST GR2,EOF XOR GR2,GR2 J026 CALL C000 LD GR1,ARG5 ST GR0,0,GR1 ; speed = Max(1, Min(30000, speed)) LAD GR7,1 LAD GR6,30000 LD GR5,ARG5 LD GR5,0,GR5 CPA GR6,GR5 JMI J027 LD GR6,GR5 J027 NOP CPA GR7,GR6 JPL J028 LD GR7,GR6 J028 NOP LD GR6,ARG5 ST GR7,0,GR6 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 ; ByRef speed As Integer [GR5] ARG5 DS 1 ; Dim over As Boolean B005 DS 1 ; Dim i As Integer I001 DS 1 ; Dim k As Integer I002 DS 1 ; Dim seed As Integer I003 DS 1 ; Dim value As Integer I004 DS 1 EOF DS 1 T001 DS 1 T002 DS 1 TL001 DS 1 TB001 DS 256 LL001 DC 15 LB001 DC 'Seed? (1 - 999)' LL002 DC 18 LB002 DC 'Speed? (1 - 30000)' ; FuncCInt C000 PUSH 0,GR1 PUSH 0,GR2 PUSH 0,GR3 PUSH 0,GR4 PUSH 0,GR5 ADDL GR2,GR1 XOR GR0,GR0 XOR GR4,GR4 CPL GR1,GR2 JZE J001 LD GR3,0,GR1 CPL GR3,='+' JNZ J003 LAD GR1,1,GR1 JUMP J002 J003 CPL GR3,='-' JNZ J002 LAD GR4,-1 LAD GR1,1,GR1 J002 CPL GR1,GR2 JZE J001 LD GR3,0,GR1 SUBL GR3,='0' JMI J001 CPL GR3,=9 JPL J001 LD GR5,GR0 SLL GR0,3 ADDL GR0,GR5 ADDL GR0,GR5 ADDL GR0,GR3 LAD GR1,1,GR1 JUMP J002 J001 XOR GR0,GR4 SUBL GR0,GR4 POP GR5 POP GR4 POP GR3 POP GR2 POP GR1 RET ; UtilCopyStr C007 PUSH 0,GR1 PUSH 0,GR2 PUSH 0,GR3 PUSH 0,GR4 ST GR4,0,GR2 AND GR4,GR4 JZE J013 J012 LD GR2,0,GR3 ST GR2,0,GR1 LAD GR3,1,GR3 LAD GR1,1,GR1 SUBL GR4,=1 JPL J012 J013 POP GR4 POP GR3 POP GR2 POP GR1 RET ; UtilFill C010 PUSH 0,GR1 PUSH 0,GR2 PUSH 0,GR3 ADDL GR3,GR1 J010 CPL GR1,GR3 JZE J011 ST GR2,0,GR1 LAD GR1,1,GR1 JUMP J010 J011 POP GR3 POP GR2 POP GR1 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