Question 1
(a)
- LOAD DIRECT 300: This instruction loads the value at memory address 300 into the accumulator, so
the value loaded into the accumulator is 320.
- LOAD DIRECT 320: This instruction loads the value at memory address 320 into the accumulator, so
the value loaded into the accumulator is 305.
- LOAD INDIRECT 325: This instruction loads the value at the memory address stored in memory
address 325 into the accumulator. The value at memory address 325 is 300, so the value loaded into
the accumulator is 300.
(b)
, - Immediate addressing: MOV AX, 5 (This instruction moves the immediate value 5 into register AX)
- Direct addressing: MOV AX, [500] (This instruction moves the value at memory address 500 into
register AX)
- Stack addressing: PUSH AX (This instruction pushes the value of register AX onto the stack)
- Indexed addressing: MOV AX, [BX+SI] (This instruction moves the value at the memory address
pointed to by the sum of registers BX and SI into register AX)
- Base-addressing: MOV AX, [BX+100] (This instruction moves the value at the memory address
pointed to by the sum of register BX and immediate value 100 into register AX)
- Register indirect addressing: MOV AX, [BX] (This instruction moves the value at the memory address
pointed to by register BX into register AX)
Question 2
student_no: 12345678
student_name: John Smith
```
; Clear the screen, change screen color to yellow on blue
; Set cursor position to row 10, column 0
MOV AH, 06 ; Function to clear the screen
MOV AL, 0 ; Clear entire screen
MOV BH, 07h ; Yellow on blue color
MOV CX, 0 ; Upper left corner of the screen
MOV DX, 184Fh ; Lower right corner of the screen
INT 10h ; Call the interrupt
MOV AH, 02h ; Function to set cursor position
MOV BH, 00h ; Page number 0
MOV DH, 09h ; Row 10 (row's start count from 0)
MOV DL, 00h ; Column 0 (column's start count from 0)
INT 10h ; Call the interrupt
(a)
- LOAD DIRECT 300: This instruction loads the value at memory address 300 into the accumulator, so
the value loaded into the accumulator is 320.
- LOAD DIRECT 320: This instruction loads the value at memory address 320 into the accumulator, so
the value loaded into the accumulator is 305.
- LOAD INDIRECT 325: This instruction loads the value at the memory address stored in memory
address 325 into the accumulator. The value at memory address 325 is 300, so the value loaded into
the accumulator is 300.
(b)
, - Immediate addressing: MOV AX, 5 (This instruction moves the immediate value 5 into register AX)
- Direct addressing: MOV AX, [500] (This instruction moves the value at memory address 500 into
register AX)
- Stack addressing: PUSH AX (This instruction pushes the value of register AX onto the stack)
- Indexed addressing: MOV AX, [BX+SI] (This instruction moves the value at the memory address
pointed to by the sum of registers BX and SI into register AX)
- Base-addressing: MOV AX, [BX+100] (This instruction moves the value at the memory address
pointed to by the sum of register BX and immediate value 100 into register AX)
- Register indirect addressing: MOV AX, [BX] (This instruction moves the value at the memory address
pointed to by register BX into register AX)
Question 2
student_no: 12345678
student_name: John Smith
```
; Clear the screen, change screen color to yellow on blue
; Set cursor position to row 10, column 0
MOV AH, 06 ; Function to clear the screen
MOV AL, 0 ; Clear entire screen
MOV BH, 07h ; Yellow on blue color
MOV CX, 0 ; Upper left corner of the screen
MOV DX, 184Fh ; Lower right corner of the screen
INT 10h ; Call the interrupt
MOV AH, 02h ; Function to set cursor position
MOV BH, 00h ; Page number 0
MOV DH, 09h ; Row 10 (row's start count from 0)
MOV DL, 00h ; Column 0 (column's start count from 0)
INT 10h ; Call the interrupt