Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. a) For the following code fragment, indicate which parts are HCS12 instructions, which are assembler directives, which are comments, and which are labels (you
1. a) For the following code fragment, indicate which parts are HCS12 instructions, which are assembler directives, which are comments, and which are labels (you can indicate which are which on the code itself if you wish). (5 points) org $4000 Idaa #0 staa $02 forever: Idab #10 Idaa #$0 continue: adda $00 decb bne continue ; (bne uses 2 bytes in memory, one for the instruction and ; one for the relative address) ; store result staa $2000 b) For each instruction other than bne, list the addressing mode and effective address, if any. (Note that the bne instruction uses two successive memory addresses and decb uses 1.) (Assume that the load and store instructions take two bytes each except for STAA $2000, which takes three.) (10 points) c) Which lines are executed during compilation and which at runtime? (5 points) d) Briefly describe what the code does (what does it do overall, not what each instruction does). (5 points) 1. a) For the following code fragment, indicate which parts are HCS12 instructions, which are assembler directives, which are comments, and which are labels (you can indicate which are which on the code itself if you wish). (5 points) org $4000 Idaa #0 staa $02 forever: Idab #10 Idaa #$0 continue: adda $00 decb bne continue ; (bne uses 2 bytes in memory, one for the instruction and ; one for the relative address) ; store result staa $2000 b) For each instruction other than bne, list the addressing mode and effective address, if any. (Note that the bne instruction uses two successive memory addresses and decb uses 1.) (Assume that the load and store instructions take two bytes each except for STAA $2000, which takes three.) (10 points) c) Which lines are executed during compilation and which at runtime? (5 points) d) Briefly describe what the code does (what does it do overall, not what each instruction does). (5 points)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started