Ohtar Game God
Posts : 109 Join date : 2007-08-31 Age : 34 Location : Sweden
| Subject: calculator in assebmler Fri Oct 12, 2007 11:21 am | |
| If you ever wanna program an calculator in assembler.. here it is. P4 EQU 0E8h Org 8250 Begin: ;mov P4,#0 mov R3, #0 borja: mov DPTR, #8500 CLR P1.4 ACALL kolla SETB P1.4 CLR P1.5 ACALL kolla SETB P1.5 CLR P1.6 ACALL kolla SETB P1.6 AJMP borja kolla: JNB P1.0, Vardet JNB P1.1, Vardet JNB P1.2, Vardet JNB P1.3, Vardet RET Vardet: mov A,P1 CPL A movc A,@A+DPTR mov R2,A CJNE A, #0FFh, inte1 ACALL plus inte1: CJNE A, #0FEh, inte2 ACALL minus inte2: mov P4,A RET plus: mov R2,P4 mov A,R3 JNZ taltvÄ mov R3, R2 test1: JNB P1.0, test1 JNB P1.1, test1 JNB P1.2, test1 JNB P1.3, test1 AJMP borja taltvÄ: mov R4,R2 mov A, R4 Add A,R3 DA A mov P4,A test2: JNB P1.0, test2 JNB P1.1, test2 JNB P1.2, test2 JNB P1.3, test2 AJMP Begin minus: mov R2,P4 mov A,R3 JNZ talett mov R3,R2 test3: JNB P1.0, test3 JNB P1.1, test3 JNB P1.2, test3 JNB P1.3, test3 AJMP borja talett: mov R4,R2 mov A,R3 CLR C SUBB A,R4 DA A mov P4,A test4: JNB P1.0, test4 JNB P1.1, test4 JNB P1.2, test4 JNB P1.3, test4 AJMP Begin Org 8517 DB 1 Org 8518 DB 4 Org 8520 DB 7 Org 8524 DB 0FFh Org 8533 DB 2 Org 8534 DB 5 Org 8536 DB 8 Org 8540 DB 0 Org 8565 DB 3 Org 8566 DB 6 Org 8568 DB 9 Org 8572 DB 0FEh ds 15,5 End Begin | |
|
Nucturnal Wannabee Pro
Posts : 23 Join date : 2007-08-31 Age : 35 Location : Sweden!
| Subject: Re: calculator in assebmler Fri Oct 12, 2007 11:44 am | |
| I feel kinda guilty to this, but hey this is something everyone can enjoy! | |
|
Ellyen Game God
Posts : 118 Join date : 2007-08-29 Age : 29 Location : R0mania
| Subject: Re: calculator in assebmler Fri Oct 12, 2007 8:17 pm | |
| Hmm ... yea ... it's sounds quite simple ... thnx thnx thnx thnx | |
|
Ohtar Game God
Posts : 109 Join date : 2007-08-31 Age : 34 Location : Sweden
| Subject: Re: calculator in assebmler Sat Oct 13, 2007 1:34 am | |
| - Ellyen wrote:
- Hmm ... yea ... it's sounds quite simple ... thnx thnx thnx thnx
Well aslong as you don't forget the # infront of some numbers its ok... if you forget it.. it will take you like hours to find the error:P And you are welcome... use this knowledge wisely | |
|
Wiggletphyre Admin
Posts : 113 Join date : 2007-08-29 Location : The Netherlands
| Subject: Re: calculator in assebmler Sun Oct 21, 2007 9:29 pm | |
| Uhhm you lost me after "If" | |
|
Ohtar Game God
Posts : 109 Join date : 2007-08-31 Age : 34 Location : Sweden
| Subject: Re: calculator in assebmler Sun Oct 21, 2007 9:41 pm | |
| hehehe | |
|
Sponsored content
| Subject: Re: calculator in assebmler | |
| |
|