•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Assembly section within the Software Development category of DaniWeb, a massive community of 363,829 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,125 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Assembly advertiser:
Views: 299 | Replies: 1
![]() |
•
•
Join Date: May 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hello
If I add two numbers say, 5 and 5 to equal 10 .
I can see from the screen dump that d0 contains A
How do I go about converting A so as to display the number 10 on the screen? I guess I have to convert to ascii value, but dont know how to do this
If I add two numbers say, 5 and 5 to equal 10 .
I can see from the screen dump that d0 contains A
How do I go about converting A so as to display the number 10 on the screen? I guess I have to convert to ascii value, but dont know how to do this
start org $1000 move.l #$7ffe,sp ;init stack pointer sub.l #4,sp ;stack space fr answer move.w #5,-(sp) ;push parameter 1 move.w #5,-(sp) ;push parameter 2 bsr addit ;go to addit add.l #4,sp ;remove parameters move.l (sp)+,ans ;pop result into ans move.l ans,d0 ; move.l #248,d7 ;to display trap #14 ; move.b #228,d7 ;ready to exit trap #14 ;done addit move.w 4(sp),d0 ;get parameter 2 move.w 6(sp),d1 ;get parameter 1 add d0,d1 ;add move.l d1,8(sp) ;result on the stack rts ;return to caller ans ds.l 1 ;space for answer end
Last edited by Narue : May 11th, 2008 at 8:58 am. Reason: Added code tags
> I can see from the screen dump that d0 contains A
And that is the same as 10 decimal.
Perhaps read the documentation to find out what other services those trap #14's offer.
If there is nothing, then you'll have to convert the number to a printable string yourself.
And that is the same as 10 decimal.
Perhaps read the documentation to find out what other services those trap #14's offer.
If there is nothing, then you'll have to convert the number to a printable string yourself.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Assembly Marketplace
Other Threads in the Assembly Forum
- Previous Thread: Questions
- Next Thread: Can you help me to write this program?



Linear Mode