ADIM161 PLA STA RETADR PLA STA RETADR+1 PLA STA :FILL PLA STA :ESIZE STA :ESZBAK PLA STA :ASIZE STA :ASZBAK PLA STA :ASIZE+1 STA :ASZBAK+1 STA SCRATCH PLA STA ADDR1 STA ADDR2 PLA STA ADDR1+1 STA ADDR2+1 LDY #0 LDA #0 BEQ :ENTLP :DOADD CLC ADC :ASIZE TAX TYA ADC SCRATCH TAY TXA :LP ASL :ASIZE ROL SCRATCH :ENTLP LSR :ESIZE BCS :DOADD BNE :LP CLC INX INX BCC :NOINY INY :NOINY STX :MSIZE STY :MSIZE+1 LDA :FILL LDX :MSIZE+1 BEQ :PART LDY #0 :FULL STA (ADDR1),Y INY BNE :FULL INC ADDR1+1 DEX BNE :FULL :PART LDX :MSIZE BEQ :MFEXIT LDY #0 :PARTLP STA (ADDR1),Y INY DEX BNE :PARTLP :MFEXIT LDY #0 LDA :ASZBAK STA (ADDR2),Y INY LDA :ASZBAK+1 STA (ADDR2),Y INY LDA :ESZBAK STA (ADDR2),Y LDA RETADR+1 PHA LDA RETADR PHA LDY ADDR1 LDX ADDR1+1 LDA :ASZBAK LDA :MSIZE STA RETURN LDA :MSIZE+1 STA RETURN+1 LDA #2 STA RETLEN RTS :MSIZE DS 2 :ASIZE DS 2 :ESIZE DS 1 :ASZBAK DS 2 :ESZBAK DS 1 :FILL DS 1