Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

EEEN 3449 HW#2 Name: Due: 9/25/17 (M) Determine the machine code for each unknow

ID: 2248220 • Letter: E

Question

EEEN 3449 HW#2 Name: Due: 9/25/17 (M) Determine the machine code for each unknown block??" Machine code labelOpcode Operand PC 000a 1605 1605 equ or rmb 10 $1605 max $2000 #score #N 2000 2000 ce??? 2003 C6 ?? 2005 87 2006 a1 ?? 2008 22?? 200a a6 ?? 200c 08 200d 53 200e 26 ?? 2010 7a??? 2013 3f or ldx 1dab bhi 1daa next next decb ne staa 3w1 again max 69,87,96, 55,77 68,92,90,89,79 core dc.b dc.b end Determine the machine code for the following blanks 2000 ce_ 2003 C6 2006 al 2008 22 200a a6_ 200e 26 2010 7a 2014 - 2019-

Explanation / Answer

OPCODE: LDX #score

the machine code for the given opcode is obtained from the Program Counter value of the score

here the PC value of score is 2014

now the machine code: CE 20 14

Opcode: Ldab #N:

the machine code for the given opcode is obtained from the Program Counter value of the N

here the PC value of N is 000a

now the machine code: C6 0A

Opcode: cmpa 0,x:

the machine code for the given opcode is obtained as,

now the machine code: A1 00

since the value is given directly in the opcode.

Opcode: Bhi next:

the machine code for the given opcode is obtained from the Program Counter value to next

here it takes +2 for PC to reach next

there fore the machine code : 22 02

Opcode: Ldaa 0,x:

the machine code for the given opcode is obtained as,

now the machine code: A6 00

Opcode: Bne again:

the machine code for the given opcode is obtained from the Program Counter value to reach the 'again'

here the PC value is decremented by 10

now the machine code: 26 F6

Opcode: staa max:

the machine code for the given opcode is obtained from the Program Counter value of the max

here the PC value of max is 1605

now the machine code: 7A 16 05

Opcode: dc.b 69,87,96,55,77

the machine code can be written as,

69 87 96 55 77

opcode: dc.b 68,92,90,89,79

the machine code: 68 92 90 89 79

// here dc.b is a opcode which is used to define a constant byte so the machine code is written directly from opcode