四年过去了,只留下些代码...
1.data segment
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
MOV CX,26
MOV BL,'A'
LOP: MOV DL,BL
MOV AH,2
INT 21H
ADD BL,1
LOOP LOP
exit: mov ah,4cH
int 21H
code ends
end start
2.data segment
X DB 4 DUP(?)
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
MOV BX,OFFSET X
MOV CX,4
LOP1: MOV AH,1
INT 21H
MOV [BX],AL
INC BX
LOOP LOP1
MOV DX,2
LOP2: MOV SI,OFFSET X
MOV AL,[SI]
SUB AL,30H
CMP AL,0AH
JB NEXT1
SUB AL,7
NEXT1:MOV CL,4
SAL AL,CL
MOV BL,AL
INC SI
MOV AL,[SI]
SUB AL,30H
CMP AL,0AH
JB NEXT2
SUB AL,7
NEXT2:OR AL,BL
sal AL,1
jc next3
mov dl,30h
jmp next4
next3: mov dl,31h
next4: mov ah,2
int 21h
INC SI
DEC DX
JNZ LOP2
exit: mov ah,4cH
int 21H
code ends
end start
3.data segment
s db 4 dup (?)
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov cx,4
lea si,s
input: mov ah,1
int 21h
cmp al,30h
jb input
cmp al,39h
ja con1
sub al,30h
jmp bc
con1: cmp al,41h
jb input
cmp al,46h
ja con2
sub al,37h
jmp bc
con2: cmp al,61h
jb input
cmp al,66h
ja input
sub al,57h
bc: mov [si],al
inc si
loop input
lea si,s
mov cl,4
mov bl,4
mov ax,0
lop: shl ax,cl
add al,[si]
inc si
dec bl
jnz lop
mov bx,ax
mov cx,16
output: sal bx,1
jc next1
mov dl,30h
jmp next2
next1: mov dl,31h
next2: mov ah,2
int 21h
loop output
mov ah,4ch
int 21h
code ends
end start
6.
data segment
key dw 25
addr dw ?
data ends
edata segment
table dw 6,3,25,30,46,75
edata ends
code segment
main proc far
assume cs:code,ds:data,es:edata
start:
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
mov ax,edata
mov es,ax
mov di,offset table
mov ax,key
ahk_first:
cmp ax,es:[di+2]
ja ahk_firstl
lea si,es:[di+2]
ja exit
stc
jmp exit
ahk_firstl:
mov si,es:[di]
shl si,1
add si,di
cmp ax,es:[si]
jb search
stc
jmp exit
search:
mov addr,di
mov si,es:[di]
even_idx:
test si,1
jz add_idx
inc si
add_idx:
add di,si
compare:
cmp ax,es:[di]
je all_doce
ja higher
lower:
cmp si,2
jne idx_ok
no_match:
stc
je all_doce
idx_ok:
shr si,1
test si,1
jz sub_ibx
inc si
sub_ibx:
sub di,si
jmp short compare
higher:
cmp si,2
je no_match
shr si,1
jmp short even_idx
all_doce:
mov si,di
mov di,addr
exit:ret
main endp
code ends
end start
26.datas segment
main proc far
assume cs:datas
start: push ds
sub ax,ax
push ax
call data
call crlf
call printit
ret
main endp
data proc near
mov bx,0
mov dh,4
newc: mov ah,01h
int 21h
sub al,30h
jl exit
cmp al,10
jl abcd
sub al,27h
cmp al,0Ah
jl exit
cmp al,10h
jge exit
abcd: mov cl,4
shl bx,cl
mov ah,0
add bx,ax
dec dh
jnz newc
exit: ret
data endp
crlf proc near
mov dl,0Ah
mov ah,02h
int 21h
mov dl,0Dh
mov ah,02h
int 21h
ret
crlf endp
printit proc near
mov cx,16
lop: shl bx,1
jc next1
mov dl,30h
jmp next2
next1: mov dl,31h
next2: mov ah,2
int 21h
loop lop
ret
printit endp
datas ends
end start
1.DATA SEGMENT
STRING DB 'a',' ','b',' ',' ','c','d','$'
POST DB ?
COUNT EQU 80
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:MOV AX,DATA
MOV DS,AX
MOV DI,OFFSET STRING
MOV DL,0
MOV CX,COUNT
LOP1:
MOV AL,[DI]
CMP AL,20H
JNE AA;不等就指向下一个字符
JE BB ;相等就存当前位置dx到post
AA:
INC DI
INC DX
loop LOP1
MOV AL,81H;循环所有字符仍没有找到空格,将-1存入post
MOV POST,AL
JMP exit
BB:MOV POST,DL
jmp exit
exit:MOV AH,4CH
INT 21H
CODE ENDS
END START
1.data segment
x db 3
y db ?
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
mov al,x
cmp al,0
jge bigr
mov bl,0
sub bl,al
mov y,al
jmp exit
bigr: mov y,al
exit: mov ah,4cH
int 21H
code ends
end start
2.data segment
a1 db 'you are right!'
N equ $-al
a2 db N DUP(?)
sl db ?
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
mov bx,offset a1
mov di,offset a2
mov cx,N
lop: cmp [bx],'z'
ja nolowwer
cmp [bx],'a'
jb nolowwer
mov a2,[bx];xiaoxiezimu
inc di
inc bx
nolowwer:inc bx;feixiaoxiezimu
loop lop
exit: mov ah,4cH
int 21H
code ends
end start
3.data segment
status db '10111101'
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
mov al,status
mov cx,0
shl al,1
jnc count
inc cx
count: mov cl,2
shl al,cl
jnc count2
inc cx
count2:mov cl,2
shl al,cl
jc count3
inc cx
count3:cmp cx,0
je rout4
cmp cx,1
je rout1
cmp cx,2
je rout2
cmp cx,3
je rout3
rout1:
jmp exit
rout2:
jmp exit
rout3:
jmp exit
rout4:
jmp exit
exit: mov ah,4cH
int 21H
code ends
end start
4.data segment
string db '$'
N equ 80
post db ?
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
mov bx,offset string
mov cx,N-1
mov dx,0
lop: cmp bx,20H
je sp1
mov post,81H
sp1: inc bx
add dx,1
loop lop
exit: mov ah,4cH
int 21H
code ends
end start
5.code segment
assume cs:code
start: mov ah,1
int 21H
cmp al,'z'
ja label4
cmp al,'a'
jae label1
cmp al,'Z'
ja label4
cmp al,'A'
jae label2
cmp al,'9'
ja label4
cmp al,'0'
jae label3
jmp label4
label1: mov dl,'L'
mov ah,2
int 21h
jmp exit
label2:mov dl,'U'
mov ah,2
int 21h
jmp exit
label3:mov dl,'N'
mov ah,2
int 21h
jmp exit
label4:mov dl,'*'
mov ah,2
int 21h
exit: mov ah,4cH
int 21H
code ends
end start