4_3_1.asm
资源名称:huibian.rar [点击查看]
上传用户:xinbaokeji
上传日期:2022-07-05
资源大小:295k
文件大小:1k
源码类别:
汇编语言
开发平台:
Visual C++
- STACK SEGMENT STACK PARA STACK 'STACK'
- BUFFER DB 10 DUP(?)
- STACK ENDS
- DATA SEGMENT
- X DB -5
- RESULT DB ?
- DATA ENDS
- CODE SEGMENT
- ASSUME DS:DATA,CS:CODE,SS:STACK
- START: MOV AX,DATA
- LEA SI,BUFFER
- MOV DS,AX ;初始化
- MOV AL,X ;X取到AL中
- TEST AL,80H ;测试AL正负
- JZ NEXT ;为正,转NEXT
- NEG AL ;否则AL求补
- NEXT: MOV DL,AL ;送结果
- PUSH CX
- MOV CL,4
- SHR AL,CL
- OR AL,30H
- MOV [SI] ,AL
- INC SI
- MOV AL,DL
- AND AL,0FH
- OR AL,30H
- MOV [SI],AL
- INC SI
- MOV AL,'$'
- MOV [SI],AL
- ;MOV DL,AL
- MOV DX,OFFSET BUFFER
- MOV AH,09H
- INT 21H
- MOV AH,4CH
- INT 21H ;返回DOS
- CODE ENDS
- END START ;汇编结束