Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;******************************************************************** *
- ;* *
- ;* This program illustrates how to use the assembler. *
- ;* It multiplies together two 8 bit numbers and leaves the unsigned *
- ;* result in the 'PRODUCT' location. *
- ;* *
- ;* Author: Scott Goddard 500723518 *
- ;********************************************************************
- ; export symbols
- XDEF Entry, _Startup ; export ‘Entry’ symbol
- ABSENTRY Entry ; for absolute assembly: mark
- ; this as applicat. entry point
- ; Include derivative-specific definitions
- INCLUDE 'derivative.inc'
- ;********************************************************************
- ;* Code section *
- ;********************************************************************
- ORG $3000
- MULTIPLICAND FCB 50 ; First Number
- MULTIPLIER FCB 18 ; Second Number
- PRODUCT RMB 2 ; Result of multiplication
- ;********************************************************************
- ;* The actual program starts here *
- ;********************************************************************
- ORG $4000
- Entry:
- _Startup:
- LDAA MULTIPLICAND ; Get the first number into ACCA
- LDAB MULTIPLIER ; Get the second number into ACCB
- MUL ; Multiply the two of them
- STD PRODUCT ; and store the sum (from ACCD)
- SWI ; break to the monitor
- ;********************************************************************
- ;* Interrupt Vectors *
- ;********************************************************************
- ORG $FFFE
- FDB Entry ; Reset Vector
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement