奥普瓯江 发表于 2019-3-18 17:46:42

检测点14.1

本帖最后由 奥普瓯江 于 2019-3-18 17:46 编辑

(1)编程, 读取CMOS RAM 的2号单元的内容

assume cs:code

code segment
start:
                mov al, 2h
                out 70h, al                        ;用al向端口70中传输地址2,CMOS RAM使用两个端口一个是70是地址输入端口
                in al, 71h                        ;读取CMOS RAM 芯片组中地址2的数据(这个地址2以通过70端口在前面传给了CMOS RAM芯片组)通过71h端口传给al
               
                mov bl, al
               
               
                mov ax, 4C00h
                int 21h
               
code ends
end start

(2)编程, 向CMOS RAM 的2号单元写入0。


assume cs:code

code segment
start:
                mov al, 2                ;向2号地址
                out 70h, al                ;把2送入到地址端口70h来确定下面要写入或读取的位置
               
                mov al, 0                ;CMOS RAM中输入的数据先传给al因为out和in只能与al和ax相互搭配别的寄存器不可以使用
                out 71h, al                ;向数据端口71录入数据0,因为上面已经定位了地址端口70h,2号地址,所以在这里录入的就直接录入到CMOS RAM中的2号地址中了
               
                ;mov al, 2                ;以下标注代码是为了验证所以取出的数据
                ;out 70h, al
               
                ;in al, 71h
               
                ;mov bx, 2458h
               
                ;mov bl, al
               
                mov ax, 4c00h
                int 21h
code ends
end start
页: [1]
查看完整版本: 检测点14.1