# Re: modeling a simple cpu

**URL:** <https://www.ruby-forum.com/t/re-modeling-a-simple-cpu/73764>\
**Category:** Ruby\
**Created:** [October 26, 2006, 10:28pm UTC](https://www.ruby-forum.com/t/re-modeling-a-simple-cpu/73764 "2006-10-26T22:28:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 26, 2006, 10:28pm UTC](https://www.ruby-forum.com/t/re-modeling-a-simple-cpu/73764/1 "2006-10-26T22:28:48Z")

</div>

From: Ara.T.Howard [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]

> i need to model the on board cpu of a satellite in order to  
> mock running uploaded commands. basically i need to model  
> the internal state and all incoming commands so i can  
> determine register states at a given point in time.

Not to distract the thread from your very real question, but you do  
realize that you have one of the coolest jobs around, right? 🙂

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 26, 2006, 10:34pm UTC](https://www.ruby-forum.com/t/re-modeling-a-simple-cpu/73764/2 "2006-10-26T22:34:49Z")

</div>

On 10/26/06, Gavin K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> From: Ara.T.Howard [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]
> 
> > i need to model the on board cpu of a satellite in order to  
> > mock running uploaded commands. basically i need to model  
> > the internal state and all incoming commands so i can  
> > determine register states at a given point in time.
> 
> Not to distract the thread from your very real question, but you do  
> realize that you have one of the coolest jobs around, right? 🙂

Right, why should we help him hey?  
Seriously Ara wasn’t there a Ruby Q. about it  
[http://rubyquiz.com/quiz88.html](http://rubyquiz.com/quiz88.html)  
(the only one I replied to BTW)?

HTH  
Robert

–  
The reasonable man adapts himself to the world; the unreasonable one  
persists in trying to adapt the world to himself. Therefore all progress  
depends on the unreasonable man.

- George Bernard Shaw

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 26, 2006, 10:36pm UTC](https://www.ruby-forum.com/t/re-modeling-a-simple-cpu/73764/3 "2006-10-26T22:36:49Z")

</div>

On Oct 26, 2006, at 3:28 PM, Gavin K. wrote:

> From: Ara.T.Howard [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]
> 
> > i need to model the on board cpu of a satellite in order to  
> > mock running uploaded commands. basically i need to model  
> > the internal state and all incoming commands so i can  
> > determine register states at a given point in time.
> 
> Not to distract the thread from your very real question, but you do  
> realize that you have one of the coolest jobs around, right? 🙂

I agree. 😉

James Edward G. II

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 26, 2006, 10:50pm UTC](https://www.ruby-forum.com/t/re-modeling-a-simple-cpu/73764/4 "2006-10-26T22:50:51Z")

</div>

Gavin K. wrote:

> From: Ara.T.Howard [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]
> 
> > i need to model the on board cpu of a satellite in order to  
> > mock running uploaded commands. basically i need to model  
> > the internal state and all incoming commands so i can  
> > determine register states at a given point in time.
> 
> Not to distract the thread from your very real question, but you do  
> realize that you have one of the coolest jobs around, right? 🙂

The last processor I successfully modeled was the old 6502 (Apple II),  
since  
then processor behavior has become too difficult to sort out in any  
reliable way (IMHO).

It would be interesting for the OP to reveal what kind of processor is  
involved, and how complex. I am going to assume it doesn’t support  
interrupts or threads, otherwise there is little chance to mimic its  
behavior.

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 27, 2006, 12:35am UTC](https://www.ruby-forum.com/t/re-modeling-a-simple-cpu/73764/5 "2006-10-27T00:35:06Z")

</div>

On Fri, 27 Oct 2006, Paul L. wrote:

> The last processor I successfully modeled was the old 6502 (Apple II), since  
> then processor behavior has become too difficult to sort out in any  
> reliable way (IMHO).
> 
> It would be interesting for the OP to reveal what kind of processor is  
> involved, and how complex. I am going to assume it doesn’t support  
> interrupts or threads, otherwise there is little chance to mimic its  
> behavior.

it’s for these guys

[http://heasarc.nasa.gov/docs/heasarc/missions/dmsp.html](http://heasarc.nasa.gov/docs/heasarc/missions/dmsp.html)  
[http://www.ngdc.noaa.gov/dmsp/](http://www.ngdc.noaa.gov/dmsp/)

at this point i only need to model a limited subset of the processor (i  
don’t  
know the type yet). basically i’ll be executing something long these  
lines

```
 !=================================================================
 ! *****GAIN ORBIT MEMORY FOR OPS45 26 JAN 04 - 01 FEB 04*****
 !=================================================================
 !
  0.000 CMD OAXSPG 0x00 ; 807E# (PAGE=0)
  0.000 CMD OGNASG LIN ; 0010# ASGC LIN
 !
  0.076 CMD OAXLOD 0xA2 ; 511E# (112dB) (SED)
  0.076 CMD OAXSTR 0x44 ; A22E# (BC MAX)
 !
  0.316 CMD OAXLOD 0x03 ; 819E# (.08) (VED-1/00)
  0.316 CMD OAXSTR 0x48 ; A42E# (BRDF X2)
 !
  0.324 CMD OAXLOD 0x06 ; 831E# (.25) (VED-00/12)
  0.324 CMD OAXSTR 0x46 ; 232E# (BRDF HRD)
  0.324 CMD OAXLOD 0x9E ; 4F1E# (136dB)
  0.324 CMD OAXSTR 0x44 ; A22E# (BC MAX)
 !
  0.326 CMD OAXLOD 0x8E ; C71E# (118dB) (VES)
  0.326 CMD OAXSTR 0x44 ; A22E# (BC MAX)
 !
  0.650 CMD OAXLOD 0x29 ; 149E# (.02)
  0.650 CMD OAXSTR 0x48 ; A42E# (BRDF X2)

 ....
 ....
 ....

```

as you can tell these are load/store/add instuctions. there are no  
parameters, all the values are burned on board before flight - so there  
are  
only certain values you can do ops with. as you can tell it’s ultra  
simple -  
basically i’ll just have to model rom, ram, registes, and ops.

hey - a smell a ruby quiz! 😉

-a

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 27, 2006, 12:27am UTC](https://www.ruby-forum.com/t/re-modeling-a-simple-cpu/73764/6 "2006-10-27T00:27:05Z")

</div>

On Fri, 27 Oct 2006, Robert D. wrote:

> Right, why should we help him hey?  
> Seriously Ara wasn’t there a Ruby Q. about it  
> [Ruby Quiz - Chip-8 (#88)](http://rubyquiz.com/quiz88.html)  
> (the only one I replied to BTW)?
> 
> HTH  
> Robert

great resource! thanks!

-a

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 27, 2006, 1:01am UTC](https://www.ruby-forum.com/t/re-modeling-a-simple-cpu/73764/7 "2006-10-27T01:01:10Z")

</div>

removed\_email\_address@domain.invalid wrote:

> > > Not to distract the thread from your very real question, but you do  
> > > behavior.
> 
> ```
> !
> !
> 
> ```
> 
> simple -  
> basically i’ll just have to model rom, ram, registes, and ops.
> 
> hey - a smell a ruby quiz! 😉
> 
> -a

Isn’t there an open-source “universal old architecture emulator” package  
of some kind? I remember seeing it in Debian when I was running Debian  
– it could play most of the old Atari games, etc.

I can certainly see if it’s in Gentoo, if I can figure out what it was  
called.

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 27, 2006, 1:25am UTC](https://www.ruby-forum.com/t/re-modeling-a-simple-cpu/73764/8 "2006-10-27T01:25:12Z")

</div>

M. Edward (Ed) Borasky wrote:

> Isn’t there an open-source “universal old architecture emulator” package  
> of some kind? I remember seeing it in Debian when I was running Debian  
> – it could play most of the old Atari games, etc.
> 
> I can certainly see if it’s in Gentoo, if I can figure out what it was  
> called.

I think I found it … simh

[http://simh.trailing-edge.com/](http://simh.trailing-edge.com/)

Of course, I’m probably the only one on this list that’s actually  
_touched_ some of those gizmos 🙂

Sheesh – a computer museum on your hard drive 🙂
