Turn on thread page Beta
    • Thread Starter
    Offline

    0
    ReputationRep:
    I have to write a program in assembly language for a calculator that can perform the four basic calculations on two numbers between 1 - 10 ie add subtract etc.
    can anybody help me please
    Offline

    1
    ReputationRep:
    (Original post by cass2658)
    I have to write a program in assembly language for a calculator that can perform the four basic calculations on two numbers between 1 - 10 ie add subtract etc.
    can anybody help me please
    i did some assembly for electronics a level.
    Is this for some piece of hardware eg does it sense what numbers have been pressed and what calc to do?? how do they choose what they want done to the 2 numbers? eg for adding you could have:

    Mov AX, 1
    Mov BX, 2
    Add AX, BX

    this would add 1 + 2 and store the answer int he accumulator Ax. (3)
    If the data was stored ina memory address you would have to refer to the address in memmory that you want instead of the numbers i have put in there. The way in which you do this depends on what microcontroller your using and its instruction set.
 
 
 
Poll
Who is most responsible for your success at university

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.