CLA /SUM = 0
STA SUM
LDA SUM /Load current sum
ADD A /Add A to SUM
ADD B /Add B to SUM
STA SUM /Save SUM
LDA C /Load C to AC
CMA /Create 2’s complement
INC
ADD DIF /Subtract C from DIF
STA DIF /Save DIF
ADD SUM /Add SUM to DIF
STA SUM /Save SUM
HLT /Halt
EasyExamNotes.com
Write an assembly level program for the following pseudo code : SUM = 0 SUM = SUM + A + B DIF = DIF-C SUM = SUM + DIF
Source: https://easyexamnotes.com/write-an-assembly-level-program-for-the-following-pseudo-code-sum-0-sum-sum-a-b-dif-dif-c-sum-sum-dif/
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion