6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 12:28 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: solve me this
PostPosted: Thu Nov 18, 2010 1:11 am 
Offline

Joined: Fri Nov 21, 2008 3:07 pm
Posts: 31
.ORG $0200
PUTHEX=IO_AREA+3
PUTC =IO_AREA+1
SED
JSR DISPLAY_MSG
JSR CHECK_M2
BEQ DISP_RESULT
JSR SUMA
BEQ DISP_RESULT
BRK
DISP_RESULT:ldx #$05
SIG_P: LDA PROD, X
STA PUTHEX
DEX
BMI FIN_PROGRAMA
JMP SIG_P
FIN_PROGRAMA: BRK
SUMA: CLC
LDA M1+0
ADC PROD+0
STA PROD+0
LDA M1+1
ADC PROD+1
STA PROD+1
LDA M1+2
ADC PROD+2
STA PROD+2
JSR INC_PROD
JSR DECREM
JSR CHECK_M2
BNE SUMA
JMP DISP_RESULT
CHECK_M2 LDX #$00
LDA M2,X
BNE FIN_CHECK
INX
LDA M2,X
BNE FIN_CHECK
INX
LDA M2,X
FIN_CHECK: RTS
INC_PROD: BCC FIN
LDA #$00
LDX #$03
ADC PROD,X
STA PROD,X
INX
LDA #$00
ADC PROD,X
STA PROD,X
INX
LDA #$00
ADC PROD,X
STA PROD,X
FIN: RTS
DECREM: LDX #$00
LDA M2,X
BNE Y0
INX
LDA M2,X
BNE Y1
INX
LDA M2,X
BEQ Y2
SEC
SBC #$1
STA M2,X
DEX
LDA M2,X
Y1: SEC
SBC #$1
STA M2,X
DEX
LDA M2,X
Y0: SEC
SBC #$1
STA M2,X
Y2: CLC
RTS

DISPLAY_MSG: LDY #$00
SIG_CARACTER: LDA MSG,Y
CMP #$24
BEQ FINAL_CADENA
STA PUTC
INY
JMP SIG_CARACTER
FINAL_CADENA: RTS

MSG:.DB "RESULTADO DE LA MULTIPLICACION ES: ","$"

M1: .DB $00,$00,$05 ;MULTIPLICADOR
M2: .DB $00,$00,$05 ;MULTIPLICANDO
PROD: .DB 00,00,00,0

i want that it doenst appear all these zeros how i do it...??? and if i get a result ze5ro it appear only the 0
whould u guys help me please


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 18, 2010 7:11 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Two years ago you did the same thing. How about you show us that you're learning, show us that you're thinking clearly and carefully, and ask a coherent question.

kc5tja wrote:
It is a standing policy of this board and its members to not complete the homework of students. I'm sorry, you'll need to derive the solution yourself.


If you genuinely want to program in assembly language, you're going to have to work very hard on improving your care and your attention to detail. You paste blocks of code but otherwise you take no care at all.

How about you put some effort in to think clearly, express your thoughts clearly, explain what you're trying to do and in what respect you're getting stuck?

This is usually a friendly and helpful forum, but you're not acting like someone who's interested in understanding or improving - you're acting like someone who expects a free gift.

Ed

Edit: refer to previous conversation 2 years ago, rewording.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 18, 2010 4:34 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
BigEd wrote:
Two years ago you did the same thing. How about you show us that you're learning, show us that you're thinking clearly and carefully, and ask a coherent question.

Code:
.ORG $0200
PUTHEX=IO_AREA+3
PUTC =IO_AREA+1
SED
JSR DISPLAY_MSG
JSR CHECK_M2
BEQ DISP_RESULT
JSR SUMA
BEQ DISP_RESULT
BRK
DISP_RESULT:ldx #$05
SIG_P: LDA PROD, X
STA PUTHEX
DEX
BMI FIN_PROGRAMA
JMP SIG_P
FIN_PROGRAMA: BRK
SUMA: CLC
LDA M1+0
ADC PROD+0
STA PROD+0
LDA M1+1
ADC PROD+1
STA PROD+1
LDA M1+2
ADC PROD+2
STA PROD+2
JSR INC_PROD
JSR DECREM
JSR CHECK_M2
BNE SUMA
JMP DISP_RESULT
CHECK_M2 LDX #$00
LDA M2,X
BNE FIN_CHECK
INX
LDA M2,X
BNE FIN_CHECK
INX
LDA M2,X
FIN_CHECK: RTS
INC_PROD: BCC FIN
LDA #$00
LDX #$03
ADC PROD,X
STA PROD,X
INX
LDA #$00
ADC PROD,X
STA PROD,X
INX
LDA #$00
ADC PROD,X
STA PROD,X
FIN: RTS
DECREM: LDX #$00
LDA M2,X
BNE Y0
INX
LDA M2,X
BNE Y1
INX
LDA M2,X
BEQ Y2
SEC
SBC #$1
STA M2,X
DEX
LDA M2,X
Y1: SEC
SBC #$1
STA M2,X
DEX
LDA M2,X
Y0: SEC
SBC #$1
STA M2,X
Y2: CLC
RTS

