aa.asm

来自「接口技术」· 汇编 代码 · 共 45 行

ASM
45
字号
dseg segment
ASCADDR DB 7ah,31h,32h
NUMBER DB 3
BCDADDR DW 3 dup (?)
dseg ends
program segment
	assume cs:program,ds:dseg
start:	mov ax,seg hexibin
	mov ds,ax
	mov dx,offset hexibin
	mov ax,2578h
	int 21h
	mov ax,dseg
	mov ds,ax
	lea si,ASCADDR
	lea di,BCDADDR
lop:	mov al,[si]
	mov ah,0
	int 78h
	mov [di],ax
	add di,2
	inc si
	cmp si,number
	jl lop
	mov ah,4ch
	int 21h
hexibin:mov bx,0
	mov dx,0
	cmp ax,64h
	jl action
	mov cx,64h
	div cx
	mov bx,ax
	mov ax,dx
	mov dx,0
action:	mov cx,0ah
	div cx
	mov cl,4
	shl ax,cl
	add al,dl
	mov ah,bl
	iret
program ends
	end start
	

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?