判断AL是否为十六进制并将其十进制存入AL
2014-04-26 17:58
204 查看
; ; 判断AL是否为十六进制并将其十进制存入AL ; author: wangguolaing ; date: revised 4/14 .386 .MODEL FLAT INCLUDE io.h includelib Kernel32.lib ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD cr EQU 0dh Lf EQU 0ah .STACK 4096 .DATA Array DWORD '3','4','f' prompt BYTE cr,Lf,Lf,'The al is not a hex ' BYTE cr,Lf,0 number BYTE 11 DUP (?) .CODE _start: mov eax,0 ;mov al,'2' ;测试数据 ;mov al,'6' mov al,'C' ;mov al,'d' cmp al,30h jl notwhile cmp al,39h jle whilelow cmp al,41h jl notwhile cmp al,46h jle whilemid cmp al,61h jl notwhile cmp al,66h jle whileup jmp notwhile whilelow : sub eax,48 dtoa number,eax jmp outal whilemid : sub al,'A' add al,10 jmp outal whileup : sub al,'a' add al,10 jmp outal outal : dtoa number,eax output number jmp quit notwhile : output prompt quit: INVOKE ExitProcess, 0 ; exit with return code 0 PUBLIC _start ; make entry point public END ; end of source code
相关文章推荐
- 汇编语言无效指令错误概述
- 汇编语言超浓缩教程
- 初学汇编语言的几个练习题
- 汇编语言的Hello world程序
- 麻省理工大学XV6操作系统赏析(用户态的实用工具)
- 汇编语言 之 除法溢出问题
- 汇编语言王爽 实验10.1
- 汇编语言 课程设计2 之时间设置改进篇
- 汇编常用命令-修改主板生产日期
- Win32汇编基础
- 运算符重载时到底发生了什么?【DEBUG】
- C++中全局变量、静态变量、自动变量的在内存中的位置【DEBUG】
- c++类的反汇编代码的实现【DEBUG】
- C++ 动态内存的分配与释放反汇编代码【DEBUG】
- C++结构体在汇编语言中的实现(局部变量)【DEBUG】
- Uboot详细启动流程
- 微机原理复习--8250
- 如何用各种编程语言杀死一条龙
- 64位Win7如何使用debug
- { char *p,s[6];int n