This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Hello world 16 bit program | |
; https://programmingdrops.com | |
format binary ; flat binary file format | |
use16 ; 16bit file | |
org 0x0100 ; all COM files adresses must be relative to 0x100 memory offset | |
vars: | |
message db 'Hello world!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <locale.h> | |
int main() | |
{ | |
/* use o set locale para aceitar acentos e caracteres espeiciais da língua portuguesa*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <locale.h> | |
#include <stdlib.h> | |
#include "tarefas.h" | |
#include "list.h" | |
int main(void) { | |
//para suporte a acentos e caracteres especiais | |
setlocale(LC_ALL, "pt"); | |
//criamos uma pessoa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** API de Tarefas ***/ | |
Tarefa *tarefa_create(char *descricao, bool pendente) { | |
Tarefa *result = calloc(1, sizeof(Tarefa)); | |
memcpy(result->descicao, descricao, strlen(descricao)); | |
result->pendente = pendente; | |
return result; | |
} | |
/*** API de Telefones ***/ | |
Telefone *telefone(char tipo, char *ddd, char *numero) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct _node { | |
void *data; | |
struct _node *next; | |
} Node; | |
typedef struct { | |
int count; | |
int data_size; | |
Node *head; | |
Node *tail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Nó genérico, veja que o campo data | |
* é um ponteiro sem tipo, ou seja, | |
* pode apontar para qualquer coisa */ | |
typedef struct _node { | |
void *data; | |
struct _node *next; | |
} Node; | |
typedef struct { | |
int count; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct _node { | |
void *data; | |
struct _node *next; | |
} Node; | |
typedef struct { | |
int count; | |
Node *head; | |
} List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct _node_tarefa{ | |
struct _node_tarefa *next; | |
Tarefa data; | |
} NodeTarefa; | |
typedef struct { | |
NodeTarefa *head; | |
} Tarefas; | |
typedef struct _node_telefone{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <time.h> | |
#include <stdbool.h> | |
typedef struct { | |
char descicao[255]; | |
bool pendente; | |
} Tarefa; | |
#define TEL_FIXO 0x00 | |
#define TEL_CELULAR 0x01 | |
typedef struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* declaração de um nó de uma lista de inteiros. */ | |
typedef struct _node { | |
int data; | |
struct _node *next; | |
} Node; | |
/* declaração de um nó para uma lista de string */ | |
typedef struct _node { | |
char *data; | |
struct _node *next; |
NewerOlder