03-28-2006, 07:54 AM
I went to the boondocks for 2 days and I find this message plastered in front of my monitor.....
[translated in english]
Now I wouldn't do this if I didn't know ther teacher taught them well, but I knew she didn't. I knew some of her former students. And the fact that they don't have their own computer plus they also are not allowed to use the lab these days. There are about 6 programs here that I need to debug. I get paid for this also. Preparing for my daughter's birthday was another motivation to get paid for this. :*) But I probably woul'd never try to debug but write their proggies from scratch. I would explain what the code does to them to so I'd better rewrite these from scratch.
Why rewrite from scratch? Well, would you rather debug this?
Spaghetti City!!!!
Looking at the code makes smile a little. :*)
[translated in english]
Quote:Sir,
Would you kindly debug these programs? This is a project of of ours and we need this by thursday or we fail. Our teacher won't let us in the lab. I was referred here by "name withheld" who you made that nice polygon calculator. She says you're only the one person who can do this and finish it in time.
Regards Kessa,
BS, IT **** State University
Now I wouldn't do this if I didn't know ther teacher taught them well, but I knew she didn't. I knew some of her former students. And the fact that they don't have their own computer plus they also are not allowed to use the lab these days. There are about 6 programs here that I need to debug. I get paid for this also. Preparing for my daughter's birthday was another motivation to get paid for this. :*) But I probably woul'd never try to debug but write their proggies from scratch. I would explain what the code does to them to so I'd better rewrite these from scratch.
Why rewrite from scratch? Well, would you rather debug this?
Spaghetti City!!!!
Code:
.model small
.stack 100
.data
game db 13,10, " WELCOME!$"
game1 db 13,10,"Instruction:answer 3 questions given by choosing to the given selections.Type the letter of the chosen answer and press enter(press enter)$"
game2 db 13,10, "1.What is the name of the path that energy takes as one living thing eats another living thing?"
db 13,10, " a.Consumers"
db 13,10, " b.producers"
db 13,10, " c.foodchain$"
msg3 db 13,10, "enter your choice:$"
game4 db 13,10, "2.All of the population living together in a region forms a ______?"
db 13,10, " a.Habitat"
db 13,10, " b.Population"
db 13,10, " c.Community$"
msg5 db 13,10, "enter your choice:$"
game6 db 13,10, "3.How many planets are in the solar system?"
db 13,10, " a.7"
db 13,10, " b.9"
db 13,10, " c.12$"
msg7 db 13,10, "enter your choice:$"
ask1 db 13,10, "your correct!$"
ask2 db 13,10, "your wrong!$"
ask3 db 13,10, "your correct!$"
ask4 db 13,10, "your wrong!$"
ask5 db 13,10, "your correct!$"
asK6 db 13,10, "your wrong!$"
nameinput label byte
maxnamelen db 50
curnamelen db 50
namefield db 50 dup(?)
nameinput1 label byte
maxnamelen1 db 50
curnamelen1 db 50
namefield1 db 50 dup(?)
nameinput2 label byte
maxnamelen2 db 50
curnamelen2 db 50
namefield2 db 50 dup(?)
nameinput3 label byte
maxnamelen3 db 50
curnamelen3 db 50
namefield3 db 50 dup(?)
nameinput4 label byte
maxnamelen4 db 50
curnamelen4 db 50
namefield4 db 50 dup(?)
nameinput5 label byte
maxnamelen5 db 50
curnamelen5 db 50
namefield5 db 50 dup(?)
nameinput6 label byte
maxnamelen6 db 50
curnamelen6 db 50
namefield6 db 50 dup(?)
nameinput7 label byte
maxnamelen7 db 50
curnamelen7 db 50
namefield7 db 50 dup(?)
newline db 13,10,"$"
.code
begin proc
mov ax,@data
mov ds,ax
mov ah,09h
mov dx,offset game
int 21h
mov ah,0ah
mov dx,offset nameinput
int 21h
mov bx,0
mov bl,curnamelen
mov namefield[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
mov ah,09h
mov dx,offset game1
int 21h
mov ah,0ah
mov dx,offset nameinput1
int 21h
mov bx,0
mov bl,curnamelen1
mov namefield1[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
mov ah,09h
mov dx,offset game2
int 21h
mov ah,0ah
mov dx,offset nameinput2
int 21h
mov bx,0
mov bl,curnamelen2
mov namefield2[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
mov ah,09h
mov dx,offset msg3
int 21h
mov ah,0ah
mov dx,offset nameinput3
int 21h
mov bx,0
mov bl,curnamelen3
mov namefield3[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
cmp al,'a'
je labelwrong
labelwrong:
mov ah,09h
mov dx,offset ask2
int 21h
mov ah,0ah
mov dx,offset nameinput
int 21h
mov bx,0
mov bl,curnamelen
mov namefield[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
cmp al,'b'
je labelwrong
mov ah,09h
mov dx,offset ask2
int 21h
mov ah,0ah
mov dx,offset nameinput
int 21h
mov bx,0
mov bl,curnamelen
mov namefield[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
cmp al,'c'
je labelcorrect
mov ah,09h
mov dx,offset ask1
int 21h
mov ah,0ah
mov dx,offset nameinput
int 21h
mov bx,0
mov bl,curnamelen
mov namefield[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
mov ah,09h
mov dx,offset game4
int 21h
mov ah,0ah
mov dx,offset nameinput4
int 21h
mov bx,0
mov bl,curnamelen4
mov namefield4[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
mov ah,09h
mov dx,offset msg5
int 21h
mov ah,0ah
mov dx,offset nameinput5
int 21h
mov bx,0
mov bl,curnamelen5
mov namefield5[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
cmp al,'a'
je labelwrong3
mov ah,09h
mov dx,offset ask4
int 21h
mov ah,0ah
mov dx,offset nameinput
int 21h
mov bx,0
mov bl,curnamelen
mov namefield[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
cmp al,'b'
je labelwrong4
mov ah,09h
mov dx,offset ask4
int 21h
mov ah,0ah
mov dx,offset nameinput
int 21h
mov bx,0
mov bl,curnamelen
mov namefield[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
cmp al,'c'
je labelcorrect2
mov ah,09h
mov dx,offset ask3
int 21h
mov ah,0ah
mov dx,offset nameinput
int 21h
mov bx,0
mov bl,curnamelen
mov namefield[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
mov ah,09h
mov dx,offset game6
int 21h
mov ah,0ah
mov dx,offset nameinput6
int 21h
mov bx,0
mov bl,curnamelen6
mov namefield6[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
mov ah,09h
mov dx,offset msg7
int 21h
mov ah,0ah
mov dx,offset nameinput7
int 21h
mov bx,0
mov bl,curnamelen7
mov namefield7[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
cmp al,'a'
je labelwrong5
mov ah,09h
mov dx,offset ask6
int 21h
mov ah,0ah
mov dx,offset nameinput
int 21h
mov bx,0
mov bl,curnamelen
mov namefield[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
cmp al,'b'
je labelcorrect3
mov ah,09h
mov dx,offset ask5
int 21h
mov ah,0ah
mov dx,offset nameinput
int 21h
mov bx,0
mov bl,curnamelen
mov namefield[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
cmp al,'c'
je labelwrong6
mov ah,09h
mov dx,offset ask6
int 21h
mov ah,0ah
mov dx,offset nameinput
int 21h
mov bx,0
mov bl,curnamelen
mov namefield[bx],"$"
mov ah,09h
mov dx,offset newline
int 21h
mov ah,4ch
int 21h
begin endp
end begin
Looking at the code makes smile a little. :*)