Tippery * Date : * Description: Solves " 100 Doors " problem, see : http : ///wiki/100_doors * Notes : Translated from C " Unoptimized " version, http : ///wiki/100_doors#unoptimized * : No optimizations done relative to C version "for("-equivalent loops could be optimized. *- * Title : 100 Doors.X68 * Written by : G. bytes of code the specified emulator does not report cycles. Finally, format array values for output: 0 for closed, 1 for openĤ8. STY 01 Add stride (Y) to index (X, via A) INC $200,X Toggle bit 0 to reverse state of door Zero Page address $01 used to add Stride to Index (via A) because there's no add-to-X or add-Y-to-A instruction. $0200 (door 0) is cleared for display purposes but is not involved in the open/close loops. be directly shown as pixels in the display. On the specified emulator, this is in video memory, so tbe results will Based on BASIC QB64 unoptimized version: NMOS version of the 6502, but should work with any version. Written for the original MOS Technology, Inc. 100 DOORS in 6502 assembly language for:
0 Comments
Leave a Reply. |