汇编语言程序设计:[10]字符图形显示

 时间:2024-10-13 19:07:03

1、打开masm汇编编译程序,新建一个masm源文件脚本。DATAS SEGMENT ;此处输入数据段代码 DATAS ENDSSTACKS SEGMENT ;此处输入堆栈段代码STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此处输入代码段代码 MOV AH,4CH INT 21HCODES ENDS END START

汇编语言程序设计:[10]字符图形显示
汇编语言程序设计:[10]字符图形显示

2、在正文中输入我们的程序代码,并将文件命名为zifu.asmdata segme艘绒庳焰ntcar db 133 ;定义字符图形表 db 05h,122,0,0 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,0,3 db 05h,122,1,0 db 05h,122,2,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,-8,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,0,7 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,2,2 db 05h,122,0,1 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,0,-1 db 05h,122,-2,0 db 05h,122,2,2 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-2,0 db 05h,122,0,6 db 05h,122,3,0 db 05h,122,0,1 db 05h,122,-3,0 db 05h,122,-3,1 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,0,2 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,-1,-2 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,-1,-2 db 05h,122,-1,0 db 05h,122,-1,0 db 05h,122,0,9 db 05h,122,1,-3 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,0,1 db 05h,122,2,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,1,0 db 05h,122,0,4 db 05h,122,1,0 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,0,-1 db 05h,122,1,2 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,1,0 db 05h,122,-3,-1 db 05h,122,0,2 db 05h,122,1,1 db 05h,122,0,-4 db 05h,122,1,-1 db 05h,122,0,6char_cnt dw ? pointer dw ?line_on db ?col_on db ?data endsstack segment db 2000 dup (0)stack endscode segment assume cs:code,ds:data,ss:stackmain proc far push ds sub ax,ax push ax mov ax,data mov ds,ax    mov ah,0 mov al,4 int 10h mov ah,0bh mov bh,0 mov bl,2 int 10h mov ah,0bh mov bh,01 mov bl,00 int 10h call clear_screen ;调用清屏子程序 lea di,car mov dh,10 mov dl,2 call move_shape mov ah,8 int 21h cmp al,'q' jz exit main endp clear_screen proc near push ax push bx push cx push dx mov ah,6 mov al,0 mov ch,0 mov cl,0 mov dh,120 mov dl,200 mov bh,7 int 10h pop dx pop cx pop bx pop ax retclear_screen endpmove_shape proc near push ax push bx push cx push dx push di mov ah,0fh int 10h sub ch,ch mov cl,[di] inc di mov char_cnt,cx mov pointer,di mov line_on,dh mov col_on,dlmov_crsr: add dh,[di+2] add dl,[di+3] mov ah ,2 int 10h mov al,[di] mov bl,[di+1] push cx mov cx,1 mov ah,09 int 10h pop cx add di,4 loop mov_crsr call dly_qrtr     ;调用延时子程序 pop di pop dx pop cx pop bx pop ax retmove_shape endpdly_qrtr proc near push cx push dx mov dx,5000d11:mov cx,25000 d12:loop d12 dec dx jnz d11 pop dx pop cx retdly_qrtr endpexit:mov ah,4ch int 21hcode ends end main

汇编语言程序设计:[10]字符图形显示

3、运行我们编辑的文件一个显示“中国北京”字样的程序,按“q”键退出。

汇编语言程序设计:[10]字符图形显示
汇编语言程序设计:[10]字符图形显示
  • 汇编语言的画圆程序
  • 使用74ls161芯片,用置数法组成十二进制同步计数器,要求有真值表,并画出状态转化图
  • 试用4位同步二进制加法计数器74161采用置数法构成十进制计数器
  • 74ls138扩展为4线-16线译码器
  • 如何将8421和BCD码转成十进制?
  • 热门搜索
    读书小报手抄报图片 迎接期中考试手抄报 唐诗宋词手抄报 运动手抄报 消防安全的手抄报 防电手抄报 知法守法手抄报内容 五年级数学手抄报内容 二年级国庆节手抄报 认识大自然的手抄报