• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 8 pages
Other

Cism 3330 Exam 1 Study Guide

Document preview thumbnail
Preview 2 out of 8 pages

CISM 3330 EXAM 1 STUDY GUIDE

Content preview

CISM 3330 EXAM 1 STUDY GUIDE
Bitwise Operators - Answers :& - (AND) copies a bit to the result if it exists in both
operands:
0011 1100 & 0000 1101 = 0000 1100

| - (OR) copies a bit if it exists in either operand:
0011 1100 | 0000 1101 = 0011 1101

^ - (XOR) copies the bit if it is set in one operand but not both:
0011 1100 ^ 0000 1101

~ - 'flips' bits:
~0011 1100 = 1100 0011

<< - left shift:
0011 1100 << 2 = 1111 0000

>> - right shift:
0011 1100 >> 2 = 0000 1111

File Compilation - Answers :Compilation:
c code translated into assembly (hello.s)
actual data is referenced here
text and data sections

Assemble:
Assembly code translated into machine code
object file (hello.o)
uses placeholders for memory addresses that need to be used
relocations - list of placeholders
symbol table - where the function is

Link:
Combine with other .o files
places all text/data parts in memory, then writes info into executable
gets code from libraries

Pointer arithmetic - Answers :char *hello = "Hello World";
hello + 1 ' 'e'
*(hello + 1) = 'e'
hello[1] = 'e'

Stack v Heap - Answers :Stack: stored memory from local variables (life of the function),
grows down
Heap: new and malloc, dynamic

, ATT Syntax - Answers :destination last
'( )' means in memory
'$' means constant
plain number/label means value in memory

movq $42, (%rbx) = memory[rbx] <- 42`

LEA - Answers :Load Effective adress
skips memory access, just uses memory
leaq 4(%rax), %rax = addq 4, %rax

Condition Codes - Answers :set by almost all arithmetic instructions (addq, subq, etc)

Store info on last arithmetic result

jg, jle: jump greater than, jump less than
based on the result of subtraction
0: equal, positive: greater than, negative: less than

RISC v CISA - Answers :RISC:
fewer, simpler instructions
separate instructions to access memory
fixed length instructions
more registers
no "loops" in single instructions
no instructions with 2 memory operands
few addressing modes
RISC makes simpler hardware

ISA Choices - Answers :condition codes
addressing modes
number of operands
instruction complexity

Which op codes do arithmetic? - Answers :rm, mr, pop, push, call. ret, op

how to declare typedef/struct - Answers :typedef stuct foo {
int x;
} bar;

Legal:
bar x;
struct foo x;

sub - Answers :sub rax, rbx

Document information

Uploaded on
March 11, 2025
Number of pages
8
Written in
2024/2025
Type
Other
Person
Unknown
$12.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
GEEKA
3.8
(379)
Sold
2227
Followers
1451
Items
62985
Last sold
10 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions