Universidad de Costa Rica

Escuela de Ciencias de la Computación e Informática

CI-0118 Lenguajes ensambladores

Ejemplos

CI0118 / ejemplos / Semana-07 / Vector / nasm


/**
 * CI-0118
 * Grupo 2 (Fco. Arroyo), 2022-ii
 *
 *  Ejemplo de una clase con interacción de métodos en ensamblador
 *  (ver la implantación Vector.cc)
 *
**/

#ifndef __VECTOR_H__
#define __VECTOR_H__

 class Vector {
   public:
      Vector( int = 10 );		// Create the vector, malloc
      Vector( int, long  );		// Create the vector, malloc
      ~Vector();			// Destroy the vector, free
      void allSet( long );		// Set the entire vector to specific value
      void set( int, long );		// Set a position with specific value
      long get( int );			// Get a specific position
      void print();			// Print the vector to stdout

   private:
      int size;			// vector size
      long * vector;		// vector address
 };
#endif