Giter Site home page Giter Site logo

sorinmiroiu97 / rising-to-power_assemblecode_lmc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from emilcreatepro/rising-to-power_assemblecode_lmc

1.0 0.0 0.0 715 KB

This program takes two inputs (A and B) and offers the result of A^B using a type of assembly language.

C 100.00%

rising-to-power_assemblecode_lmc's Introduction

Rising-To-Power_AssembleCode_LMC

This program takes two inputs (A and B) and offers the result of A^B using a type of assembly language.

Explanation: you give two inputs A and B and this machine code will give you the result of A^B :)
How it works :- 
ONE is set to value 1
REZPU is set to val 1
ZERO is set to value 0
REZPR is not used in this context because the result of product is kept in adress 96

Steps:
-the initial numbers given will be stored in the memory address 99 and 98.
-we use an auxilliary space of memory(97) to keep track of the value of the first number
-we load the 0(zero) value and put it in memory 96(we will use this for to determine the product)
-we the test if the second input is zero, if yes then we output the result(REZPUT)
	otherwise we subtract one from second input and jump to PROD
-in PROD we load what we have in address 97(the first input), if it's zero then we update the value of REZPU and jump to PUT
	otherwise we load what is in address 96 and add to it REZPU, then store the result in 96 and subtract ONE(1) from 97 and repeat the process
-when we're DONE we jump to DONE and load the result(REZPU) in address memory 95 and output the result :) 

presentationgif

rising-to-power_assemblecode_lmc's People

Contributors

emilcreatepro avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.