X-man

导航

汇编实习二(屏幕显示)

1,将 datas 段内定义的数据,在屏幕上依次按行、列显示出来,要求字符串的显示,

要做成子函数 datas segment ;

考号,共占用64字节 db '42110001', '42110002', '42110003', '42110004‘ db '42110005', '42110006', '42110007', '42110008' ;

姓名,共占24字节 db 'qgh','eay','lfd','irc','cxg','wkf','dux','nfo' ;

性别,共占8字节 db 'f','f','m','f','m','m','m','f' ;

考试分数,共占24字节db '267','621','467','604','344','640','306','239' datas ends

assume ds:d,cs:c,ss:s
d segment
    ;考号
    db '42110001','42110002','42110003','42110004'
    db '42110005','42110006','42110007','42110008'
    ;姓名
    db 'qgh','eay','lfd','irc','cxg','wkf','dux','nfo'
    ;性别
    db 'f','f','m','f','m','m','m','f'
    ;分数
    db '267','621','467','604','344','640','306','239'
d ends
s segment
dw 32 dup(0)
s ends
c segment
start: mov ax,0b800h
         mov es,ax
     mov di,160*16+60
     mov si,di

     mov ax,s
         mov ss,ax
         mov sp,32

         mov ax,d
         mov ds,ax
     mov bx,0
         call far ptr pf ;子函数调用
     mov ax,4c00h
         int 21h 
   pf: 
         mov cx,8
   sa: push cx  
         mov cx,8
   s0: mov dl,[bx]
         mov dh,0cfh
     mov es:[di],dx
     inc di
     inc di
     inc bx
     loop s0;
         add di,144
     pop cx
     loop sa

         add si,18 ;换列
       
         mov cx,8 ;列的循环输出
     mov di,si
  sb:  push cx   
         mov cx,3
   s1:mov dl,[bx]
        mov es:[di],dl
    add di,2
    inc bx
    loop s1
    add di,154
    pop cx
    loop sb

        add si,8  ;换列 

         mov cx,8;列的循环输出
     mov di,si
  sc: mov dl,[bx]
        mov es:[di],dl
    add di,2
    inc bx
    add di,158
    loop sc
         
     add si,4 ;换列

    mov cx,8;列的循环输出
    mov di,si
   sj: push cx  
        mov cx,3
  s3: mov dl,[bx]
        mov es:[di],dl
    add di,2
    inc bx
    loop s3
    add di,154
    pop cx
    loop sj
    retf
c ends
end start

 

posted on 2013-04-12 20:50  雨钝风轻  阅读(296)  评论(0编辑  收藏  举报