汇编课后习题2.14《32位汇编语言程序设计》

任务是打ASCII

我用了三个汇编程序写的

其实只是换了数据类型而已

觉得学习汇编还是很容易的,现在把代码贴在这里:

;ex0214.asm
	include io32.inc 
	
	.data
		str1 byte " !", ' "', " # $ % & ' ( ) * + , - . /", 0
		str2 byte "0 1 2 3 4 5 6 7 8 9 : ; < = > ?", 0
		str3 byte "@ A B C D E F G H I J K L M N O", 0
		str4 byte "P Q R S T U V W X Y Z [ \ ] ^ -", 0
		str5 byte "' a b c d e f g h i j k l m n o", 0
		str6 byte "p q r s t u v w x y z { | } ~"
		
	.code
	start:
		call dispcrlf
		mov eax, offset str1
		call dispmsg
		 
		call dispcrlf
		mov eax, offset str2
		call dispmsg
		
		call dispcrlf
		mov eax, offset str3
		call dispmsg
		
		call dispcrlf
		mov eax, offset str4
		call dispmsg
		
		call dispcrlf
		mov eax, offset str5
		call dispmsg
		
		call dispcrlf
		mov eax, offset str6
		call dispmsg
		exit 0
	end start


;extest.asm
	include io32.inc
	
	.data
		str1 dword 20212020h, 20232022h, 20252024h, 20272026h, 20292028h, 202b202ah, 202d202ch, 202f202eh, 0
		str2 dword 20312030h, 20332032h, 20352034h, 20372036h, 20392038h, 203b203ah, 203d203ch, 203f203eh, 0
		str3 dword 20412040h, 20432042h, 20452044h, 20472046h, 20492048h, 204b204ah, 204d204ch, 204f204eh, 0
		str4 dword 20512050h, 20532052h, 20552054h, 20572056h, 20592058h, 205b205ah, 205d205ch, 205f205eh, 0
		str5 dword 20612060h, 20632062h, 20652064h, 20672066h, 20692068h, 206b206ah, 206d206ch, 206f206eh, 0
		str6 dword 20712070h, 20732072h, 20752074h, 20772076h, 20792078h, 207b207ah, 207d207ch, 2020207eh, 0
		
	.code
	start:
		call dispcrlf
		mov eax, offset str1
		call dispmsg
		
		call dispcrlf
		mov eax, offset str2
		call dispmsg
		
		call dispcrlf
		mov eax, offset str3
		call dispmsg
		
		call dispcrlf
		mov eax, offset str4
		call dispmsg
		
		call dispcrlf
		mov eax, offset str5
		call dispmsg
		
		call dispcrlf
		mov eax, offset str6
		call dispmsg
		exit 0
	end start

;extest.asm
	include io32.inc
	
	.data
		strs tbyte 20242023202220212020h, 20292028202720262025h, 
			202e202d202c202b202ah, 2032203120300d0a202fh,
			20372036203520342033h, 203c203b203a20392038h,
			20400d0a203f203e203dh, 20452044204320422041h,
			204a2049204820472046h, 204f204e204d204c204bh,
			20532052205120500d0ah, 20582057205620552054h,
			205d205c205b205a2059h, 206120600d0a205f205eh,
			20662065206420632062h, 206b206a206920682067h,
			0d0a206f206e206d206ch, 20742073207220712070h,
			20792078207720752075h, 207e207d207c207b207ah
			
		
	.code
	start:
		call dispcrlf
		mov eax, offset strs
		call dispmsg
		exit 0
	end start


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值