王爽<<汇编语言>>第 3 版 实验 14 访问 CMOS RAM 作业

warning: 这篇文章距离上次修改已过706天,其中的内容可能已经有所变动。
assume cs:codesg

stacksg segment stack
  dw 0,0,0,0,0,0,0,0
stacksg ends
datasg segment
  dw 8 dup (0)
datasg ends

codesg segment
  byteno: db 9,8,7,4,2,0
  symbol: db '// ::-'

  begin:
    mov ds,ax
    mov ax,datasg
    mov es,ax
    mov si,0
    mov di,offset symbol
    mov bx,offset byteno

  read:
    mov al,cs:[bx]
    out 70h,al
    in al,71h
    mov ah,al
    mov cl,4
    shr ah,cl
    and al,00001111b
    add ah,30h
    add al,30h

    mov es:[si],ah
    mov es:[si+1],al
    mov al,cs:[di]
    mov es:[si+2],al
    
    cmp byte ptr cs:[bx],0
    je print
    inc bx
    inc di
    add si,3
    jmp short read

  print:
    mov byte ptr es:[si+2],24h
    mov ax,datasg
    mov ds,ax
    mov dx,0
    mov ah,9
    int 21h

  quit:
    mov ax,4c00h
    int 21h


codesg ends

end begin
none
最后修改于:2024年06月29日 23:11

添加新评论