2005 - Summer (Midterm)

2005 - Summer (Midterm) - executing the following code ? AX...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Midterm Summer 2005 SYSC-3006 Computer Organization Department of Systems and Computer Engineering Question 1 [12 marks] (a) [3 marks] .data A db ? B db 0A7h C db 0F4h (b) [3 marks]. MOV AL, B SUB AL, C MOV A, AL (c) [1 mark] 1010 0111 A7 -1111 0100 – F4 --------------- 1011 0011 B3h d) [2 marks] A = 179 (11*16 + 3 = 176+3) O v e r f l o w Y e s e) [3 marks] A = 1011 0011 -> 0100 1100+1 = 4Dh A = -77 ( 4 * 16 + 13 = 64+13) Overflow (Y or N) = Y Question 2 [8 marks] (a) [2 marks] 2790:019E = 27900+019E = 27A9Eh (b) [2 marks] What offset must we move into BX such that ES:[BX] will produce the absolute address of 27A9E 27A9E - 23AF0 --------- 3fAEh
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 (c) [4 marks] What are the contents of the following registers and locations after
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: executing the following code ? AX = 4301 BX = FEBC DS:020 = 01 DS:021 = 43 DS:022 = BC DS:023 = FE Question 3 [19 marks] (a) [ 3 marks] Data transfer: MOV Data Manipulation and/or Arithmetic and Logic : CMP/SUB/ADD Control Transfer: JMP, J*, CALL (b) [3 marks] Left: Statically bound during compilation and loaded into memory when program is loaded. Right: Runtime execution of the instruction (c) [3 mark] Register Indirect, Direct and Based-Index with Displacement (d) [10 marks] MOV BX, 0 N e x t : CMP BX, 12*2 JAE notFound MOV AX, [BX]NUMBERS AND AX, 00000001b JNZ found ADD BX, 2 JMP next found: MOV AX, BX SHR BX, 1 JMP done notFound: MOV AX, -1 done: ....
View Full Document

Page1 / 2

2005 - Summer (Midterm) - executing the following code ? AX...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online