"Compilation Language" exercise 1

xiaoxiao2021-03-06  35

"Assembly language program design" test questions

First, fill in the blanks: (10 points)

1, Intel8086 function is divided into two parts of Bus Interface Parts (BIU) and Execution Parts (EU), and implementation components are responsible for execution, mainly,,,, three parts, BIU mainly included,.

2. The data register group includes four 16-bit registers, referred to as accumulators, typing base registers, quotient registers, and data registers. Four segment registers are that the IP registers are stored.

3, PSW is called the program status word, consisting of the condition code and control flags, the meaning of the sf mark is that the meaning of the CF flag is that the meaning of the SF flag is that the implication of the ZF flag is.

4, DEBUG includes several commands, where u command function is that the functionality of the D command is that the function of the T command is to view the contents of the register, and the runtime command is.

5, there are three ways to pass the subroutine parameters,

.

Second, the calculation questions: (25 points, the 5th question of 5 points, the remaining 4 points)

1. Transform the following binary numbers to 16-based number and decimal number:

(1) 101101 (2) 10000000 (3) 11111111

2, complete the calculation of the following binary number:

00010101 00001101 =

0001111-00000101 =

3, find the following binary number of complement:

-00010011 -00111110

4, there is a 16-bit value 0101, 0000, 0100, 10011,

(1) How much is it if it is a binary number, and the decimal number of its equivalent?

(2) What character is it if it is an ASCII code character?

(3) If it is a compressed BCD code, what is the number of it?

5. Ask the following numbers and 4AE0H poor, and set the marker sf, ZF, CF, and OF: according to the results.

(1) 1234H (2) 5D90H

6, write the segment address, offset address, and physical address of the following storage unit addresses:

(1) 3516: 0050 (2)

Allf

00:

000A 000A

Third, Just Answers: (20)

1. If a stack starts from the address 1250: 0000, its last word is from 0100h, the content of the SP is 0052H: Q: (1) How much is the top address of the stack?

(2) What is the address of the stack?

(3) What is the segment address in SS?

(4) After depositing data 3445h, how is the content of SP?

2, existing (DS) = 2000H, (bx) = 0100H, (Si) = 0002H

(20100) = 12h, (20101) = 34h, (20102) = 56H (20103) = 78H, (21200) = 2ah, (21201) = 4ch, (21202) = B7H, (21203) = 65h, try the following After the instructions are executed, the contents of the AX register.

(1) MOV AX, 1200H

(2) MOV AX, BX

(3) MOV AX, [1200]

(4) MOV AX, [BX]

(5) MOV AX, 1100 [BX]

(6) MOV AX, [BX] [Si]

(7) MOV AX, 1100 [BX] [Si]

3, assuming (bx) = 0E3H, the value of the variable VAL is 79h, determine the result of the following instructions separately.

(1) XOR BX, VAL

(2) And bx, Val

(3) OR BX, VAL

(4) Test bx, 01h

(5) XOR BX, 0FFH

(6) And bx, 0

4, assuming (dx) = 10111001b, (CL) = 03, (CF) = 1, determine the value in DX after the following instructions are performed separately.

SHR DX, 1

SAR DX, CL

SHL DL, 1

ROR DL, CL

RCR DL, 1

Fourth, read the following block, answer questions (20)

1. Read the following procedure, what is the result, where is it stored?

Stack Segment Stack

DB 64 DUP ('Stack')

Stack ends

Data segment

BUFA DB-100, 2, 13, -35, 56

BUFB DB 34, -120, 23, -39, 65N = $ - BUFB

F dw?

BUFO DB 'OVERFIOW! ', 0DH, 0AH,' $ '

Data ends

Code segment 'code'

Assume CS: Code, DS: Data, SS: Stack

Begin: Mov Ax, Data

MOV DS, AX

MOV BX, 0

MOV CX, N

Lea Si, BUFA

Lea Di, BUFB

LOPA: MOV Al, [Si]

CBW

Add BX, AX

Jo over

MOV Al, [DI]

CBW

Add BX, AX

Jo over

Inc Si

INC DI

DEC CX

JNE LOPA

MOV F, BX

EXIT: MOV AH, 4CH

Int 21h

Over: Lea DX, BUFO

MOV AH, 9

Int 21h

JMP EXIT

Code ends

End Begin

2, read the following programs, and point out the content displayed by the display:

A segment

Num db 00111001b

BUF DB 0AH, 0DH, '(NUM) ='

BUF1 DB 4 DUP (0)

A ends

B Segment Stack

DB 200 DUP (0)

B ends

C segment

Assume DS: A, SS: Stack, CS: C

Begin: Mov AX, X

MOV DS, AX

Lea Di, BUF1

MOV Al, Num

MOV CL, 4

SHR Al, Cl

OR Al, 30H

MOV [DI], Al

INC DI

MOV Al, Num

And Al, 0FH

OR Al, 30H

MOV [DI], Al

INC DI

MOV BYTE PTR [DI], 'H'

INC DI

MOV BYTE PTR [DI], '$'

Lea DX, BUF

MOV AH, 9

Int 21h

MOV AH, 4CH

Int 21h

C ends

End Begin

V. Write procedures: (25 points)

1. Write the execution sequence of the following calculation, where x, y, z, r, and W is the number of 16-bit band symbol number units.

(1) Z <-W (Z-X)

(2) Z <- (x * w) / (y 6), R <- remainder

2, write the program, require lowercase letters entered on the keyboard to display the uppercase letters.

转载请注明原文地址:https://www.9cbs.com/read-78098.html

New Post(0)