Skip to content

Instantly share code, notes, and snippets.

View anghene's full-sized avatar
🎯
Focusing

AVA anghene

🎯
Focusing
View GitHub Profile
@anghene
anghene / stackop1.asm
Last active January 2, 2016 11:19
Cititi un numar de la tastatura si salvati pe rand cifrele lui in stiva. Redati apoi numarul cand se apasa tasta enter.
.model small
.stack
.data
nr1 dw ?
nr2 dw ?
nr3 dw ?
.code
main proc
mov cx,0
citire:
@anghene
anghene / gist:7412868
Last active December 28, 2015 00:19
Enuntul problemei: Sa se citeasca de la tastatura o tasta, si in functie de ce tasta e, sa afiseze un mesaj distinct (daca e 0 - sa afiseze ca e 0, daca e 1, idem; dar daca e orice alta tasta sa mai ceara o data introducerea unei taste si sa repete procedura).
.model small
.stack
.data
m0 db 10, "ati apasat 0", "$"
m1 db 10, "ati apasat 1", "$"
mgeneral db 10, "nu ati apasat nici 0 nici 1, mai incercati o data", "$"
.code
main proc
citire:
# include <stdio.h>
# include <math.h>
void grad (float a,float b,char *c,float *d)
{
if ((a==0)&&(b==0)) *c='r';
else if (a==0) *c='v';
else if (b==0) *d=0;
else *d=-b/a;
}
int main ()
#include‬ <cstdlib>
#include <iostream>
using namespace std;
void prim(int n)
{
int i;
i=2;
while(n%i!=0&&i*2<=n) i++;
if (2*i<n) printf(" Numar neprim \n");
else
@anghene
anghene / lab5ex1
Created October 28, 2013 19:15
Citeste si scrie (cu echo) un caracter pe ecran.
.model small
.stack
.data
message db "apasati o tasta: ", "$"
message2 db "ati tastat: ", "$"
.code
main proc
mov ax,seg message
mov ds, ax