ATM Program is an assembly script that simulates an ATM.
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
This project is an ATM Program which as it sounds, it simulates an ATM (Automatic Teller Machine) that I've built with Assembly (Low-level programming language) using EasyCPU development environment.
The user will be allowed to perform the existing operations at the ATM when he provides a binary-code corresponding to the credit-card number format. At this stage, the existing operations at the ATM are:
- Cash deposits
- Cash withdrawals
- Checking balance
Cash Withdrawals and deposits can be made in local currency, NIS, and in foreign currencies, USD and EUR. There are three card types and each card type has different definitions, different fees, credit limit, etc, the types are: Young, Standard and Business.
At the beginning of the program, 6 credit-cards are initizlized with a certain balance.
A credit-card number is represented by byte (8-bits) where the first 3 bits represent the card type and the remaining 5 bits represent the credit-card id code, according to the following definition:
Young=001
Standard=010
Business=011
The account balance is represented by byte (8-bits) next to CCF byte, using the simplified and accepted binary base definition. The 8 bits together represent the amount accumulated in the account, according to that the max amount is:
(11111111)₂ = (1 × 2⁷) + (1 × 2⁶) + (1 × 2⁵) + (1 × 2⁴)
+ (1 × 2³) + (1 × 2²) + (1 × 2¹) + (1 × 2⁰) = (255)₁₀
The operations is represented by byte (8-bits) where the first 3 bits represent the currency type and the remaining 5 bits represent the amount.
At this stage, the user has to choose which currency he wants to withdraw, and the amount. Note: The withdrawal is made under the account types settings such as withdrawal fee & limit.
Young={ limit: 50, fee: 5 }
Standard={ limit: 100, fee: 4 }
Business={ limit: none, fee: 1 }
At this stage, the user has to choose which currency he wants to withdraw, and the amount. Note: the deposits is made under the account types settings such as deposit fee. Note#2: All types of cards are allowed to deposit any amount of money as they wish.
Young,Standard,Business={ fee: 2 }
In the initialization process, the following program settings and credit-cards are loaded.
CC binary-code | type | id-code | balance dec-val |
---|---|---|---|
00110001 00101000 | Young | 10001 | 40 |
01010010 01011010 | Standard | 10010 | 90 |
01110011 01100100 | Business | 10011 | 100 |
00110100 01010000 | Young | 10100 | 80 |
01010101 10001100 | Standard | 10101 | 140 |
01110110 11111111 | Business | 10110 | 255 |
binary-code | definition | dec-val |
---|---|---|
00110010 | Withdrawal limit (Y) | 50 |
01100100 | Withdrawal limit (S) | 100 |
11111111 | Withdrawal limit (B) | 255 |
00000010 | Deposit fee | 2 |
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.