$CE71/52849:   Divide by 120

Jump from $CE18:

CE71: A9 78     LDA #$78
CE73: 85 6F     STA $6F         ; divisor
CE75: A2 03     LDX #$03

Jump from $CE82:

CE77: B5 8F     LDA $8F,X
CE79: 48        PHA
CE7A: B5 8A     LDA $8A,X
CE7C: 95 8F     STA $8F,X
CE7E: 68        PLA
CE7F: 95 8A     STA $8A,X
CE81: CA        DEX
CE82: D0 F3     BNE $CE77
CE84: 20 D9 CE  JSR $CED9       ; erase work storage

Jump from $CEC3:

CE87: A2 00     LDX #$00

Jump from $CE90:

CE89: B5 90     LDA $90,X
CE8B: 95 8F     STA $8F,X
CE8D: E8        INX
CE8E: E0 04     CPX #$04
CE90: 90 F7     BCC $CE89
CE92: A9 00     LDA #$00
CE94: 85 92     STA $92
CE96: 24 6F     BIT $6F
CE98: 30 09     BMI $CEA3
CE9A: 06 8F     ASL $8F
CE9C: 08        PHP
CE9D: 46 8F     LSR $8F
CE9F: 28        PLP
CEA0: 20 E6 CE  JSR $CEE6       ; shift register 1 left

Jump from $CE98:

CEA3: 20 ED CE  JSR $CEED       ; add register 0 to register 1
CEA6: 20 E5 CE  JSR $CEE5       ; shift register 1 left
CEA9: 24 6F     BIT $6F
CEAB: 30 03     BMI $CEB0
CEAD: 20 E2 CE  JSR $CEE2       ; left-shift register 1 twice

Jump from $CEAB:

CEB0: A5 8F     LDA $8F
CEB2: 18        CLC
CEB3: 65 90     ADC $90
CEB5: 85 90     STA $90
CEB7: 90 06     BCC $CEBF
CEB9: E6 91     INC $91
CEBB: D0 02     BNE $CEBF
CEBD: E6 92     INC $92

Jump from $CEB7, $CEBB:

CEBF: A5 92     LDA $92
CEC1: 05 91     ORA $91
CEC3: D0 C2     BNE $CE87
CEC5: A5 90     LDA $90
CEC7: 38        SEC
CEC8: E5 6F     SBC $6F         ; quotient in $8B/$8C/$8D
CECA: 90 0C     BCC $CED8
CECC: E6 8B     INC $8B
CECE: D0 06     BNE $CED6
CED0: E6 8C     INC $8C
CED2: D0 02     BNE $CED6
CED4: E6 8D     INC $8D

Jump from $CECE, $CED2:

CED6: 85 90     STA $90         ; remainder in $90

Jump from $CECA:

CED8: 60        RTS

    Previous Page / Next Page