Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions

Question

What is the environment we are trying to create?

Answered: 1 week ago

Question

How would we like to see ourselves?

Answered: 1 week ago