汇编IF(a or b)实现

先判条件a真,跳到thenLab
再判b假,跳到elseLab

include vcIo.inc

.data
	var1 byte 12h
	str_then byte "then",0ah, 0
	str_else byte "else",0ah ,0
.code
main proc
;if(var1  > 20h \\ var <11h )
;---
;else
;------
	mov al,var1
	cmp al,20h
	ja thenLab
	cmp al,11h
	jae elseLab
	thenLab:
		pushad
			invoke printf, offset str_then
		popad
		jmp next
	elseLab:
		pushad
			invoke printf, offset str_else
		popad

	next:
		invoke _getch

ret
main endp
end main
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
myasm51,小型的51单片机汇编器源码。 基于Linux环境下编写的小型的51单片机汇编器,源码开放,采用lex和yacc两个扫描和分析工具创建,代码小巧,易于研读和分析。对汇编源程序2遍扫描完成汇编,可以生成列表文件,Intel的Hex格式的文件及.bin格式的映像文件,后两种文件可以直接下载到单片机上运行。源码程序包内包含若干示例汇编源程序(.asm),proteus的格式的数字种的仿真文件,用以测试编译结果,另有编译后的dos下的可执行文件myasm51.exe,可以在windows的命令窗口下运行。另外提供一个简明的用户手册以供参考。以下为程序包的README: What is Myasm51 =============== Myasm51 is an open source mini-assembler for the Intel MCS-51 family of microcontrollers or the compatible ones, distributed under the GPL license. By scanning the source file in two pass, Myasm51 translates a symbolic code in text file (assembly language source) into a machine executable object file. During the first pass, the assembler builds a symbol table from the symbols and labels used in the source file. In the second pass, the assembler maps the source file into machine code and generates the listing file through what it receives in the first pass. Myasm51 is an absolute assembler and only generates absolute object files in the plain binary file (with .bin extension) or the Intel Hex file (with .Hex extension) which can be read by any ROM programmer to burn the object code into the ROM space of microcontrollers. How to make =========== We assume that the UNIX utilities yacc and lex have been installed in you system, and following these steps to build Myasm51 by the super user 'root' in the Linux or the UNIX cloned system. # tar zxf myasm51-gk-20151208_121306.tar.gz # cd myasm51 # make # cp myasm51 /usr/local/bin done. How to use ========== [root@rh9 myasm51]# cd examples [root@rh9 examples]# myasm51 Myasm51 Assembler. Ver 0.01 Release 1, (20151231_165818) [email protected], Wed Sep 30 17:28:09 CST 2015 built: Dec 31 2015 - 17:04:44 Usage: myasm51 [-o] [-F] [-C] [-d] in.asm where -ob to output binary file 'in.bin' -oh to output hex file 'in.hx' (default format) -oH to output Intel Hex file 'in.Hex' -F to fill free bit with 0 or 1, (default 0) -C to t

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值