“Assembly Language”, 3rd Edition by Wang Shuang
Chapter 13: int Instruction (Page 262)
Experiment 13: Writing and Applying Interrupt Routines
————————————
Note: This is the answer and analysis for Experiment 13, Question 3.
———————————–
(3) The following program displays four lines of English poetry on lines 2, 4, 6, and 8 of the screen. Complete the program.
assume cs:codecode segment s1: db 'Good,better,best,','$' s2: db 'Never let it rest,','$' s3: db 'Till good is better,','$' s4: db 'And better, best.','$' s : dw offset s1, offset s2, offset s3, offset s4 row: db 2,4,6,8
start: mov ax, cs mov ds, ax mov bx, offset s mov si, offset row mov cx, 4 ok: mov bh, 0 mov dh, ____ mov dl, 0 mov ah, 2 int 10H mov dx, ____ mov ah, 9 int 21H _____________ _____________ loop ok mov ax, 4c00H int 21Hcode ends end start
After completion, compile and run the program to experience the programming concepts involved.
=================
Analysis:
This program primarily utilizes the BIOS interrupt routine 10H and the DOS interrupt routine 21H. The function 2 of 10H is to set the cursor, requiring parameters (ah)=function number, (bh)=page number, (dh)=row number, (dl)=column number; the function 9 of 21H displays a string ending with ‘$’ at the cursor position, requiring parameters (ah)=function number, (ds:dx) pointing to the offset address of the first character of the string.
Reference Answer:
mov dh, [si]
mov dx, [bx]
inc si
add bx, 2
The compilation and execution were successful, as shown in the figure below.

===============
Reflections and Summary of Experiment 13
Teacher Wang Shuang emphasizes the importance of tracking and debugging in each experiment, as well as understanding the programming concepts involved. I have identified two main programming concepts from this:
Layering: Breaking down complex tasks into layers, where each layer addresses specific issues and supports the upper layer. Examples include computer architecture and the ISO seven-layer network model, which are classic cases of layering concepts.
Encapsulation:Writing common and frequently used functions as routines. This approach shields complex details from the outside while enabling function reuse, which can enhance program stability and development efficiency.