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

  • Good Essays

    Exercise 1: Review of array-based lists Create a project using the classes in the DocSharing area labeled “User-defined array list." Compile it, run it, and review the code that is given carefully. This code tests the ArrayList class provided in the lecture.…

    • 714 Words
    • 3 Pages
    Good Essays
  • 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
  • Satisfactory Essays

    IT220 Unit 5 assignment

    • 286 Words
    • 2 Pages

    MAC address: data link layer address, 48 bits in length, usually written as 12 hexadecimal digits and used to represent different devices connected to a LAN…

    • 286 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    The frame’s destination address of a broadcast frame is a value of all binary 0s.…

    • 817 Words
    • 4 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
  • 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 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
  • 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

    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
  • 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