• Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month

Write a TOM program that reads a number from the keyboard, subtracts 1 and displays the result.

Page
  1. 1
    1
  2. 2
    2
  3. 3
    3
  4. 4
    4
  5. 5
    5
  6. 6
    6
  7. 7
    7
  8. 8
    8
  9. 9
    9
  10. 10
    10
  • Essay length: 2694 words
  • Submitted: 07/01/2004
Share this essay:
AS and A Level Computer Science

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

Read more
The above preview is unformatted text

Found what you're looking for?

  • Start learning 29% faster today
  • Over 150,000 essays available
  • Just £6.99 a month

  • "
    I have used the site to find relevant essay questions for my senior students in Modern History to complete. As well as provided some essay samples to demonstrate the stucture of an historical essay.
    "
    Yvette Agars. Senior History Teacher. Saint John's College. Whyalla S.A.
  • "
    I am a person who learns better from observing first, markedbyteachers had aided my learning by providing pre-done essays, allowing me to expand my knowledge in a productive, logical and easily understandable way.
    "
    Joanne Barratt. Nursing. University Student.

Marked by a teacher

This essay has been marked by one of our great teachers. You can read the full teachers notes when you download the essay.

Peer reviewed

This essay has been reviewed by one of our specialist student essay reviewing squad. Read the full review on the essay page.

Peer reviewed

This essay has been reviewed by one of our specialist student essay reviewing squad. Read the full review under the essay preview on this page.