MGMT 1000 Lecture Notes - Lecture 17: Goto

16 views2 pages
MGMT 1000 Tutorial 17 Notes Thumbwheels
Introduction
Assume that the hand counter has thumbwheels for this purpose.
This means that the next instruction that the Little Man will execute is located at that
mailbox address.
This instruction is very similar, conceptually, to the GOTO instruction in BASIC.
Its execution will always result in a break in the sequence to another part of the
program.
Note that this instruction also uses the address digits in an unusual way, since the Little
Man does not use the data at the address specified.
Indeed, the Little Man expects to find an instruction at that address, the next to be
performed.
BRANCH ON ZERO instructionop code 7
The Little Man will walk over to the calculator and will observe the number stored there.
If its current value is zero, he will walk over to the instruction location counter and
modify its value to correspond to the address specified within the instruction.
The next instruction executed by the Little Man will be located at that address.
If the value in the calculator is not zero, he will simply proceed to the next instruction in
sequence.
BRANCH ON POSITIVE instructionop code 8
The Little Man will walk over to the calculator and will observe the number stored there.
If its current value is positive, he will walk over to the instruction location counter and
modify its value, to correspond to the address specified within the instruction.
The next instruction executed by the Little Man will be located at that address.
If the value in the calculator is negative, he will simply proceed to the next instruction in
sequence. Zero is considered to be a positive value.
Note that is it not necessary to provide BRANCH ON NEGATIVE or BRANCH ON
NONZERO instructions.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents