小写字母变成大写字母的汇编程序
scturtle
posted @ 2009年9月29日 00:39
in 各种实验
, 3776 阅读
停课了,这是第二周,自己看着汇编
DSEG SEGMENT
STRING DB 'hello bird!',0DH,0AH,'$'
DSEG ENDS
STACK1 SEGMENT STACK
DB 256 DUP(?)
STACK1 ENDS
CSEG SEGMENT
ASSUME CS:CSEG, DS:DSEG, SS:STACK1
START:
MOV AX,DSEG
MOV DS,AX
MOV BX,OFFSET STRING
MOV AX,0
MOV SI,AX
STR_L: CMP STRING[SI],'a'
JB NEXT
CMP STRING[SI],'z'
JA NEXT
SUB STRING[SI],20H
NEXT: INC SI
CMP STRING[SI],'$'
JNZ STR_L
MOV DX,OFFSET STRING ;这句可以用LEA DX,NOTE来替代,DX是数据通用寄存器
MOV AH,09H ;09H对应的是显示字符串
INT 21H
MOV AX, 4C00H
INT 21H
CSEG ENDS
END START
循环的那段本来按书上这么写的
MOV CX,11D
MOV AX,0
MOV SI,AX
STR_L: CMP STRING[SI],'a'
JB NEXT
CMP STRING[SI],'z'
JA NEXT
SUB STRING[SI],20H
NEXT: INC SI
LOOP STR_L
MOV AX,0
MOV SI,AX
STR_L: CMP STRING[SI],'a'
JB NEXT
CMP STRING[SI],'z'
JA NEXT
SUB STRING[SI],20H
NEXT: INC SI
LOOP STR_L
然后貌似还可以这样
MOV AX,0
MOV SI,AX
STR_L: .IF STRING[SI]>='a' && STRING[SI]<='z'
SUB STRING[SI],20H
.ENDIF
INC SI
CMP STRING[SI],'$'
JNZ STR_L
MOV SI,AX
STR_L: .IF STRING[SI]>='a' && STRING[SI]<='z'
SUB STRING[SI],20H
.ENDIF
INC SI
CMP STRING[SI],'$'
JNZ STR_L
2021年8月28日 17:49
Steps looking just for specialized housecleaning services for a interiors and additionally furniture, they really want not be bothered. You will likely search specialist people offer all of these services with their many of feel and ability. They are purchased their customers to look at standard, customized and variable interior housecleaning services. They are simply dedicated and present timely, innovative and cheaper services. Using the search engines, you will be able to find an extremely committed and additionally experienced party of professionals within your neighborhood.
2023年8月09日 19:26
Day-to-day life in any home will make chaotic loads and jumble. Unless you possess sufficient energy to treat this routine service regularly, you may have to contract real estate keeper support that you're performing the requirements. This vacuuming individual and / or group could be going into your dwelling and maintaining your residential. It is really critical Previously reaching some maid system, focus everything that obligations you need a cleaning organization that you're performing on your property. You regularly have particular ranges that want consideration on your property. Maybe a couple rooms on your property won't desire cleaning. Note specified errands that you ought to have practiced, for situation, floors, replacement windows, or dress. Organizations definitely will furnish most people with evaluations looking at your package of give good results.
2023年8月26日 19:25
Arunachal Pradesh 7th Question Paper 2024 All the Online PDF format Question Papers Provided by Board of Secondary Education Arunachal Pradesh,Arunachal Pradesh Model Question Paper 2024 are Arunachal Pradesh 7th Model Paper 2024 Prepared as per the updated Board of Education in the Arunachal Pradesh State Syllabus to help Students in their exam Preparations, which Aims to build both the Practical knowledge as well as analytical Skills for Arunachal Pradesh Every Student,Arunachal Pradesh Question Paper 2024 are Prepared as per the updated Arunachal Pradesh Syllabus & Exam Pattern to help Students in their Exam Preparations.Arunachal Pradesh Previous Question Paper 2024 will help a lot to the Students.