diff --git a/array.s b/array.s index ed1d846..5c1045c 100644 --- a/array.s +++ b/array.s @@ -21,6 +21,10 @@ L2FAF: NEG32768: .byte $90,$80,$00,$00 +.ifdef MICROTAN + .byte 0 +.endif + ; ---------------------------------------------------------------------------- ; EVALUATE NUMERIC FORMULA AT TXTPTR ; CONVERTING RESULT TO INTEGER 0 <= X <= 32767 diff --git a/defines_apple.s b/defines_apple.s index ab5ae1d..60b3d09 100644 --- a/defines_apple.s +++ b/defines_apple.s @@ -5,6 +5,7 @@ CBM2_KIM_APPLE := 1 ; OUTDO difference CBM1_APPLE := 1 CBM_APPLE := 1 KIM_APPLE := 1 +APPLE_MICROTAN := 1 CONFIG_SCRTCH_ORDER := 1 CONFIG_PRINT_CR := 1 ; print CR when line end reached CONFIG_IO_MSB := 1 ; all I/O has bit #7 set diff --git a/defines_microtan.s b/defines_microtan.s index af4bb7e..e94bbc5 100644 --- a/defines_microtan.s +++ b/defines_microtan.s @@ -7,6 +7,7 @@ KIM_APPLE := 1 CBM2_MICROTAN := 1 KBD_MICROTAN := 1 KIM_MICROTAN := 1 +APPLE_MICROTAN := 1 CONFIG_2 := 1 @@ -21,12 +22,12 @@ ZP_START = $85 JMPADRS = DSCLEN + 1 LOWTRX = LOWTR -Z00 := $0000 +Z00 := $0017 L0001 := $0001 L0002 := $0002 -GOWARM := $0003 -GOSTROUT := $0006 -GOGIVEAYF := $0008 +GOWARM := $001A +GOSTROUT := $001D +GOGIVEAYF := $001F CHARAC := $000A+$1A ENDCHR := $000B+$1A @@ -43,7 +44,7 @@ POSX := $0016+$1A Z17 := $0017+$1A Z18 := $0018+$1A LINNUM := $0019+$1A -TXPSV := $0019+$1A +TXPSV := $00BA INPUTBUFFER := $001B+$1A INPUTBUFFERX := $0000 @@ -63,7 +64,10 @@ SAVE := $AAAA LOAD := $AAAA LE21C := $AAAA LC3F0 := $AAAA -LFE73 := $AAAA -LFE75 := $AAAA -LFDFA := $AAAA LE219 := $AAAA +LE21F := $AAAA + +LFDFA := $FDFA +LFE73 := $FE73 +LFE75 := $FE75 +L000A := $0A \ No newline at end of file diff --git a/eval.s b/eval.s index 8123cc7..21b02f3 100644 --- a/eval.s +++ b/eval.s @@ -240,12 +240,12 @@ FRM_STACK2: tay pla sta INDEX -.ifndef KBD +.ifndef KBD_MICROTAN inc INDEX ; bug: assumes not on page boundary .endif pla sta INDEX+1 -.ifdef KBD +.ifdef KBD_MICROTAN inc INDEX bne LEB69 inc INDEX+1 @@ -448,18 +448,18 @@ FRM_VARIABLE_CALL = *-1 ldx VALTYP beq L2DB1 .ifdef CONFIG_CBM_ALL -.ifdef CONFIG_CBM1_PATCHES + .ifdef CONFIG_CBM1_PATCHES jmp PATCH2 clc LCE3B: -.else + .else ldx #$00 stx $6D bit $62 bpl LCE53 cmp #$54 bne LCE53 -.endif + .endif cpy #$C9 bne LCE53 jsr LCE76 @@ -473,7 +473,7 @@ LCE3B: jmp LD353 LCE53: .endif -.ifdef KBD +.ifdef KBD_MICROTAN ldx #$00 stx STRNG1+1 .endif diff --git a/float.s b/float.s index b4ed01b..4250cfc 100644 --- a/float.s +++ b/float.s @@ -131,8 +131,8 @@ L369B: sbc 4,x sta FAC+4 .endif - lda GOWARM,y - sbc GOWARM,x + lda 3,y + sbc 3,x sta FAC+3 lda 2,y sbc 2,x @@ -169,8 +169,8 @@ L36C7: .endif sty FACEXTENSION adc #$08 -.ifdef KBD - cmp #$20 +.ifdef KBD_MICROTAN + cmp #(MANTISSA_BYTES+1)*8 .else cmp #MANTISSA_BYTES*8 .endif @@ -235,7 +235,7 @@ NORMALIZE_FAC5: NORMALIZE_FAC6: inc FAC beq OVERFLOW -.ifndef KIM +.ifndef KIM_MICROTAN ror FAC+1 ror FAC+2 ror FAC+3 @@ -372,7 +372,7 @@ SHIFT_RIGHT: tay lda FACEXTENSION bcs SHIFT_RIGHT5 -.ifndef KIM +.ifndef KIM_MICROTAN LB588: asl 1,x bcc LB58E @@ -387,9 +387,9 @@ LB58E: SHIFT_RIGHT4: ror 2,x ror 3,x -.ifndef CONFIG_SMALL + .ifndef CONFIG_SMALL ror 4,x -.endif + .endif ror a iny bne LB588 @@ -577,7 +577,7 @@ L38A7: adc ARG+1 sta RESULT L38C3: -.ifndef KIM +.ifndef KIM_MICROTAN ror RESULT ror RESULT+1 .ifdef APPLE @@ -1224,7 +1224,7 @@ FIN3: beq FIN4 bne FIN6 L3BA6: -.ifndef KIM +.ifndef KIM_MICROTAN ror EXPSGN .else lda #$00 @@ -1251,7 +1251,7 @@ FIN6: ; FOUND A DECIMAL POINT ; ---------------------------------------------------------------------------- FIN10: -.ifndef KIM +.ifndef KIM_MICROTAN ror LOWTR .else lda #$00 @@ -1488,17 +1488,9 @@ L3CBE: ldx #$01 lda INDX clc -.ifdef CONFIG_SMALL - adc #$07 -.else - adc #$0A -.endif + adc #3*BYTES_FP-5 bmi L3CD3 -.ifdef CONFIG_SMALL - cmp #$08 -.else - cmp #$0B -.endif + cmp #3*BYTES_FP-4 bcs L3CD4 adc #$FF tax diff --git a/init.s b/init.s index 97f9d6c..c7888a1 100644 --- a/init.s +++ b/init.s @@ -59,7 +59,7 @@ COLD_START2: sta GOWARM sta JMPADRS .endif -.ifdef APPLE +.ifdef APPLE_MICROTAN sta L000A .endif .ifdef CONFIG_SMALL @@ -135,13 +135,15 @@ L4098: .endif pha sta Z14 -.ifdef CONFIG_2 +.ifdef CBM2_KBD inx stx $01FD stx $01FC .else + .ifndef MICROTAN lda #$03 sta DSCLEN + .endif .ifndef KIM_APPLE lda #$2C sta LINNUM+1 @@ -172,7 +174,7 @@ L4098: tay bne L40EE .endif -.ifndef CONFIG_2 +.ifndef CBM2_KBD lda #RAMSTART2 @@ -182,7 +184,7 @@ L4098: .endif sta LINNUM sty LINNUM+1 -.ifdef CONFIG_2 +.ifdef CBM2_KBD tay .else ldy #$00 @@ -196,7 +198,7 @@ L40D7: cmp #$80 beq L40FA .endif -.ifdef CONFIG_2 +.ifdef CBM2_KBD bmi L40FA .endif L40DD: @@ -233,8 +235,10 @@ L40FA: ldy LINNUM+1 sta MEMSIZ sty MEMSIZ+1 +.ifndef MICROTAN sta FRETOP sty FRETOP+1 +.endif L4106: .ifndef CONFIG_CBM_ALL .ifdef APPLE diff --git a/input.s b/input.s index b214830..d5d820b 100644 --- a/input.s +++ b/input.s @@ -232,13 +232,19 @@ PROCESS_INPUT_ITEM: .endif sta INPUTBUFFER .ifdef CONFIG_INPUTBUFFER_ORDER +; the order is about whether +; the beq/bne is taken or not ldy #>(INPUTBUFFER-1) ldx #<(INPUTBUFFER-1) .else ldx #<(INPUTBUFFER-1) ldy #>(INPUTBUFFER-1) .endif + .ifdef MICROTAN + beq L2AF8 + .else bne L2AF8 + .endif L2AF0: .endif bmi FINDATA diff --git a/orig/microtan.bin b/orig/microtan.bin index f36c395..82c02a9 100644 Binary files a/orig/microtan.bin and b/orig/microtan.bin differ diff --git a/poke.s b/poke.s index 117a86c..227e3de 100644 --- a/poke.s +++ b/poke.s @@ -44,7 +44,7 @@ GETADR: ; "PEEK" FUNCTION ; ---------------------------------------------------------------------------- PEEK: -.ifdef CBM2 +.ifdef CBM2_MICROTAN lda LINNUM+1 pha lda LINNUM @@ -71,7 +71,7 @@ LD6F3: .endif lda (LINNUM),y tay -.ifdef CBM2 +.ifdef CBM2_MICROTAN pla sta LINNUM pla diff --git a/program.s b/program.s index 87b4f22..5558e1c 100644 --- a/program.s +++ b/program.s @@ -806,54 +806,54 @@ LIST: L25A6: jsr CRDO .else -.ifdef MICROTAN + .ifdef MICROTAN php jmp LE21C LC57E: -.else + .else bcc L2581 beq L2581 cmp #TOKEN_MINUS bne L256A L2581: jsr LINGET -.endif + .endif jsr FNDLIN -.ifdef MICROTAN + .ifdef MICROTAN plp beq LC598 -.endif + .endif jsr CHRGOT beq L2598 cmp #TOKEN_MINUS bne L2520 jsr CHRGET -.ifdef MICROTAN + .ifdef MICROTAN beq LC598 jsr LINGET beq L25A6 rts LC598: -.else + .else jsr LINGET bne L2520 -.endif + .endif L2598: -.ifndef MICROTAN + .ifndef MICROTAN pla pla lda LINNUM ora LINNUM+1 bne L25A6 -.endif + .endif lda #$FF sta LINNUM sta LINNUM+1 -.ifdef MICROTAN - pla - pla -.endif L25A6: + .ifdef MICROTAN + pla + pla + .endif .endif ldy #$01 .ifdef CONFIG_DATAFLAG @@ -861,7 +861,11 @@ L25A6: .endif lda (LOWTRX),y beq L25E5 +.ifdef MICROTAN + jmp LE21F ; C5A6 4C 1F E2 L.. +.else jsr ISCNTC +.endif .ifndef KBD jsr CRDO .endif diff --git a/trig.s b/trig.s index 9511200..eae7633 100644 --- a/trig.s +++ b/trig.s @@ -115,16 +115,16 @@ POLY_SIN: .byte $07,$FB,$F8,$87,$99,$68,$89,$01 .byte $87,$23,$35,$DF,$E1,$86,$A5,$5D .byte $E7,$28,$83,$49,$0F,$DA,$A2 -.ifndef CONFIG_CBM_ALL -MICROSOFT: - .byte $A6,$D3,$C1,$C8,$D4,$C8,$D5,$C4 - .byte $CE,$CA -.endif -.ifdef CBM2 + .ifdef CBM2_MICROTAN MICROSOFT: .byte $A1,$54,$46,$8F,$13,$8F,$52,$43 .byte $89,$CD -.endif + .elseif .def(CONFIG_CBM_ALL) + .else +MICROSOFT: + .byte $A6,$D3,$C1,$C8,$D4,$C8,$D5,$C4 + .byte $CE,$CA + .endif .endif ; ----------------------------------------------------------------------------