作者在 2011-02-05 15:57:47 发布以下内容
我不是大学生,文化只有高中,但我知道美国的孩子们好多已经是“黑客”高手了,而中国的孩子们对编程是什么都不知道,更谈不上学习了,我觉得编程中国这个网站应该把对孩子们的教育放在第一位,并作为宗旨向会员们宣传。以下是我的一个程序:
data segment
data1 db 30
db ?
db 30 dup(?)
data2 dw 10 dup(?)
data3 dw ?
flag dw ?
data4 dw 10000,1000,100,10,1
data ends
code segment
assume ds:data,cs:code
main proc far
mov ax,data
mov ds,ax
mov ah,0ah
lea dx,data1
int 21h
mov di,offset data2
mov si,offset data1
inc si
newcher: sub ax,ax
sub bx,bx
sub cx,cx
newch: add si,1
mov al,[si]
cmp al,2bh
jz chuan
cmp al,2dh
jz chuan
cmp al,2ah
jz chuan
cmp al,3dh
jz asd
sub al,30h
sub ah,ah
cbw
xchg ax,bx
mov cx,10d
mul cx
xchg ax,bx
add bx,ax
jmp newch
chuan: mov [di],bx
add di,2
mov ah,0
mov [di],ax
add di,2
jmp newcher
asd: mov [di],bx
add di,2
mov ah,0
mov [di],ax
sub bx,bx
call crlf
call ze
call crlf
call jij
call crlf
call binidec
call crlf
mov ah,4ch
int 21h
main endp
ze proc near
xor ax,ax
mov ax,data
mov ds,ax
mov bx,0
hui: add bx,2
mov dx,data2[bx]
cmp dl,2ah
jz chen
cmp dl,3dh
jz no
cmp dl,2bh
jz huiu
cmp dl,2dh
jz huiu
huiu: add bx,2
jmp hui
chen:sub bx,2
mov ax,data2[bx]
add bx,4
mov cx,data2[bx]
jiang: xor dx,dx
mul cx
xor dx,dx
chuang: lea si,data2[bx]
lea di,data2[bx]
sub di,4
mov [di],ax
tiao: xor ax,ax
add si,2
mov ax,[si]
add di,2
mov [di],ax
cmp ax,3dh
jnz tiao
sub bx,4
jmp hui
no: ret
ze endp
jij proc near
xor ax,ax
xor si,si
xor bx,bx
lea si,data2
mov ax,[si]
jkl: add si,2
mov bx,[si]
cmp bl,2bh
jz jia
cmp bl,2dh
jz jian
cmp bl,3dh
jz exiy
jia: add si,2
add ax,[si]
jmp jkl
jian: add si,2
sub ax,[si]
jmp jkl
exiy:
mov data3,ax
ret
jij endp
binidec proc near
mov ax,0
mov ax,data
mov ds,ax
sub ax,ax
mov bx,data3
mov flag,0
mov cx,5
lea si,data4
decdiv: mov ax,bx
mov dx,0
div word ptr[si]
mov bx,dx
mov dl,al
cmp flag,0
jnz print1
cmp dl,0
je skip
mov flag,1
print1: add dl,30h
MOV AH,02H
int 21h
skip: add si,2
loop decdIV
RET
binidec endp
crlf proc near
mov dl,0dh
mov ah,2h
int 21h
mov dl,0ah
mov ah,2h
int 21h
ret
crlf endp
data1 db 30
db ?
db 30 dup(?)
data2 dw 10 dup(?)
data3 dw ?
flag dw ?
data4 dw 10000,1000,100,10,1
data ends
code segment
assume ds:data,cs:code
main proc far
mov ax,data
mov ds,ax
mov ah,0ah
lea dx,data1
int 21h
mov di,offset data2
mov si,offset data1
inc si
newcher: sub ax,ax
sub bx,bx
sub cx,cx
newch: add si,1
mov al,[si]
cmp al,2bh
jz chuan
cmp al,2dh
jz chuan
cmp al,2ah
jz chuan
cmp al,3dh
jz asd
sub al,30h
sub ah,ah
cbw
xchg ax,bx
mov cx,10d
mul cx
xchg ax,bx
add bx,ax
jmp newch
chuan: mov [di],bx
add di,2
mov ah,0
mov [di],ax
add di,2
jmp newcher
asd: mov [di],bx
add di,2
mov ah,0
mov [di],ax
sub bx,bx
call crlf
call ze
call crlf
call jij
call crlf
call binidec
call crlf
mov ah,4ch
int 21h
main endp
ze proc near
xor ax,ax
mov ax,data
mov ds,ax
mov bx,0
hui: add bx,2
mov dx,data2[bx]
cmp dl,2ah
jz chen
cmp dl,3dh
jz no
cmp dl,2bh
jz huiu
cmp dl,2dh
jz huiu
huiu: add bx,2
jmp hui
chen:sub bx,2
mov ax,data2[bx]
add bx,4
mov cx,data2[bx]
jiang: xor dx,dx
mul cx
xor dx,dx
chuang: lea si,data2[bx]
lea di,data2[bx]
sub di,4
mov [di],ax
tiao: xor ax,ax
add si,2
mov ax,[si]
add di,2
mov [di],ax
cmp ax,3dh
jnz tiao
sub bx,4
jmp hui
no: ret
ze endp
jij proc near
xor ax,ax
xor si,si
xor bx,bx
lea si,data2
mov ax,[si]
jkl: add si,2
mov bx,[si]
cmp bl,2bh
jz jia
cmp bl,2dh
jz jian
cmp bl,3dh
jz exiy
jia: add si,2
add ax,[si]
jmp jkl
jian: add si,2
sub ax,[si]
jmp jkl
exiy:
mov data3,ax
ret
jij endp
binidec proc near
mov ax,0
mov ax,data
mov ds,ax
sub ax,ax
mov bx,data3
mov flag,0
mov cx,5
lea si,data4
decdiv: mov ax,bx
mov dx,0
div word ptr[si]
mov bx,dx
mov dl,al
cmp flag,0
jnz print1
cmp dl,0
je skip
mov flag,1
print1: add dl,30h
MOV AH,02H
int 21h
skip: add si,2
loop decdIV
RET
binidec endp
crlf proc near
mov dl,0dh
mov ah,2h
int 21h
mov dl,0ah
mov ah,2h
int 21h
ret
crlf endp
code ends
end main
希望大家能对我的建议主持,尽快行动起来,让孩子们的学习积极性早日发挥出来。