I wrote a program today. It isn't quite working yet but it demonstrates an idea which I hope to make practical. In the meantime, perhaps you'll enjoy puzzling it out(*):
Code:
0100 78 .init SEI
0101 A0 64 LDY #100
0103 .outerhi
0103 A2 30 LDX #48
0105 A9 2A .innerhi LDA #42
0107 20 3B 01 JSR loop5
010A A9 0E LDA #14
010C 20 74 01 JSR loop15
010F CA DEX
0110 D0 F3 BNE innerhi
0112 A2 18 LDX #24
0114 A9 2A .innerlo LDA #42
0116 20 3B 01 JSR loop5
0119 20 3B 01 JSR loop5
011C A9 0E LDA #14
011E 20 74 01 JSR loop15
0121 20 74 01 JSR loop15
0124 CA DEX
0125 D0 ED BNE innerlo
0127 88 DEY
0128 D0 D9 BNE outerhi
012A 58 CLI
012B 60 RTS
012C 4C 00 00 JMP0
012F 4C 00 00 JMP0
0132 4C 00 00 JMP0
0135 4C 00 00 JMP0
0138 26 00 ROL0
013A 38 .go5 SEC
013B E9 01 .loop5 SBC #1
013D 4C 40 01 JMP skip5
0140 EA .skip5 NOP
0141 D0 F8 BNE loop5
0143 60 RTS
0144 4C 00 00 JMP0
0147 4C 00 00 JMP0
014A 4C 00 00 JMP0
014D 4C 00 00 JMP0
0150 4C 00 00 JMP0
0153 4C 00 00 JMP0
0156 4C 00 00 JMP0
0159 4C 00 00 JMP0
015C 4C 00 00 JMP0
015F 4C 00 00 JMP0
0162 4C 00 00 JMP0
0165 4C 00 00 JMP0
0168 4C 00 00 JMP0
016B 4C 00 00 JMP0
016E 4C 00 00 JMP0
0171 4C 00 00 JMP0
0174 38 .loop15 SEC
0175 B0 00 BCS skip15a
0177 E9 01 .skip15a SBC #1
0179 4C 7C 01 JMP skip15b
017C EA .skip15b NOP
017D 4C 80 01 JMP skip15c
0180 EA .skip15c NOP
0181 4C 84 01 JMP skip15d
0184 EA .skip15d NOP
0185 4C 88 01 JMP skip15e
0188 EA .skip15e NOP
0189 D0 E9 BNE loop15
018B 60 RTS
In case you speak BBC Basic, here's the source:
Code:
NEW
AUTO
FOR pass=0 TO 3 STEP 3
P%=&0100
[OPT pass
.init SEI:LDY #100
.outerhi
LDX #48
.innerhi LDA #42:JSR loop5
LDA #14:JSR loop15
DEX:BNE innerhi
LDX #24
.innerlo LDA #42:JSR loop5:JSR loop5
LDA #14:JSR loop15:JSR loop15
DEX:BNE innerlo
DEY:BNE outerhi:CLI:RTS
JMP0:JMP0:JMP0:JMP0:ROL0
.go5 SEC
.loop5 SBC #1:JMP skip5
.skip5 NOP:BNE loop5:RTS
JMP0:JMP0:JMP0:JMP0:JMP0:JMP0:JMP0:JMP0
JMP0:JMP0:JMP0:JMP0:JMP0:JMP0:JMP0:JMP0
.loop15 SEC:BCS skip15a
.skip15a SBC #1:JMP skip15b
.skip15b NOP:JMP skip15c
.skip15c NOP:JMP skip15d
.skip15d NOP:JMP skip15e
.skip15e NOP:BNE loop15
RTS
]
NEXT pass
(It's an unusual kind of program, but it's not an April Fool - this is the whole thing.)
(*) In the interests of not spoiling anyone else's enjoyment, please use rot13.com or otherwise obfuscate your findings.