- UID
- 59317
注册时间2009-1-28
阅读权限40
最后登录1970-1-1
独步武林
TA的每日心情 | 无聊 2024-1-15 22:57 |
---|
签到天数: 3 天 [LV.2]偶尔看看I
|
偷懒了。/:16 没有输出到显存,直接打印来的。。。。
assume cs:code,ds:data,ss:stack
stack segment
db 200H dup(0)
stack ends
data segment
dd 35345345,123456789,987654321,0ffffffffh
str db 20 dup(0)
enter db 0dh,0ah,'$'
data ends
code segment
start: mov ax,stack
mov ss,ax
mov ax,data
mov ds,ax
xor bx ,bx
mov ax,200h
mov sp,ax
mov cx,4
xor si,si
again:
mov ax,[bx+si]
push ax
mov ax,[bx+2+si]
push ax
call itoa
mov dx,offset str
mov ax,0900h
int 21h
mov dx,offset enter
mov ax,0900h
int 21h
inc si
inc si
inc si
inc si
loop again
mov ax, 4c00h
int 21h
itoa:
push bp
mov bp,sp
push dx
push cx
push bx
push si
xor di,di
xor si,si
mov bx,offset str
mov dx,[bp+4]
mov ax,[bp+6]
start_check:
mov cx,0AH
call div_it
add cx,30h
push cx
inc di
test ax,ax
jnz start_check
mov cx,di
end_check:
pop ax
mov [bx+si],al
inc si
loop end_check
mov al,'$'
mov [bx+si],al
pop si
pop bx
pop cx
pop dx
pop bp
retn 4
div_it:
push bx
push ax
mov ax,dx
xor dx,dx
div cx
mov bx,ax
pop ax
div cx
mov cx,dx
mov dx,bx
pop bx
retn
code ends
end start |
|