Basic Assembly Calculator

Only available on StudyMode
  • Topic: C, Subroutine, Operand
  • Pages : 1 (1086 words )
  • Download(s) : 115
  • Published : March 10, 2013
Open Document
Text Preview
icC:\Users\tafatefo\Documents\myCalculator.asm

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 Page 1

;---------------------------------------------------------------------------------------------------#! ;---------------------------------------------------------------------------------------------------#! ;-----------------------------{{Author: Mustafa Okasha}}--------------------------------------------#! ;---------------------------{{Project: BasicCalculator 1.1}}----------------------------------------#! ;---------------------------{{System: 8051 microcontroller}}----------------------------------------#! ;------------------------------{{Released at: 24/2/2013}}-------------------------------------------#! ;---------------------------------------------------------------------------------------------------#! ;---------------------------------------------------------------------------------------------------#! N1 EQU 30H ;#!Ram byte location holds first oeprand N2 EQU 31H ;#!Ram byte locations holds second operand OP EQU 32H ;#!Ram byte location holds operation ascii code R EQU 33H ;#!Ram byte location holds result SIGN EQU 34H ;#!Ram byte location holds result's sign TEMP EQU 35H ;#!Ram byte location holds temporary data DIF BIT 0AH ;#!Digit input flag bit(0,1,2,3,4,5,6,7,8,9) OIF BIT 0BH ;#!Operator input flag bit(+,-,*,/) AIF BIT 0CH ;#!Assignment operator flag bit(=) ORG 0H ;#!Orginate at rom address 0000H AJMP MAIN ;#!Absoulte jump to main routine ;--------------------------------------------------------------------------------------------------#! ;--------------------------------------------------------------------------------------------------#! ORG 30H ;#!Orginate at rom adress 0030H MAIN: ACALL memoryInit ;#!CALL memory initialization subroutine ACALL lcdInit ;#!CALL lcd...
tracking img