Preview

C and Instruction Sequence

Satisfactory Essays
Open Document
Open Document
900 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
C and Instruction Sequence
yes ENGG 3640
ASSIGNMENT-3
CHAPTER-4: ADVANCED ASSEMBLY PROGRAMMING
4.14 EXERCISES:
E4.6: The label array_x is the starting address of an array of 100 8bit elements.
Trace the following code sequence and describe what the subroutine sub_x does: ldx #array_x ldaa #100 jsr sub_x
...
Sub_x deca ldab 0,x inx loop cmpb 0,x ble next ldab 0,x next inx deca bne loop rts E4.10: Draw the stack frame and enter the value of each stack slot (if it is known) at the End of the following instruction sequence: lease -2,sp clrb ldaa #20 psha ldaa #$E0 psha ldaa #$E0 psha ldx #$7000 pshx jsr sub_abc
...
pshd leas -12,sp
...
E4.15: Write a subroutine to convert an 8-bit signed integer into an ASC11 string that represents a decimal number. The 8-bit integer and the pointer to the buffer to hold the ASC11 string are passed to this subroutine in accumulator B and index register X,respectively.
E4.16: Give an instruction sequence to call the out4hex () function to output the
16bit integer stored in memory location $1000-$1001.
E4.19: Write an instruction sequence to configure port A and port B for input and output respectively, read the value of port A and output the value to port B.
E4.20: Give an instruction to configure the pins 7, 5, 1, and 0 of port B for output and the remaining pins for input..yes ENGG 3640
ASSIGNMENT-3
CHAPTER-4: ADVANCED ASSEMBLY PROGRAMMING
4.14 EXERCISES:
E4.6: The label array_x is the starting address of an array of 100 8bit elements.
Trace the following code sequence and describe what the subroutine sub_x does: ldx #array_x ldaa #100 jsr sub_x
...
Sub_x deca ldab 0,x inx loop cmpb 0,x ble next ldab 0,x next inx deca bne loop rts E4.10: Draw the stack frame and enter the value of each stack slot (if it is known) at the End of the following instruction sequence: lease -2,sp clrb ldaa #20 psha ldaa #$E0 psha ldaa #$E0 psha ldx #$7000 pshx jsr sub_abc
...
pshd leas -12,sp

You May Also Find These Documents Helpful

  • Powerful Essays

    Nt1330 Unit 3 Assignment 1

    • 2019 Words
    • 9 Pages

    + 0 + 0 0 0 + 0+ 1 1 0 0 8 + 4 + 0 + 0= 140 Address Classes • There are 5 different…

    • 2019 Words
    • 9 Pages
    Powerful Essays
  • Powerful Essays

    NT1330 FINAL EXAM NOTES

    • 1446 Words
    • 5 Pages

    IPv4 addresses are commonly represented using what is called dotted-decimal notation, in which the decimal value of each byte is shown, using periods to separate the bytes.…

    • 1446 Words
    • 5 Pages
    Powerful Essays
  • Good Essays

    Arrays store items that have the same type of data type like a group of employees’ names and social security numbers for a team of 2000 personal. Pointer is a variable that greatly extends the power and flexibility of a program, each memory location that is used to store data value has an address. The address provides the means for a PC hardware to reference a particular data item.…

    • 485 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Array Structure Paper

    • 833 Words
    • 4 Pages

    To build an array for Berry’s Bug Blasters the variable must be decided in this case this author knows that the company wants the name from the cuostuomer and the telephone where they are requesting service. Now that the variables are decided the process of building the array can begin. An array must have an Upper Bound. This simply means a limit for the number of times that the loop will run before the program ends. Without this set limit the program would become an infinite loop. Having an infinite loop could likely cause the program to crash in some cases, but it is the opinion of this writer that all that would happen in the case of this program would just mean that the user would be continuously entering data in the way of names and phone numbers with no end to the program. This also…

    • 833 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Unit 8

    • 300 Words
    • 4 Pages

    Are you able to identify it based on the first octet, by the subnet mask, or both?…

    • 300 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Chapter 8 Quiz

    • 469 Words
    • 2 Pages

    2. What is the term used for the number inside the bracket that specifies the number of values that an array can hold? (Points : 7)…

    • 469 Words
    • 2 Pages
    Good Essays
  • Good Essays

    7 and Array

    • 500 Words
    • 2 Pages

    7. When a single array element, such as myArray[2], is passed to a method, the method receives _____.…

    • 500 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Unit 4 Study guide

    • 344 Words
    • 2 Pages

    6. State the steps that the SUBB instruction will go through for each of the following:…

    • 344 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Lab Quiz 5

    • 708 Words
    • 3 Pages

    2. A value from memory is placed in this register by the FETCH sequence and DECODED as an instruction.…

    • 708 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Includes all what I have taught you that is not in the book on single dimensional arrays. (Array of objects)…

    • 280 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Webdriver

    • 427 Words
    • 2 Pages

    1. Identify the port number - this is the port number written in code (and it can be any 4 digit number).…

    • 427 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    microprogram sequencer

    • 4951 Words
    • 20 Pages

    address generator memory means for producing during a current machine cycle period a first set of output signals including a first code set of signals designating a normal next input address for said address generator memory means;…

    • 4951 Words
    • 20 Pages
    Good Essays
  • Good Essays

    C++ Algorithm

    • 1077 Words
    • 5 Pages

    (4 points) Suppose we have an array implementation of the stack class, with twelve items in the stack stored at data[0] through data[11]. The CAPACITY is 42. Where does the push method place the new entry in the array?…

    • 1077 Words
    • 5 Pages
    Good Essays
  • Good Essays

    C++ HW1 ANSWER

    • 993 Words
    • 4 Pages

    Initialize a variable number F that keeps a very large value (must be larger than those values of A, B, C, D, E)…

    • 993 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    embedded

    • 1074 Words
    • 5 Pages

    o The high order byte is taken to be $00. This is how you access the…

    • 1074 Words
    • 5 Pages
    Satisfactory Essays

Related Topics