Advertisement
lizardman123

Lab 5

Oct 14th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. N EQU 3 ; Number of matrix rows
  2. M EQU 4 ; Number of matrix columns
  3. OUTA EQU $FFB8 ; Address of OUTA Buffalo subroutine
  4. OUTSTRG EQU $FFC7 ; Address of OUTSTRG Buffalo subroutine
  5. OUTLHLF EQU $FFB2 ; Address of OUTLHLF Buffalo subroutine
  6. OUTRHLF EQU $FFB5 ; Address of OUTRHLF Buffalo subroutine
  7. OUTCRLF EQU $FFC4 ; Address of OUTCRLF Buffalo subroutine
  8.  
  9. ORG $100 Matrix FCB . . . ; Enter matrix elements here.
  10. FCB . . . ; “
  11. FCB . . . ; “
  12. FCB . . . ; “
  13. . . . ; Allocate memory for variables if needed
  14.  
  15. ORG $B600 ; Save code in EPROM
  16. **** START OF MAIN PROGRAM ****
  17. Main LDS #$01FF ; Initialize SP . . .
  18. LDX #MSG1 ; Load X with base address of MSG1
  19. JSR OUTSTRG ; Call subroutine to print MSG1 . . .
  20. BSR PRINTMAT ;Call subroutine to print original matrix . . .
  21. BSR SWAPMAT ; Call subroutine to swap matrix columns . . .
  22. LDX #MSG2 ; Load X with base address of MSG2
  23. JSR OUTSTRG ; Call subroutine to print MSG2 . . .
  24. BSR PRINTMAT ;Call subroutine to print modified matrix
  25. SWI ; return to Buffalo monitor
  26.  
  27. **** CODE FOR SUBROUTINES GOES HERE ****
  28. PRINTMAT . . . ; code for printing the matrix . . . ;
  29. RTS ; Return from subroutine
  30. SWAPMAT . . . ; code for swapping the matrix columns . . . ; “
  31. RTS ; Return from subroutine
  32.  
  33. **** DEFINE MESSAGES ****
  34. MSG1 FCC “The original matrix is as follows:”, $04
  35. MSG2 FCC “The modified matrix is as follows:”, $04
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement