非压缩BCD码转压缩BCD码汇编语言
来源:互联网 发布:开源yii框架商城源码 编辑:程序博客网 时间:2024/06/06 19:17
DATAS SEGMENT
;此处输入数据段代码
buf dw 0302h,0908h,0705h,0102h
res db ?
buf_size db ?
res_size db ?
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
;此处输入代码段代码
;宏 显示一个字符
dispchar macro char
mov ah,2
mov dl,char
int 21h
endm
;宏定义完成
;宏 显示字符串
dispmsg macro message
mov ah,9
lea dx,message
int 21h
endm
;宏定义完成
;宏 显示十六进制数的四位
disphex macro hexdata
local disphex1
push ax
push bx
push cx
push dx
mov bx,hexdata
mov cx,0404h
disphex1: rol bx,cl
mov al,bl
and al,0fh
call htoasc
dispchar al
dec ch
jnz disphex1
pop dx
pop cx
pop bx
pop ax
endm
;宏定义完成
mov cx, lengthof buf
lea si,buf
lea di,res
again:
mov ax,word ptr [si]
;disphex ax
call bcd
mov byte ptr [di],al
inc si
inc si
inc di
loop again
;显示RES的内容
lea si, res
;disphex [si+4]
disphex [si+2]
disphex [si]
MOV AH,4CH
INT 21H
;子程序压缩BCD转非压缩BCD
BCD proc
push cx
mov cl,4
shl al,cl
shr ax,cl
pop cx
ret
BCD endp
;子程序十六进制转ASCII
HTOASC proc
push bx
mov bx,offset ASCII
and al,0fh
xlat ASCII
pop bx
ret
ASCII db 30h,31h,32h,33h,34h,35h,36h,37h,38h,39h
db 41h,42h,43h,44h,45h,46h
HTOASC endp
CODES ENDS
END START
- 非压缩BCD码转压缩BCD码汇编语言
- 什么是压缩BCD码和非压缩BCD码?
- 压缩BCD码和非压缩BCD码的区别
- 压缩BCD码转非压缩BCD码
- 字符串转成压缩bcd码
- 压缩bcd码转成字符串
- 压缩BCD码转换成ASCII码
- bcd转换(bcd压缩展开)
- 实现十进制与压缩bcd码之间的转换
- C51单片机的压缩BCD码相加程序
- 二进制码转BCD码
- 二进制转BCD码
- BCD码
- bcd码
- BCD码
- BCD码
- BCD码
- BCD码
- macOS 中的 Rootless 机制
- 设计模式六大原则——迪米特法则(LoD,Law of Demeter)
- 《JavaScript 闯关记》之 DOM(上)
- 从源码的角度分析Hashtable和HashMap的区别
- J - 再贪一心
- 非压缩BCD码转压缩BCD码汇编语言
- HDU4462Scaring the Birds 枚举子集
- mysql实操(二)—设计通用的商品系统(一)
- 文章标题
- 野指针
- android 软键盘的收回
- python实现两个经纬度点之间的距离和方位角
- BCD码转为相应的数据
- 安装Tengine nginx 之后不能访问,配置防火墙