OpenCores
URL https://opencores.org/ocsvn/rtf65002/rtf65002/trunk

Subversion Repositories rtf65002

[/] [rtf65002/] [trunk/] [software/] [asm/] [TinyBasic65002.asm] - Diff between revs 26 and 28

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 26 Rev 28
Line 46... Line 46...
CTRLS   EQU     0x13
CTRLS   EQU     0x13
CTRLX   EQU     0x18
CTRLX   EQU     0x18
XON             EQU     0x11
XON             EQU     0x11
XOFF    EQU     0x13
XOFF    EQU     0x13
 
 
CursorRow       EQU             0x7C2
CursorFlash     EQU             0xFC4
CursorCol       EQU             0x7C3
IRQFlag         EQU             0xFC6
CursorFlash     EQU             0x7C4
 
IRQFlag         EQU             0x7C6
OSSP            EQU             0xF00
 
TXTUNF          EQU             0xF01
OSSP            EQU             0x700
VARBGN          EQU             0xF02
TXTUNF          EQU             0x701
LOPVAR          EQU             0xF03
VARBGN          EQU             0x702
STKGOS          EQU             0xF04
LOPVAR          EQU             0x703
CURRNT          EQU             0xF05
STKGOS          EQU             0x704
BUFFER          EQU             0xF06
CURRNT          EQU             0x705
 
BUFFER          EQU             0x706
 
BUFLEN          EQU             84
BUFLEN          EQU             84
LOPPT           EQU             0x760
LOPPT           EQU             0xF60
LOPLN           EQU             0x761
LOPLN           EQU             0xF61
LOPINC          EQU             0x762
LOPINC          EQU             0xF62
LOPLMT          EQU             0x763
LOPLMT          EQU             0xF63
NUMWKA          EQU             0x764
NUMWKA          EQU             0xF64
STKINP          EQU             0x774
STKINP          EQU             0xF74
STKBOT          EQU             0x775
STKBOT          EQU             0xF75
usrJmp          EQU             0x776
usrJmp          EQU             0xF76
IRQROUT         EQU             0x777
IRQROUT         EQU             0xF77
 
 
 
 
 
 
                cpu     rtf65002
                cpu     rtf65002
                code
                code
                org             $FFFFE800
                org             $FFFFEC00
GOSTART:
GOSTART:
                jmp     CSTART  ;       Cold Start entry point
                jmp     CSTART  ;       Cold Start entry point
GOWARM:
GOWARM:
                jmp     WSTART  ;       Warm Start entry point
                jmp     WSTART  ;       Warm Start entry point
GOOUT:
GOOUT:
Line 340... Line 338...
;* Execution address tables:
;* Execution address tables:
; We save some bytes by specifiying only the low order 16 bits of the address
; We save some bytes by specifiying only the low order 16 bits of the address
;
;
TAB1_1:
TAB1_1:
        dh      LISTX                   ;Direct commands
        dh      LISTX                   ;Direct commands
        dh      LOAD
        dh      LOAD3
        dh      NEW
        dh      NEW
        dh      RUN
        dh      RUN
        dh      SAVE
        dh      SAVE3
TAB2_1:
TAB2_1:
        dh      NEXT            ;       Direct / statement
        dh      NEXT            ;       Direct / statement
        dh      LET
        dh      LET
        dh      IF
        dh      IF
        dh      GOTO
        dh      GOTO
Line 540... Line 538...
 
 
; 'GOTO expr' evaluates the expression, finds the target
; 'GOTO expr' evaluates the expression, finds the target
; line, and jumps to 'RUNTSL' to do it.
; line, and jumps to 'RUNTSL' to do it.
;
;
GOTO
GOTO
        lda             #'G'
 
        jsr             DisplayChar
 
        jsr             OREXPR          ;evaluate the following expression
        jsr             OREXPR          ;evaluate the following expression
        jsr             DisplayWord
        jsr             DisplayWord
        ld      r5,r1
        ld      r5,r1
        jsr     ENDCHK          ;must find end of line
        jsr     ENDCHK          ;must find end of line
        ld      r1,r5
        ld      r1,r5
Line 1125... Line 1121...
a2h1:
a2h1:
        sub             #'0'
        sub             #'0'
        and             #15                     ; make sure a nybble
        and             #15                     ; make sure a nybble
        rts
        rts
 
 
 
LOAD3:
 
        jsr             spi_init
 
        cmp             #0
 
        bne             WSTART
 
        lda             #5000
 
        ldx             #$E00
 
        jsr             spi_read_sector
 
        lda             #5001
 
        ldx             TXTBGN>>2
 
        asl             r2,r2,#2
 
LOAD4:
 
        pha
 
        jsr             spi_read_sector
 
        add             r2,r2,#512
 
        pla
 
        ina
 
        ld              r4,TXTBGN>>2
 
        asl             r4,r4,#2
 
        add             r4,r4,#65536
 
        cmp             r2,r4
 
        bmi             LOAD4
 
        bra             WSTART
 
 
 
SAVE3:
 
        jsr             spi_init
 
        cmp             #0
 
        bne             WSTART
 
        lda             #5000           ; starting sector
 
        ldx             #$E00           ; starting address to write
 
        jsr             spi_write_sector
 
        lda             #5001
 
        ldx             TXTBGN>>2
 
        asl             r2,r2,#2
 
SAVE4:
 
        pha
 
        jsr             spi_write_sector
 
        add             r2,r2,#512
 
        pla
 
        ina
 
        ld              r4,TXTBGN>>2
 
        asl             r4,r4,#2
 
        add             r4,r4,#65536
 
        cmp             r2,r4
 
        bmi             SAVE4
 
        bra             WSTART
 
 
SAVE:
SAVE:
        ld              r8,TXTBGN>>2    ;set pointer to start of prog. area
        ld              r8,TXTBGN>>2    ;set pointer to start of prog. area
        ld              r9,TXTUNF       ;set pointer to end of prog. area
        ld              r9,TXTUNF       ;set pointer to end of prog. area
SAVE1:
SAVE1:
Line 1887... Line 1927...
; Check that there is nothing else on the line
; Check that there is nothing else on the line
; Registers Affected
; Registers Affected
;   r1
;   r1
;
;
ENDCHK:
ENDCHK:
        lda             #'E'
 
        jsr             DisplayChar
 
        jsr             IGNBLK
        jsr             IGNBLK
        lda             (r8)
        lda             (r8)
        cmp             #CR
        cmp             #CR
        beq             ec1     ; does it end with a CR?
        beq             ec1     ; does it end with a CR?
        lda             #msgExtraChars
        lda             #msgExtraChars

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.