Question: dev T rk e: Her sat r 1 6 bit olan bir hafizada 1 0 0 0 - 1 9 9 9 adresleri aras nda

dev
Trke:
Her satr16 bit olan bir hafizada 1000-1999 adresleri arasnda yer alan 1000 adet srasz tamsay dizisini eklemeli sralama (insertion sort) algoritmasyla yerinde sralayan bir program aadaki komut kmesini kullanarak yaznz.
Komut kmesi:
ADD: topla
LDA: register'a ykle
JZ: sfr ise atla
SUB: kar
STA: hafzaya aktar
JP: pozitif ise atla
MUL: arp
PSH: stack'e push
JN: negatif ise atla
DIV: bl
POP: stack'ten pop
JMP: artsz atla
MOV: hafzada bir adresten dierine kopyala (MOV K, L //L'deki deeri M'ye kopyalar.)
Not: Aritmetik ilemlerde iki operand bulunmaktadr.rnein: (ADD X,Y ; SUB X,Y; DIV X,Y; MUL X,Y)
Bu komut kmesi dnda baka komut kmesi kullanamazsnz!
Ben, adresler ile adreslerin iinde tuttuklar deerleri nasl kyaslayacam?
rnein:
1000 adresinde 23 olsun
1001 adresinde 1 olsun
1002 adresinde 10 olsun
1003 adresinde 5 olsun
1004 adresinde 2 olsun
bir yandan 1000 deerinin 1000-1999 arasnda olduunu nasl kontrol edeceim ve
bir yandan 23,1,10,5,2,... arasnda nasl insertion sort uygulayacam
english:
Write a program that sorts 1000 unordered integer arrays between 1000-1999 in a 16-bit memory using the insertion sort algorithm using the following instruction set.
Command set
ADD: with the ball
LDA: load to register
JZ: skip if zero
SUB: remove
STA: commit to memory
JP: skip if positive
MUL: multiply
PSH: push to stack
JN: skip if negative
DIV: divide
POP: pop from stack
JMP: skip unconditional
MOV: copy from one address to another in memory (MOV K, L copies the value in //L to M).
Note: Arithmetic operations have two operands. (for example: (ADD X,Y ; SUB X,Y; DIV X,Y; MUL X,Y))
You cannot use any other command set except this command set!
How do I compare addresses and the values they hold?
For example
Get 23 at 1000
Get 1 at 1001
Get 10 at 1002
Get 5 at 1003
Get 2 at 1004
on the one hand, how do I check that the value of 1000 is between 1000-1999 and
on the one hand, how do I apply insertion sort between 23,1,10,5,2,...
dev T rk e: Her sat r 1 6 bit olan bir hafizada 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!