







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








0 to (2^32 - 1) - answers✔✔Unsigned doubleword range
Can interrupt program to process requests called "interrupts" - answers✔✔Real-Address mode multiple programs? Yes. Each process gets 4 GB of memory. - answers✔✔Protected mode run multiple programs? Permits segments to be divided into 4,096-byte blocks of memory (pages). Allows total memory used by all programs running at the same time to be larger than computers physical memory Adds page needed from disk to memory. If need more, and memory is full, return old page. Paging (disk access) is slower than main memory access - answers✔✔Paging: Code (executable instructions) Data (variables) Stack (procedure parameters, local variables, return addresses) - answers✔✔Assembly programs contain: Command embedded in source code. Recognized and acted upon by the assembler. Do not execute at runtime. - answers✔✔Directive definition .data, .code, .stack, ALIGN, LABEL - answers✔✔Example directives A statement that becomes executable when a program is assembled. Assembled into machine code by assembler - answers✔✔Instruction: definition
Calculate the size of the array: ListSize = ($ - list) / 2 - answers✔✔List WORD 1000h,2000h,3000h,4000h Calculate the size of the array: Both operands must be the same size. Both operands cannot be memory operands. Immediate value cannot be moved to a segment register - answers✔✔MOV Instruction rules Move with zero-extend used with unsigned integers - answers✔✔MOVZX Instruction Move with sign-extend Takes the smaller operand's highest bit & extends it in the destination operand - answers✔✔MOVSX Instruction Copies the low byte of the EFLAGS register into AH Flags that are copied: Sign, Zero, Auxiliary Carry, Parity, and Carry - answers✔✔LAFH Instruction Stores AH into status flags Copies AH into the low byte of the EFLAGS register i.e. can retrieve values of flags that were earlier saved in a variable - answers✔✔SAHF Instruction Exchange data (contents of two operands)
Rules: Both operands must be the same size. Both operands cannot be memory operands. CS, EIP, and IP cannot be destination operands. Does not accept immediate operands - answers✔✔XCHG Instruction Does not affect the carry flag. - answers✔✔Affect of INC on CF? Does not affect the CF - answers✔✔Affect of DEC on CF? When the sum exceeds the storage size of its destination operand. (CF is a copy of the carry out of the MSB of the destination.) - answers✔✔Unsigned Addition: When does CF = 1? (Larger unsigned int is subtracted from a smaller one.) - answers✔✔Unsigned Subtraction When does CF = 1? Source operand is negated and added to the destination. Carry out of MSB is inverted and copied to the CF. - answers✔✔Unsigned subtraction: Method: Result of a signed arithmetic operation is negative (Is copy of the destination's highest bit) - answers✔✔When does SF = 1? When the result of a signed arithmetic operation overflows or underflows the destination operand.
LENGTHOF array1 = LENGTHOF array2 = 5 * 3 = 15 - answers✔✔array2 WORD 5 DUP( DUP(?))LENGTHOF array2 = LENGTHOF array = 4 - answers✔✔array DWORD 1,2,3,4LENGTHOF array = LENGTHOF array5 = 9 - answers✔✔array5 BYTE ""12345678"", LENGTHOF array5 = Returns a value equivalent to multiplying LENGTHOF by TYPE - answers✔✔SIZEOF Operator returns? Aligns a variable on a byte, word, doubleword, or paragraph boundary ALIGN bound (bound can be 1, 2, 4, or 16) The next address is a multiple of bound - answers✔✔ALIGN Directive does...? Overrides the default type of a label Used to access part of a variable - answers✔✔PTR Operator Variable containing the address of another variable - answers✔✔Pointer ptrB DWORD arrayB or ptrB DWORD OFFSET arrayB - answers✔✔Pointer syntax Causes an unconditional transfer of control to a destination.
Offset/address of destination is moved into the instruction pointer. Execution continues at the new location. - answers✔✔JMP Instruction Effect on Instruction pointer? mov al, var or mov al, [var1] - answers✔✔Direct operand mov al, [arrayB+1] mov al, arrayB+1 - answers✔✔Direct-Offset Operand syntax Used to access memory locations without explicit labels Useful for accessing array elements - answers✔✔Direct-Offset operands use...? No, assembler will retrieve memory outside the array - answers✔✔Direct- Offset Operands Assembler perform range checking? Any 32-bit general purpose register surrounded by brackets mov [esi], bl mov bl, [esi] - answers✔✔Indirect Operands syntax? In protected mode, if the effective address points to an area outside your program's data segment, the CPU executes a general protection (GP) fault. - answers✔✔General protection fault
set when a 1 bit carries out of position 3 in the least significant byte of the destination operand. - answers✔✔Auxiliary Carry Flag