introduction to programming pmt flashcards
what are the three main programming constructs used in procedural programming
-sequence
-selection
-iteration
how does assembly language differ from machine code
assembly language uses mnemonics rather than binary.one line in assembly language is equal to one line in machine code
what is the function of STA
storing the value in the accumulator at the given memory address
what is the function of BRP
branches to a given address if the value in the accumulator is positive
it is a conditional branch
describe how selection works
a certain block of code is run if a specific condition is met v, using IF, ELSE IF and ELSE statements
how do variables and constants differ
the value of a constant cannot be edited by the program during execution while the contents of a variable can be changed
when might constants be used
for values that do not need to be changed or to prevent a value from being accidentally changed
define what is meant by a function
a named block of code that performs a specific task and must always return a single value
what is the role of the MOD function
MOD is used to fin the reminder when the number is divided by another
what are relational operators used for
to make comparisons between two values and produce a result of either TRUE OR FALSE
What is the function of the == operator
used to check whether a value is identical to another
give three boolean operators
AND,OR,NOT
What programming structure is used when a certain section of code needs to be executed while a certain condition remains true
iteration=specifically in a WHILE LOOP