Professional Documents
Culture Documents
CAP212
PART A
Q3: How the near call procedures and far call procedures are different from
each other.
PART B
Q4: Write a program to push and pop some data using assembly language.
/* main program */
do n=1 to 5
call factorial n
say 'The factorial of' n 'is:' RESULT
end
return
factorial : procedure
n = arg(1)
if n = 1 then
return 1
return n * factorial( n - 1 )
The above program would normally use a function call instead. The following shows how
the main program would be coded in this case
/* main program */
do n=1 to 5
say 'The factorial of' n 'is:' factorial( n )
end
return
Purpose: Conditional jump, and the state of the flags is taken into
account.
Syntax:
JNP label
Q6: What are the benefits of using macros in microprocessor and give an
example to show the working of the macro.
Ans: Macro benefits from microprocessors With their onboard computers, new
generation locomotives have great diagnostic and archival capabilities. Builders are
working with railroads to make better use of available data.
In all the hype for the new generation of diesel-electric locomotives--the General Motors
60 Series and the General Electric DASH 8 series--the key phrase was "microprocessor
control."
Microprocessor control, the locomotive builders said, could work wonders in improving
efficiency and making a locomotive more economical to operate. Fuel savings was one of
the big things with the new-generation units, and railroads using the new locomotives
found that the manufacturers were right: They were more efficient, more economical.
In their efforts to prove why the 60 Series and the DASH 8 series were better, GM and
GE also talked about the diagnostic capabilities of the locomotives' microprocessor
systems, the ability of the computer to spot a failure and its cause and sound an alert and
to record it all.
Almost in passing, it was noted that those locomotives could record and maintain their
own individual history, and make it available quickly through downloading to an
inexpensive computer and transfer to a data base.