- Join over 1.2 million students every month
- Accelerate your learning by 29%
- Unlimited access for just £4.99 per month
Write a TOM program that reads a number from the keyboard, subtracts 1 and displays the result.
The first 200 words of this essay...
TOM1
1. Write a TOM program that reads a number from the keyboard, subtracts 1 and displays the
result.
To improve legibility the comments are displayed to the right of every TOM line of code, and not in the standard style.
read keyin Reads data inputted by keyboard and stores in the store location keyin
load keyin Loads data from the store location keyin in to the accumulator
sub minus Subtracts the store location minus from the accumulator
store display Stores value in accumulator in the store location display
print display Displays contents of the store location display on the screen
stop Stops program execution
minus data 1 Initialises a store location minus with the value 1 in it
keyin data 0 Initialises a store location keyin with the value 0 in it
display data 0 Initialises a store location display with the value 0 in it
2. Write a TOM program that reads a number from the keyboard, multiplies it by 2, reads another number b from the keyboard, multiplies it by
Found what you're looking for?
- Start learning 29% faster today
- Over 150,000 essays available
- Just £4.99 a month
Not the one? We have 100's more
Computer Science (view all)
- Barriers to Communication
- Business & IT Department BTEC. Organisational System Sec...
- White Soul System Designs - creating a computer system.
- Assess the relative advantages of Quantitative research data...
- Compilers and Interpreters