Analysis of Checkpoint 14.1 Answers in Assembly Language

“Assembly Language”, 3rd Edition by Wang Shuang

Chapter 14: Ports

Checkpoint 14.1 (Page 267)

(1) Program to read the content of cell 2 in CMOS RAM.

(2) Program to write 0 to cell 2 in CMOS RAM.

================Reference Answers(1) Reference code is as follows:

assume cs:codecode segment    start: mov al, 2      ; Address and business data can only be placed in al or ax           out 70H, al    ; Send the address of the target storage cell through port 70H           in al, 71H     ; Read the data of cell 2 from port 71H into al
           mov ax, 4c00H           int 21Hcode endsend start  

(2) Reference code is as follows:

assume cs:codecode segment    start: mov al, 2          ; First, place the address in al           out 70H, al        ; Send the address to port 70H           mov al, 0          ; Place the data in al           out 71H, al        ; Send the data to port 71H
           mov ax, 4c00H           int 21Hcode endsend start    

Leave a Comment