DISPLAY_MSG: LDY #$00
SIG_CARACTER: LDA MSG,Y
CMP #$24
BEQ FINAL_CADENA
STA PUTC
INY
JMP SIG_CARACTER
FINAL_CADENA: RTS

MSG:.DB "RESULTADO DE LA MULTIPLICACION ES: ","$"

M1: .DB $00,$00,$05 ;MULTIPLICADOR
M2: .DB $00,$00,$05 ;MULTIPLICANDO
PROD: .DB 00,00,00,0


Even after doing the above, it's not at all clear as to what is going on—a comment in this source code would die of sheer loneliness. I really don't have a clue as to what he is trying to achieve.

In any case, Ed's comments stand. As the old saying goes, "The Lord helps those who help themselves." You (Amenofhis) wrote it, you figure it out.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 18, 2010 6:26 pm 
Offline

Joined: Fri Nov 21, 2008 3:07 pm
Posts: 31
actually is not my homework.. i just had corius of programing.. a friend is teaching me... how to work in but still he dont know much... thats why im asking here.

either way thank you and im gone give support as im the one thats its needed


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 18, 2010 6:41 pm 
Offline

Joined: Fri Nov 21, 2008 3:07 pm
Posts: 31
BigDumbDinosaur wrote:
BigEd wrote:
Two years ago you did the same thing. How about you show us that you're learning, show us that you're thinking clearly and carefully, and ask a coherent question.

Code:
.ORG $0200
PUTHEX=IO_AREA+3
PUTC =IO_AREA+1
SED
JSR DISPLAY_MSG
JSR CHECK_M2
BEQ DISP_RESULT
JSR SUMA
BEQ DISP_RESULT
BRK
DISP_RESULT:ldx #$05
SIG_P: LDA PROD, X
STA PUTHEX
DEX
BMI FIN_PROGRAMA
JMP SIG_P
FIN_PROGRAMA: BRK
SUMA: CLC
LDA M1+0
ADC PROD+0
STA PROD+0
LDA M1+1
ADC PROD+1
STA PROD+1
LDA M1+2
ADC PROD+2
STA PROD+2
JSR INC_PROD
JSR DECREM
JSR CHECK_M2
BNE SUMA
JMP DISP_RESULT
CHECK_M2 LDX #$00
LDA M2,X
BNE FIN_CHECK
INX
LDA M2,X
BNE FIN_CHECK
INX
LDA M2,X
FIN_CHECK: RTS
INC_PROD: BCC FIN
LDA #$00
LDX #$03
ADC PROD,X
STA PROD,X
INX
LDA #$00
ADC PROD,X
STA PROD,X
INX
LDA #$00
ADC PROD,X
STA PROD,X
FIN: RTS
DECREM: LDX #$00
LDA M2,X
BNE Y0
INX
LDA M2,X
BNE Y1
INX
LDA M2,X
BEQ Y2
SEC
SBC #$1
STA M2,X
DEX
LDA M2,X
Y1: SEC
SBC #$1
STA M2,X
DEX
LDA M2,X
Y0: SEC
SBC #$1
STA M2,X
Y2: CLC
RTS

DISPLAY_MSG: LDY #$00
SIG_CARACTER: LDA MSG,Y
CMP #$24
BEQ FINAL_CADENA
STA PUTC
INY
JMP SIG_CARACTER
FINAL_CADENA: RTS

MSG:.DB "RESULTADO DE LA MULTIPLICACION ES: ","$"

M1: .DB $00,$00,$05 ;MULTIPLICADOR
M2: .DB $00,$00,$05 ;MULTIPLICANDO
PROD: .DB 00,00,00,0


Even after doing the above, it's not at all clear as to what is going on—a comment in this source code would die of sheer loneliness. I really don't have a clue as to what he is trying to achieve.

In any case, Ed's comments stand. As the old saying goes, "The Lord helps those who help themselves." You (Amenofhis) wrote it, you figure it out.


