2 Replies - 279 Views - Last Post: 21 May 2013 - 06:48 PM Rate Topic: -----

#1 pabdylos  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 21-May 13

Linux HLA project help

Posted 21 May 2013 - 09:50 AM

Need to do for school something that involves: "Your final project must include at least two components from our study, which are CPU (ALU), memory (memory address, stack), and interface (input/output). Control part (Flag register application)is the optional choice."

Any ideas or cool scripts in C/C++ or Linux HLA? Thanks for any help! :)

Is This A Good Question/Topic? 0
  • +

Replies To: Linux HLA project help

#2 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 870
  • View blog
  • Posts: 2,310
  • Joined: 28-March 11

Re: Linux HLA project help

Posted 21 May 2013 - 10:48 AM

what is Linux HLA? high level assembly by mr. hyde?

we don't just give code, it does you no good, write some code and we will help you..
Was This Post Helpful? 0
  • +
  • -

#3 pabdylos  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 21-May 13

Re: Linux HLA project help

Posted 21 May 2013 - 06:48 PM

View PostGunnerInc, on 21 May 2013 - 10:48 AM, said:

what is Linux HLA? high level assembly by mr. hyde?

we don't just give code, it does you no good, write some code and we will help you..


Yeah that pretty much sounds like that is it. For most of the class we have been writing programs to be compiled with the HLA compiler on Ubuntu Linux. "hla name.hla name" H L A

I have got this program to work on my windows machine:

 
#define ESC (129)
#include <stdio.h>
#include <conio.h>
#include <dos.h>
int main( void )
{
void ClrKeyBrdBuffer( );
float notes[7][12] =
{	{
{ 130.81, 138.59, 146.83, 155.56, 164.81, 174.61, 185.0, 196.0, 207.65, 220.0, 227.31, 246.96 },
{ 261.63, 277.18, 293.66, 311.13, 329.63, 349.23, 369.63, 392.0, 415.3, 440.0, 454.62, 493.92 },
{ 523.25, 554.37, 587.33, 622.25, 659.26, 698.46, 739.99, 783.99, 830.61, 880.0, 909.24, 987.84 },
{ 1046.5, 1108.73, 1174.66, 1244.51, 1328.51, 1396.91, 1479.98, 1567.98, 1661.22, 1760.0, 1818.48, 1975.68 },
{ 2093.0, 2217.46, 2349.32, 2489.02, 2637.02, 2793.83, 2959.96, 3135.96, 3322.44, 3520.0, 3636.96, 3951.36 },
{ 4186.0, 4434.92, 4698.64, 4978.04, 5274.04, 5587.86, 5919.92, 6271.92, 6644.88, 7040.0, 7273.92, 7902.72 },
{ 8372.0, 8869.89, 9397.28,9956.08,10548.08,11175.32, 11839.84, 12543.84, 13289.76, 14080.0, 14547.84, 15805.44 }
};
int n, i, p, q, octave = 2,
note[ ] = { 1, 3, 99, 6, 8, 10, 99, 13, 15, 99, 18, 0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17 };
/* keys[]="A W S E D F T G Y H U J K O L P;']" <- for note[] */
clrscr( );
printf( "Piano for A to Z of C \n\n"
"Note-> C Df D Ef E F Fs G Af A Bf B C Df D Ef E F Fs \n"
"Keys-> a w s e d f t g y h u j k o l p ; ' ] \n\n"
"Octave-> 1 2 3 4 5 6 7 8 \n\n"
"Quit-> ESC \n" );
while( (n=inportb(0x60)) != ESC )
{
ClrKeyBrdBuffer( );
p = 2;	/*dummy*/
if ( N>=2&&n<=8 )
octave = n-2;
else
switch( n )
{
case 79:
case 80:
case 81: octave = n-79;
break;
case 71: octave = 6;
}
if ( n>=17&&n<=27 )
p = n-17;
else if ( n>=30&&n<=40 )
p = n-19;
p = note[p];
if ( p>=0&&p<=21 )
sound( (int)notes[octave] [p] );
if ( n>136 )
nosound( );
}
printf( "Quiting..." );
getch( );
return(0);
} /*--main( )----------*/
void ClrKeyBrdBuffer(void)
{
outportb( 0x20, 0x20 ); /* reset PIC */
while( bioskey(1) ) /* read all chars until it empty */
bioskey( 0 );
} /*--ClrKeyBrd( )-----*/



Piano sounds using input keyboard keys and assigned frequency to each. Want to modify it to work on a linux machine and/or incorporate some storage for memory registers to fully cope with the assignment.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1