Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N EQU 3 ; Number of matrix rows
- M EQU 4 ; Number of matrix columns
- OUTA EQU $FFB8 ; Address of OUTA Buffalo subroutine
- OUTSTRG EQU $FFC7 ; Address of OUTSTRG Buffalo subroutine
- OUTLHLF EQU $FFB2 ; Address of OUTLHLF Buffalo subroutine
- OUTRHLF EQU $FFB5 ; Address of OUTRHLF Buffalo subroutine
- OUTCRLF EQU $FFC4 ; Address of OUTCRLF Buffalo subroutine
- ORG $100 Matrix FCB . . . ; Enter matrix elements here.
- FCB . . . ; “
- FCB . . . ; “
- FCB . . . ; “
- . . . ; Allocate memory for variables if needed
- ORG $B600 ; Save code in EPROM
- **** START OF MAIN PROGRAM ****
- Main LDS #$01FF ; Initialize SP . . .
- LDX #MSG1 ; Load X with base address of MSG1
- JSR OUTSTRG ; Call subroutine to print MSG1 . . .
- BSR PRINTMAT ;Call subroutine to print original matrix . . .
- BSR SWAPMAT ; Call subroutine to swap matrix columns . . .
- LDX #MSG2 ; Load X with base address of MSG2
- JSR OUTSTRG ; Call subroutine to print MSG2 . . .
- BSR PRINTMAT ;Call subroutine to print modified matrix
- SWI ; return to Buffalo monitor
- **** CODE FOR SUBROUTINES GOES HERE ****
- PRINTMAT . . . ; code for printing the matrix . . . ;
- “
- RTS ; Return from subroutine
- SWAPMAT . . . ; code for swapping the matrix columns . . . ; “
- RTS ; Return from subroutine
- **** DEFINE MESSAGES ****
- MSG1 FCC “The original matrix is as follows:”, $04
- MSG2 FCC “The modified matrix is as follows:”, $04
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement