汇编语言比较字符串是否相等显示第一个不相等的字符 data segments1 db '1234567890ABCDE's2 db '1234567890BCDEF'S3 DB '第一个不同的字符分别是:$'data endscode segmentassume cs:code,ds:datamain proc farbegin:push dsmov ax,0push axMOV AX,DATAMOV DS,AXMOV CX,15;相比较的两窜字符长度LEA SI,S1LEA DI,S2NEXT:MOV DL,[SI]MOV DH,[DI]CMP DL,DHJNE NOINC DIINC SILOOP NEXTRETNO:PUSH DXMOV AH,09MOV DX,OFFSET S3INT 21HMOV AH,02POP DXINT 21HMOV DL,DHINT 21HRETmain endpcode endsend begin
(汇编语言)字符串动画显示 DATA SEGMENTTOP DB 5 DUP(0AH)DB 31 DUP(' '),'MAIN MENU',0DH,0AHDB 25 DUP(' '),201,21 DUP(205),187,0DH,0AHDB 25 DUP(' '),186,' 1.INPUT THE STRING ',186,0DH,0AHDB 25 DUP(' '),186,' 2.DISPLAY MODEL ONE ',186,0DH,0AHDB 25 DUP(' '),186,' 3.DISPLAY MODEL TWO ',186,0DH,0AHDB 25 DUP(' '),186,' 4.RETURN DOS ',186,0DH,0AHDB 25 DUP(' '),200,21 DUP(205),188,0DH,0AHDB 28 DUP(' '),'CHOCICE(1,2,3,4):$'ENDMESG DB 5 DUP(0AH),'Please strike any key$'LINE EQU 2COLOR EQU 5FHLINE1 DB 201,56 DUP(205),187LINE2 DB 186,56 DUP(' '),186LINE3 DB 200,56 DUP(205),188LL EQU$-LINE3XX EQU(80-LL)/2KG DB 60 DUP(' ')LINE4 DB ' 'L EQU$-LINE4KK DB 60 DUP(' ')I EQU XX+1J EQU I+L-1LORG DB 0COUNT DW 0DATA ENDSSTACK SEGMENT PARA STACK'STACK'MESG DB 10 DUP?STACK ENDSCODE SEGMENTASSUME CS:CODE,DS:DATA,ES:DATA,SS:STACKBEG:MOV AX,DATAMOV DS,AXMOV ES,AXAGAIN:MOV AX,3INT 10HMOV AH,9LEA DX,TOPINT 21HMOV AH,1INT 21HCMP AL,'1'JNE NEXT1JMP S1NEXT1:CMP AL,'2'JNE NEXT2JMP S2NEXT2:CMP。
用汇编语言实现字符图案显示的课程设计案例 想先问一下,图案前面是有几个空格.下面程序是显示:不知道是不是想要的结果.:)data segmentdisp db\"*disp1 db 0ah,0dh,'$'endsstack segmentdw 128 dup(0)endscode segmentstart:mov ax,datamov ds,axmov es,axmov cx,1jxad:inc cxpush cxdec cxjx:lea dx,dispmov ah,9int 21hloop jxlea dx,disp1mov ah,9int 21hpop cxcmp cx,5jne jxadmov ax,4c00h;exit to operating system.int 21hendsend start下面这个可能可以吧.很简单.:)(3个空格)(2个空格)(1个空格)(没有空格)data segmentdisp db\"*disp1 db 0ah,0dh,\"*disp2 db 0ah,0dh,\"*disp3 db 0ah,0dh,\"*endsstack segmentdw 128 dup(0)endscode segmentstart:mov ax,datamov ds,axmov es,axlea dx,dispmov ah,9int 21hlea dx,disp1int 21hlea dx,disp2int 21hlea dx,disp3int 21hmov ax,4c00h;exit to operating system.int 21hendsend start