i still see all the 0... here what i want to help me with it
5x5=25 is the multiplication i leave for you guys to help me with it
the anwser appears but appear 0000000025000
i want that only appear 0 i want to eliminated the bits that are not using
so i want to be 25 instead of 0000002500 and if u mulptiply for 0 the result is 0


what i want to do (simpify) all the result to its digit and all the ress gone.. how i do this

oh btw im not student im just curius to learn this languague sorry if u guys think of me as a student


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 18, 2010 11:03 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Amenofhis wrote:
oh btw im not student im just curius to learn this languague sorry if u guys think of me as a student
This same time of year, two years ago, you had a similar problem:
Amenofhis wrote:
thats all i got for know that was the teacher told me, he teach about LSR and ASL but i didnt understand a thing

He said

Make a program that move a bit right to left and left to right in a Velocity of 10 seg and can be desplayed on the Screen that all i got.

im thinking and still not getting it.. Thats why i require help. cant do it my own im sure of that im not in the 6502 much.
Maybe you are re-taking the same course? You are still having trouble with the homework, and when you ask for help - actually you demand help - you really want someone to solve the problem for you. That kind of help isn't real help: if you pass a course by having other people write your programs, your qualification is not valid.

I think this program isn't yours, or your friends. It's an exercise, with an intentional missing feature that you have been asked to implement.

If you really want to learn to program in assembly, you need to work harder. You need to become a careful person who cares about details and tries to understand precisely what the problem is - only then can you create a solution. You may need trial and error, but if you do, you should take careful notes of what you've tried, what happened, and what the explanations might be.


Top
 Profile  
Reply with quote  
 Post subject: solve me this
PostPosted: Fri Nov 19, 2010 4:33 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
BigEd wrote:
If you really want to learn to program in assembly, you need to work harder. You need to become a careful person who cares about details and tries to understand precisely what the problem is - only then can you create a solution. You may need trial and error, but if you do, you should take careful notes of what you've tried, what happened, and what the explanations might be.

That and get in the habit of commenting your source code! Most of us are quite busy and can't expend a lot of time trying to deduce what was going on in your head while you were pounding on your keyboard. If you want help, please comment your code, clearly state your problem and ask for help NICELY.

-------------------

Edit: my typing is suckling again.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Nov 21, 2010 3:28 pm 
Offline

Joined: Fri Nov 21, 2008 3:07 pm
Posts: 31
BigEd wrote:
Amenofhis wrote:
oh btw im not student im just curius to learn this languague sorry if u guys think of me as a student
This same time of year, two years ago, you had a similar problem:
Amenofhis wrote:
thats all i got for know that was the teacher told me, he teach about LSR and ASL but i didnt understand a thing

He said

Make a program that move a bit right to left and left to right in a Velocity of 10 seg and can be desplayed on the Screen that all i got.

im thinking and still not getting it.. Thats why i require help. cant do it my own im sure of that im not in the 6502 much.
Maybe you are re-taking the same course? You are still having trouble with the homework, and when you ask for help - actually you demand help - you really want someone to solve the problem for you. That kind of help isn't real help: if you pass a course by having other people write your programs, your qualification is not valid.

I think this program isn't yours, or your friends. It's an exercise, with an intentional missing feature that you have been asked to implement.

If you really want to learn to program in assembly, you need to work harder. You need to become a careful person who cares about details and tries to understand precisely what the problem is - only then can you create a solution. You may need trial and error, but if you do, you should take careful notes of what you've tried, what happened, and what the explanations might be.




wait im 25 years old im already graduted and i call teacher everyone that is teaching me

and yes i ask around and yes i had a teacher from collage and yes i really asked for help but that was 2 years ago...
either way i do not understand fully enough about this lag programing but im traying to if i cant do it i ask for help if u can explain me how instead of lecture me then i be glad if u been doing some research of me im glad too


Last edited by Amenofhis on Sun Nov 21, 2010 3:57 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Nov 21, 2010 3:54 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Hi
I really don't want to be discouraging or unhelpful. I hope you've understood and accepted the idea that to program in assembly you need to be careful and methodical. Similarly, to get help in a forum - to earn the right to other people's time - you need to ask a meaningful question with some indication of what you know and what puzzles you, what you're trying to do and what you're seeing. Pasting a huge chunk of uncommented assembly isn't polite.

Cheers
Ed


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Nov 21, 2010 4:01 pm 
Offline

Joined: Fri Nov 21, 2008 3:07 pm
Posts: 31
than you for everyone that helped me.... ill drop thisand move on see ya guys


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: