C1/5C36: C2 31 REP #$31 Set and clear flags C1/5C38: 0B PHD C1/5C39: 48 PHA C1/5C3A: 7B TDC C1/5C3B: 69 EE FF ADC #$FFEE C1/5C3E: 5B TCD C1/5C3F: 68 PLA C1/5C40: 8A TXA Argument in the accumulator C1/5C41: 20 D5 2B JSR $2BD5 C1/5C44: 85 06 STA $06 C1/5C46: 64 08 STZ $08 C1/5C48: A5 06 LDA $06 C1/5C4A: 85 0E STA $0E C1/5C4C: A5 08 LDA $08 C1/5C4E: 85 10 STA $10 C1/5C50: 20 5D 04 JSR $045D C1/5C53: A9 00 00 LDA #$0000 C1/5C56: 2B PLD C1/5C57: 60 RTS C1/2BD5: C2 31 REP #$31 Set and clear flags C1/2BD7: C9 00 00 CMP #$0000 See if we're loading the argument from argumentary C1/2BDA: D0 03 BNE $2BDF C1/2BDC: AD 58 89 LDA $8958 C1/2BDF: 0A ASL Multiply the argument by two C1/2BE0: AA TAX Copy the doubled argument into the X register C1/2BE1: BD E4 88 LDA $88E4,X Load from the WindowExt table C1/2BE4: A0 52 00 LDY #$0052 Put 0x52 in the Y register C1/2BE7: 22 F7 8F C0 JSR $C08FF7 C1/2BEB: AA TAX Accumulator -> X register C1/2BEC: BD 7B 86 LDA $867B,X Load the accumulator with $7E867B + xx52? Or something? C1/2BEF: 20 8D 13 JSR $138D I haven't had enough fun yet; let's do a jump. C1/2BF2: 60 RTS C0/8FF7: C2 10 REP #$10 Coming in, A = condition of window $XX, Y = 0x52; set 16-bit mode C0/8FF9: EB XBA Swap accumulator bytes C0/8FFA: F0 26 BEQ $9022 Essentially, branch if window $XX is less than the 256th open window C0/8FFC: E2 20 SEP #$20 (Not bothering with the rest here, who the hell has 256 windows?) C0/8FFE: EB XBA C0/8FFF: 48 PHA C0/9000: 98 TYA C0/9001: C2 20 REP #$20 C0/9003: 8F 02 42 00 STA $004202 C0/9007: EA NOP C0/9008: EA NOP C0/9009: AF 16 42 00 LDA $004216 C0/900D: A8 TAY C0/900E: E2 20 SEP #$20 C0/9010: 68 PLA C0/9011: 8F 03 42 00 STA $004203 C0/9015: C2 20 REP #$20 C0/9017: 98 TYA C0/9018: EB XBA C0/9019: 29 00 FF AND #$FF00 C0/901C: 18 CLC C0/901D: 6F 16 42 00 ADC $004216 C0/9021: 6B RTL C0/9022: E2 20 SEP #$20 Set 8-bit accumulator mode C0/9024: 98 TYA And transfer 0x52 to the accumulator (window still in highbyte) C0/9025: C2 20 REP #$20 Set 16-bit accumulator mode C0/9027: 8F 02 42 00 STA $004202 Result thusfar: C0/902B: EA NOP Store XX52 to $4202 and $4216, where XX is the position in C0/902C: EA NOP the window stack of the window supplied as an argument C0/902D: AF 16 42 00 LDA $004216 C0/9031: 6B RTL