OSK Project

Standard

After I emailed the answer (OSK Project) about 5 a.m in the morning with Amir , I get this email around 10 a.m by my OSK (Organisasi Senibina dan Struktur Komputer) lecturer Pn Haniza Nahar .

She reply my email and leads to another hyperlink which is in eftmk portal (where all UTeM students taking their notes online as well participate in forum / chat and send assignments).

And wallaweyh !!!!!!!!!!!!

# — Copy from the Portal –#

Projek DITS 1133

Contoh aturcara yang baik

Cadangan / komen:

– Aturcara dibawah masih boleh diperbaiki dengan mengambilkira operasi penolakan nombor kecil kepada nombor besar. Cth: 2-4 = -2. Dimana simbol negatif dipaparkan dan nilai 2 dikeluarkan setelah di toggle semula nilai akhir pengiraan menggunakan kod operasi NEG.

– Aturcara tersebut juga boleh diperkembangkan lagi untuk hasil akhir pengiraan yang melibatkan lebih dari satu digit. Cth: 3 x 6 = 18. Dimana melibatkan 2 lokasi paparan 7 segmen.

SOURCE CODE

; This is the first program to run on IDE68K

; Author: Hassan Abu Bakar(Team Leader)

; Arif Affendi Che Hamid (Team Members)

; Noraqma Hidayah Ab Rahman (Team Members)

; Khairunnisa Kamaruddin (Team Members)

org $4000 ; start of program (>= $4000)

lea text1,A0 ; get address of text string in A0

trap #15

dc.w 7 ; call system function 7 (print string)

lea text2,A0 ; get address of text string in A0

trap #15

dc.w 7 ; call system function 7 (print string)

trap #15

dc.w 6 ; get decimal value from I/O window

move D0,D1

lea text3,A0 ; get address of text string in A0

trap #15

dc.w 7 ; call system function 7 (print string)

trap #15

dc.w 6 ; get decimal value from I/O window

move D0,D2

move D2,D3 ; copy value in D2 to D3

move D2,D4 ; copy value in D2 to D4

move D2,D5 ; copy value in D2 to D5

add D1,D3 ; add value in D1 and D3

sub D1,D4 ; sub value in D1 and D4

muls D1,D5 ; multiple value in D1 and D5

MOVE.L #$3F065B4F,$5000 ; move values 0-3 into memory location start with location 5000

MOVE.L #$666D7D07,$5004 ; move values 4-7 into memory location start with location 5004

MOVE.W #$7F6F,$5008 ; move values 8&9 into memory location start with location 5008

MOVE #$5001,A0 ; store value 5001 in A0

label MOVE.B (A0)+,D6

sub #$1,D3

BNE label

MOVE.B D6,$E017

lea text4,A0 ; get address of text string in A0

trap #15

dc.w 7 ; call system function 7 (print string)

MOVE #$5001,A0

label2 MOVE.B (A0)+,D6

sub #$1,D4

BNE label2

MOVE.B D6,$E017

lea text5,A0 ; get address of text string in A0

trap #15

dc.w 7 ; call system function 7 (print string)

MOVE #$5001,A0

label3 MOVE.B (A0)+,D6

sub #$1,D5

BNE label3

MOVE.B D6,$E017

lea text6,A0 ; get address of text string in A0

trap #15

dc.w 7 ; call system function 7 (print string)

; string to print, string ends with NULL

text1 dc.b ‘Please input two numbers :’,$0A,$0D,0

text2 dc.b ‘Input 1 :’,$0A,$0D,0

text3 dc.b ‘Input 2 :’,$0A,$0D,0

text4 dc.b ‘Hasil tambah 2 nilai adalah:’,$0A,$0D,0

text5 dc.b ‘Hasil tolak 2 nilai adalah:’,$0A,$0D,0

text6 dc.b ‘Hasil darab 2 nilai adalah:’,$0A,$0D,0

TAHNIAH.. cubaan aturacara yang baik!!!

Pn Haniza

# — End Copy –#

Wahaha .. bangga SIOT ..

4 thoughts on “OSK Project

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge

This site uses Akismet to reduce spam. Learn how your comment data is processed.