AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > 汇编语言

汇编源码--getspace

51自学网 http://www.wanshiok.com
CSEG SEGMENT
PUBLIC GETSPACE
GETSPACE PROC FAR

ASSUME CS:CSEG
PUSH BP
MOV BP,SP
MOV BX,[BP]+6
MOV DI,[BX]+2
MOV CX,8
MOV AL,' '
CLD
REP STOSB
MOV BX,[BP]+8
MOV SI,[BX]+2
MOV AX,[SI]
AND AL,0DFH
CMP AL,41H
JGE CKVER
JMP EXITSPC

CKVER:
PUSH AX
MOV AH,30H
INT 21H
XCHG AL,AH

SPACE20:
POP DX
XOR DL,40H
MOV AH,36H
   INT 21H
CMP AX,0FFFFH
JE EXITSPC
XOR DX,DX
MUL CX
XCHG BX,CX
MUL CX
PUSH AX
PUSH DX

ENDSPC:
MOV BX,[BP]+6
MOV DI,[BX]+2
ADD DI,7
POP DX
POP AX

HEXTODEC:
MOV SI,10
PUSH AX
MOV AX,DX
XOR DX,DX
DIV SI
POP CX
PUSH AX
MOV AX,CX
DIV SI
POP SI
OR DL,30H
MOV BYTE PTR [DI],DL
DEC DI
XCHG DX,SI
OR AX,AX
JNZ HEXTODEC

EXITSPC:
POP BP
RET 4
RET

GETSPACE ENDP
CSEG ENDS
END

 

 

 
上一篇:汇编源码--inthand  下一篇:汇编源码--getseg_c