source
Član broj: 15013 Poruke: 13 *.cmu.carnet.hr.
|
Evo rijesio sam problem, jest da je takav nacin vrlo spor i nepraktican, ali sta je tu je... stvar radi.. pa eto :)
BUFF DS.L 2
m1 DS.B 2
m2 DS.B 2
m3 DS.B 2
m4 DS.B 2
m5 DS.B 2
m6 DS.B 2
m7 DS.B 2
m8 DS.B 2
m9 DS.B 2
m10 DS.B 2
m11 DS.B 2
m12 DS.B 2
m13 DS.B 2
m14 DS.B 2
m15 DS.B 2
m16 DS.B 2
m17 DS.B 2
m18 DS.B 2
m19 DS.B 2
m20 DS.B 2
START
MOVE.L #$00000000,D2 *viseznacni
MOVE.L #$00000000,D3 *manjeznacni
MOVEM.L D2-D3,BUFF
MOVE #0,D1
MOVE D1,m1
MOVE D1,m2
MOVE D1,m3
MOVE D1,m4
MOVE D1,m5
MOVE D1,m6
MOVE D1,m7
MOVE D1,m8
MOVE D1,m9
MOVE D1,m10
MOVE D1,m11
MOVE D1,m12
MOVE D1,m13
MOVE D1,m14
MOVE D1,m15
MOVE D1,m16
MOVE D1,m17
MOVE D1,m18
MOVE D1,m19
MOVE D1,m20
MOVE #13,D0
LEA UN,A1
TRAP #15
*unos 1 broja
MOVE.B #4,D0
TRAP #15
ADD.L D1,D3
ADDX.L D4,D2
*unos 2 broja
MOVE.B #4,D0
TRAP #15
ADD.L D1,D3
ADDX.L D4,D2
*unos 3 broja
MOVE.B #4,D0
TRAP #15
ADD.L D1,D3
ADDX.L D4,D2
*unos 4 broja
MOVE.B #4,D0
TRAP #15
ADD.L D1,D3
ADDX.L D4,D2
*zbrajanje je gotovo
MOVEM.L D2-D3,BUFF
*PRETVARANJE brojeva u Znakove
POC
SUB #1,D3
ADD #1,m1
MOVE m1,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m1
ADD #1,m2
ENDI
MOVE m2,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m2
ADD #1,m3
ENDI
MOVE m3,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m3
ADD #1,m4
ENDI
MOVE m4,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m4
ADD #1,m5
ENDI
MOVE m5,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m5
ADD #1,m6
ENDI
MOVE m6,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m6
ADD #1,m7
ENDI
MOVE m7,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m7
ADD #1,m8
ENDI
MOVE m8,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m8
ADD #1,m9
ENDI
MOVE m9,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m9
ADD #1,m10
ENDI
MOVE m10,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m10
ADD #1,m11
ENDI
MOVE m11,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m11
ADD #1,m12
ENDI
MOVE m12,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m12
ADD #1,m13
ENDI
MOVE m13,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m13
ADD #1,m14
ENDI
MOVE m14,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m14
ADD #1,m15
ENDI
MOVE m15,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m15
ADD #1,m16
ENDI
MOVE m16,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m16
ADD #1,m17
ENDI
MOVE m17,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m17
ADD #1,m18
ENDI
MOVE m18,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m18
ADD #1,m19
ENDI
MOVE m19,D4
IF.L D4 <EQ> #10 THEN.S
MOVE #0,m19
ADD #1,m20
ENDI
IF.L D3 <EQ> #$00000000 THEN.S
IF.L D2 <NE> #$0 THEN.S
SUB #1,D2
MOVE.L #$FFFFFFFF,D3
JMP POC
ENDI
JMP ISPIS
ENDI
IF.L D3 <NE> #$00000000 THEN.S
JMP POC
ENDI
ISPIS
MOVE #13,D0
LEA ZB,A1
TRAP #15
MOVE m20,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m19,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m18,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m17,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m16,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m15,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m14,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m13,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m12,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m11,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m10,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m9,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m8,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m7,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m6,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m5,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m4,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m3,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m2,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
MOVE m1,D1
MOVE #15,D0
MOVE #10,D2
TRAP #15
ZB DC.B 'Zbroj u 64bit tocnosti :',0
UN DC.B 'Unesite 4 broja:',0
END
MOVE.B #9,D0
TRAP #15 Halt Simulator
STOP #$2000
END START
*~Font name~Courier New~
*~Font size~10~
*~Tab type~1~
*~Tab size~8~
|