solve me this

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
Amenofhis
Posts: 31
Joined: 21 Nov 2008

solve me this

Post by Amenofhis »

.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
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Post by BigEd »

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.
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Post by BigDumbDinosaur »

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: Select all

.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!
Amenofhis
Posts: 31
Joined: 21 Nov 2008

Post by Amenofhis »

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
Amenofhis
Posts: 31
Joined: 21 Nov 2008

Post by Amenofhis »

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: Select all

.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
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Post by BigEd »

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.
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

solve me this

Post by BigDumbDinosaur »

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!
Amenofhis
Posts: 31
Joined: 21 Nov 2008

Post by Amenofhis »

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.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Post by BigEd »

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
Amenofhis
Posts: 31
Joined: 21 Nov 2008

Post by Amenofhis »

than you for everyone that helped me.... ill drop thisand move on see ya guys
Post Reply