Advertisement
Guest User

Untitled

a guest
Sep 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;********************************************************************                                         *
  2. ;*                                                                  *
  3. ;* This program illustrates how to use the assembler.               *
  4. ;* It multiplies together two 8 bit numbers and leaves the unsigned *
  5. ;* result in the 'PRODUCT' location.                                *
  6. ;*                                                                  *
  7. ;* Author: Scott Goddard 500723518                                  *
  8. ;********************************************************************
  9.  
  10. ; export symbols
  11.  XDEF Entry, _Startup ; export ‘Entry’ symbol
  12.  ABSENTRY Entry ; for absolute assembly: mark
  13. ; this as applicat. entry point
  14. ; Include derivative-specific definitions
  15.  INCLUDE 'derivative.inc'
  16.  
  17. ;********************************************************************
  18. ;* Code section                                                     *
  19. ;********************************************************************
  20.  
  21.           ORG   $3000
  22. MULTIPLICAND  FCB 50 ; First Number
  23. MULTIPLIER    FCB 18 ; Second Number
  24. PRODUCT       RMB  2 ; Result of multiplication
  25.  
  26. ;********************************************************************
  27. ;* The actual program starts here                                   *
  28. ;********************************************************************
  29.  
  30.         ORG   $4000
  31. Entry:
  32. _Startup:
  33.         LDAA MULTIPLICAND ; Get the first number into ACCA
  34.         LDAB MULTIPLIER   ; Get the second number into ACCB
  35.         MUL               ; Multiply the two of them
  36.         STD PRODUCT       ; and store the sum (from ACCD)
  37.         SWI               ; break to the monitor
  38.        
  39. ;********************************************************************
  40. ;* Interrupt Vectors                                                *
  41. ;********************************************************************
  42.  
  43.         ORG   $FFFE
  44.         FDB   Entry ; Reset Vector
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement