See BeebWiki .ForceHardReset LDA #&8F:LDX #&0C LDY #&FF:JSR OSBYTE ; Claim NMIs LDA #&40:STA &D00 ; Disable NMIs SEI:CLD ; Disable IRQs, ensure binary mode LDX #&FF:TXS ; Reset stack LDX #&0F:STX &FE42 ; SysVIA PostB=iiiioooo .LDA08 DEX:STX &FE40 ; Write I/O latch CPX #&09:BCS LDA08 ; Loop to set up internal I/O INX ; X=9 .LDA11 TXA:JSR LF02A ; KeyScan for key X, test links and CTRL CPX #&80:ROR &FC ; Rotate keystate in bit 7 into &FC TAX:DEX:BNE LDA11 ; Loop for key 9 to key 1 STX &028D ; Clear last BREAK flag ROL &FC ; CTRL is now in carry, &FC is keyboard links SEC ; Set CTRL pressed JMP LDA22 ; Jump to RESET code