ET Warrior Posted December 2, 2004 Share Posted December 2, 2004 So I'm a little stuck with a program I'm writing for my Computers as Components class. I'm writing in assembly on a Motorola 68k processor, and it's a calculator program, and it does all the math in hex, and to output it i have to convert it to decimal and then into ASCII. The problem is that it outputs the first digit of the answer I input, but that's it. If the answer is more than one digit I only get the first. And so I conclude the problem lies in my recurse function which converts to decimal and then ASCII and outputs it.... I know there are a few of you on here who are gifted programmers, though I'm not sure if any of you know assembly, and if you do if you know assembly on a 68k...but I'm stuck as hell. As a note, d1, d2, and d3 are my data registers, sp is my stack pointer, d1 holds the value of the number I am converting, d2 is the radix (which is 10 since i'm converting to decimal) and D3 holds the value of my remainder of my divisions. _recurse: link a6,#0 movem.l d1-d3,-(sp) move.l 8(a6),d1 move.w #$A,d2 ANDI.l #$0000FFFF,d1 divu d2,d1 move.l d1,d3 lsr.l #8,d3 lsr.l #8,d3 ANDI.l #$0000FFFF,d1 tst d1 beq L1 move.l d1,-(sp) jsr _recurse addq #4,sp addi.w #$30,d3 move.b d3,$600003 movem.l (sp)+,d1-d3 unlk a6 rts If nobody understands and can help me that's cool Link to comment Share on other sites More sharing options...
Troopr-Undr-Fir Posted December 2, 2004 Share Posted December 2, 2004 Crap, I know what you're doing as I had a project similar to this my Junior year in my Comp. Science class. I was more good with C++ and Java than I ever was in assembly. I remember the project and when I did it... Just can't remember what I did . I know I have an assembly book around here somewhere, not a huge one, but still I think it could help you out. Let me search for ye. EDIT: I also think you're missing a line of code there somewhere, because it doesn't add up all the way. Link to comment Share on other sites More sharing options...
coupes. Posted December 3, 2004 Share Posted December 3, 2004 OMG ! assembly ! GEEK ! I'm sorry I can't help you with this... I'm know some programming language... but I've never done assembly before. Link to comment Share on other sites More sharing options...
ET Warrior Posted December 3, 2004 Author Share Posted December 3, 2004 Heh.....it actually works perfectly. The problem was actually hardware related. The LCD screen that I output to is slower than the code was sending values, so it sent values before the LCD screen was ready to write them. I wrote a little busy-wait loop that took care of it So now that my program is workin, we can change this thread to a discussion of programming in general. Who here programs, what languages do you know, what projects have you done, etc. etc. Link to comment Share on other sites More sharing options...
Samuel Dravis Posted December 3, 2004 Share Posted December 3, 2004 Originally posted by ET Warrior So now that my program is workin, we can change this thread to a discussion of programming in general. Who here programs, what languages do you know, what projects have you done, etc. etc. Meh. I know VB, PHP, some ASP, (ECMA script & VBscript). I'm supposed to be learning C/++ but it's not happenin' yet - I can read it and translate it to VB for example, but I can't write the stuff. Link to comment Share on other sites More sharing options...
coupes. Posted December 3, 2004 Share Posted December 3, 2004 I'm fluent in ASP (JScript ), Javascript, ActionScript, Lingo and even if they're not really programming languages, I also know HTML(DHTML,XHTML), XML, CSS and SQL... that's about it. In the near future I intend to lean PHP and ASP with VBscript. Link to comment Share on other sites More sharing options...
--ZeeMan-- Posted December 3, 2004 Share Posted December 3, 2004 simple html here.....*cowers into corner* Link to comment Share on other sites More sharing options...
Astrotoy7 Posted December 3, 2004 Share Posted December 3, 2004 this thread should be re-titled.... "how to get hot chicks" mtfbwya Link to comment Share on other sites More sharing options...
Troopr-Undr-Fir Posted December 3, 2004 Share Posted December 3, 2004 Originally posted by Astrotoy7 this thread should be re-titled.... "how to get hot chicks" mtfbwya Damn right!!! Who says you can't get a hot women to love you if know a few programming languages. Not to brag... Aww hell I SHALL BRAG! My girl friend is freakin smokin. Even I can't figure out why she loves me I wish I had a picture of her, but she has a tick thingy to where she is embaressed when people look at her in photos. Maybe a phobia? Though I don't know what it would be called. I guess it's fine because I don't really see the need for pictures myself either. EDIT: heh, forgot the languages: HTML, XHTML, DHTML, JavaScript, C++, and little knowledge of Assembly. Though now I can only remember HTML and some of it's variants by heart. Link to comment Share on other sites More sharing options...
ET Warrior Posted December 3, 2004 Author Share Posted December 3, 2004 I tried to learn HTML, but then I got bored, it was too many tags and overall I was very uninterested in it C++ is where it's at for me, I really enjoy writing programs in C++ Link to comment Share on other sites More sharing options...
Astrotoy7 Posted December 3, 2004 Share Posted December 3, 2004 Originally posted by Troopr-Undr-Fir Not to brag... Aww hell I SHALL BRAG! My girl friend is freakin smokin. Even I can't figure out why she loves me I can ...riddle me this batman. she's waitin for you to get a high payin job in the tech industry....pop out a cpl of kids, then ditch ya, take the house and car, the kids + maintenance and half your superannuation...leaving you butt poor and forcing you to move back to your momz... dont think it hasnt happenned before either that, or youre hung like a donkey (which is how it is in my case ) mtfbwya Link to comment Share on other sites More sharing options...
Samuel Dravis Posted December 3, 2004 Share Posted December 3, 2004 If you're counting SGML based languages, I know HTML, XHTML, and XML. I love XML. It's just cool. DHTML is just a name for HTML with some type of clientside scripting language (VBscript/Javascript/ECMAscript) used to modify the look of the page. Edit: CSS too, heh. Link to comment Share on other sites More sharing options...
Alegis Posted December 4, 2004 Share Posted December 4, 2004 Only HTML, CSS (as if that's much ) and Javascript. I can recognise php but not create it (in other words; edit existing code but not yet create new one, never learned php) Link to comment Share on other sites More sharing options...
jon_hill987 Posted December 4, 2004 Share Posted December 4, 2004 I've learnt some C and some assembly. Link to comment Share on other sites More sharing options...
Rogue Nine Posted December 4, 2004 Share Posted December 4, 2004 Anybody who knows Java wanna write my last proggie for me? Cuz I really don't want to. Link to comment Share on other sites More sharing options...
Troopr-Undr-Fir Posted December 4, 2004 Share Posted December 4, 2004 Originally posted by Astrotoy7 I can ...riddle me this batman. she's waitin for you to get a high payin job in the tech industry....pop out a cpl of kids, then ditch ya, take the house and car, the kids + maintenance and half your superannuation...leaving you butt poor and forcing you to move back to your momz... dont think it hasnt happenned before either that, or youre hung like a donkey (which is how it is in my case ) mtfbwya Heh, yeah I know that happens sometimes. But I don't want a Tech Carrier. I want to be a fireman, shes knows this. It's amazing to think she stays with me even though I wouldn't see her 3 quarters of the week if I take that path. Though, I am only 22 and still in college. I still only see her half of the time. Who knows... But yeah, I am part donkey Edit: Anybody who knows Java wanna write my last proggie for me? Cuz I really don't want to. if only you were that lucky Link to comment Share on other sites More sharing options...
ET Warrior Posted December 4, 2004 Author Share Posted December 4, 2004 Originally posted by Rogue Nine Anybody who knows Java wanna write my last proggie for me? Cuz I really don't want to. I suppose that depends on if you want to pay me. And teach me Java first. What is the program though? Link to comment Share on other sites More sharing options...
narfblat Posted December 4, 2004 Share Posted December 4, 2004 I took C++ in high school. I made a tic-tac-toe game, with the computer as the O's. Nobody could beat it. Link to comment Share on other sites More sharing options...
ET Warrior Posted December 4, 2004 Author Share Posted December 4, 2004 I knew a guy last year who programmed a 3 dimensional 4x4 grid of a tic tac toe game. His original AI for the computer was beatable, but then he changed it's priorities and let it plan ahead a few more moves and it became unbeatable. Link to comment Share on other sites More sharing options...
Rogue Nine Posted December 4, 2004 Share Posted December 4, 2004 Here, ET. Teh blah. Link to comment Share on other sites More sharing options...
ET Warrior Posted December 4, 2004 Author Share Posted December 4, 2004 I don't understand the parameters of the assignment...I see you have yourself a nice database of movies and their rankings and whatnot....but what are you supposed to do? And how is the database arranged? Is it a linked list of objects that hold the information on the movie? Link to comment Share on other sites More sharing options...
Rogue Nine Posted December 4, 2004 Share Posted December 4, 2004 Remove the Lab7.doc extension, that should take you to the main page with the file for it. Link to comment Share on other sites More sharing options...
ET Warrior Posted December 4, 2004 Author Share Posted December 4, 2004 So you get to design the class that holds the information on all the movies, you will want to fill your classes with the information that you read in from that file, and then you want to implement the functionality where you can look at the specifics of a particular ranked movie, look at all the movies, and look at the top 3 grossing movies? Extra credit if you figure that last part out? Link to comment Share on other sites More sharing options...
Rogue Nine Posted December 4, 2004 Share Posted December 4, 2004 Basically, yeah. Link to comment Share on other sites More sharing options...
ET Warrior Posted December 4, 2004 Author Share Posted December 4, 2004 Well that doesn't sound too hard you pansy I can't believe you're getting extra credit for that last part...it seems so simple... I'd make three arrays of size 2. First slot of the array can hold the rank of the movie, second slot holds what it's gross is. (assuming you write your class with the design that you can return that as a value, which would be a simple function to add) Then step through the database one at a time. every value's gross check against the current top ranked gross. If it's greater, you move whatever you have in second place (second row in the array) down into the third place(third row) and then move what was in 1st into second, and move your new value into 1st. If it was less than the 1st place you test it against the 2nd place. If greater then you move what was in 2nd into third and new one into 2nd. Then if less than what was in 2nd you test it against what was in 3rd, and if it's greater you replace it, if not you move on to the next value in the database. Seems pretty simple to me <.< >.> Does that constitute cheating on your homework if you read that? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.