visiable virtual machine VVM

Katılım
13 Kasım 2006
Mesajlar
6
Excel Vers. ve Dili
Microsoft Excell XP(2002)_Tr
Arkadaşlar merhaba;

Biliyorum ki burasi bir excel forumu ancak burada yazilim konusunda o kadar değerli arkadaşlari tanidim ki yardimci olabileceginizi dusundugum icin derdimi paylasiyorum.VVM yani visiable virtual machine komutlariyla yazilmis ufak iki odev sorusunun cevabina ihtiyacim var;

1.
Bir A dizisi A = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} olarak verildiğine göre;
Bu diziyi asağıdaki diziye dönüstüren programı VVM komutlarını kullanarak yazınız.
A = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0}
Dizinin baslangıç adresi 40 olsun. Aktarma için yalnız bir bellek adresi kullanılabilir.

2.
X = 40.5 ve Y = -20 olduğuna göre
a. Bu sayıların 32 bitlik IEEE kayan nokta formatındaki karsılıklarını bulunuz.
b. Kayan noktalı sayıları kullanarak X + Y yi ve X / Y yi aynı formatta bulunuz.
c. Bulduğunuz bu sayıların ondalık karsılıklarını bulunuz.

Bu iki sorunun cevaplari konusunda yardimci olabilecek arkadaslar varsa cok sevinecegim.Simdiden tesekkurler,iyi calismalar


=============================================================
VVM komut seti
(nn indicates an address location in the RAM), for example;
machine code 510 corresponds to Assembly code LDA 10 (or lda 10).
Load Accumulator (5nn) [LDA nn] The content of RAM address nn is copied to the Accumulator Register, replacing the
current content of the register. The content of RAM address nn remains unchanged. The Program Counter Register is
incremented by one.
Store Accumulator (3nn) [STO nn] or [STA nn] The content of the Accumulator Register is copied to RAM address nn,
replacing the current content of the address. The content of the Accumulator Register remains unchanged. The Program Counter
Register is incremented by one.
Add (1nn) [ADD nn] The content of RAM address nn is added to the content of the Accumulator Register, replacing the current
content of the register. The content of RAM address nn remains unchanged. The Program Counter Register is incremented by
one.
Subtract (2nn) [SUB nn] The content of RAM address nn is subtracted from the content of the Accumulator Register, replacing
the current content of the register. The content of RAM address nn remains unchanged. The Program Counter Register is
incremented by one.
Input (901) [IN] or [INP] A value input by the user is stored in the Accumulator Register, replacing the current content of the
register. Note that the two-digit operand does not represent an address in this instruction, but rather specifies the particulars of the
I/O operation (see Output). The operand value can be omitted in the Assembly Language format. The Program Counter Register
is incremented by one with this instruction.
Output (902) [OUT] or [PRN] The content of the Accumulator Register is output to the user. The current content of the register
remains unchanged. Note that the two-digit operand does not represent an address in this instruction, but rather specifies the
particulars of the I/O operation (see Input). The operand value can be omitted in the Assembly Language format. The Program
Counter Register is incremented by one with this instruction.
Branch if Zero (7nn) [BRZ nn] This is a conditional branch instruction. If the value in the Accumulator Register is zero, then
the current value of the Program Counter Register is replaced by the operand value nn (the result is that the next instruction to be
executed will be taken from address nn rather than from the next sequential address). Otherwise (Accumulator >< 0), the
Program Counter Register is incremented by one (thus the next instruction to be executed will be taken from the next sequential
address).
Branch if Positive or Zero (8nn) [BRP nn] This is a conditional branch instruction. If the value in the Accumulator Register is
nonnegative (i.e., >= 0), then the current value of the Program Counter Register is replaced by the operand value nn (the result is
that the next instruction to be executed will be taken from address nn rather than from the next sequential address). Otherwise
(Accumulator < 0), the Program Counter Register is incremented by one (thus the next instruction to be executed will be taken
from the next sequential address).
Branch (6nn) [BR nn] or[BRU nn] or [JMP nn] This is an unconditional branch instruction. The current value of the Program
Counter Register is replaced by the operand value nn. The result is that the next instruction to be executed will be taken from
address nn rather than from the next sequential address. The value of the Program Counter Register is not incremented with this
instruction.
No Operation (4nn) [NOP] or [NUL] This instruction does nothing other than increment the Program Counter Register by one.
The operand value nn is ignored in this instruction and can be omitted in the Assembly Language format. (This instruction is
unique to the VVM and is not part of the Little Man Model.)
Halt (0nn) [HLT] or [COB] Program execution is terminated. The operand value nn is ignored in this instruction and can be
omitted in the Assembly Language format.
Embedding Data in Programs
Data values used by a program can be loaded into memory along with the program. In Machine or Assembly Language form
simply use the format "snnn" where s is an optional sign, and nnn is the three-digit data value. In Assembly Language, you can
specify "DAT snnn" for clarity.
 
Üst