Course Hero Logo

Value is assigned to it when its declared the

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 30 - 32 out of 216 pages.

value is assigned to it when it’s declared.The pseudoinstructionsdb,dw,dd,dq,dt,ddqanddohelp us toinitialize a memory location with some data, and with using labelswhen can mimic the concept of initialized variables in C. As an exam-ple, let’s considerdbwhich declares and initializes a byte of data, thesecond letter ofdbmeans bytes.23db ’a’The above example reserves a byte in the memory, this is thedecla-ration step, then the characterawill be stored on this reservedbyte of the memory, which is the initialization step.5888db ’a’, ’b’, ’c’In the above example we have used comma to declare three bytesand store the valuesa,bandcrespectively on them, also, on memory23In linguistics, which is the science that studies languages, a prefix is a word(actually a morpheme) that is attached in the beginning of another word andchanges its meaning, for example, inundo,unis a prefix.24For example, in algorithm design which is a branch of computer science, the termpseudocode means a code that is written in a fake programming language. Anotherexample is the wordpseudoscience: A statement is a pseudoscience when it isclaimed to be a scientific fact, but in reality it is not, that is, it doesn’t follow thescientific method.25Unless, of course, they are provided in the other assembler as pseudoinstructions.26 It is important to note that declaring a function in C differs from defining a function,the following declares a function:int foo();You can see that the code block (theimplementation) offoois not a part of the declaration, once the code block of thefunction is presented, we say this is the definition of the function.
1.5 writing the boot loader30these values will be stored contiguously, that is, one after another, thememory location (hence, the memory address) of the valuebwill beright after the memory location of valueaand the same rule applies forc. Sincea,bandcare of the same type, a character, we can write theprevious code as the following and it gives as the same result.5888db ’abc’Also, we can declare different types of data in the same source line,given the above code, let’s say that we would like to store the number0after the characterc, this can be achieved by simply using a comma.1db ’abc’, 0Now, to make this data accessible from other parts of the code, wecan use a label to represent the starting memory address of thisdata. Consider the following example, it defines the labelour_variable,after that, we can use this label to refer to the initialized data.1our_variable db ’abc’, 0repeating withtimesTo repeat some source line multiple times, wecan use the pseudoinstructiontimeswhich takes the num-ber ofrepetitions as first operand and the instruction that we would like toexecute repeatedly as second operand. The following example printsSfive times on the screen.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 216 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
Reynolds

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture