I found these codes on Wikipedia (italian) page about "Assembly" with some description lines:
...Sample program "Hello world" in assembly Intel x86 with Intel syntax (uses calls to the operating system DOS). Is not compatible with versions Assembly UNIX GNU:
MODEL SMALL
STACK 100H
.DATA
HW DB "hello, world", 13, 10, '$'
.CODE
.STARTUP
MOV AX, @data
MOV DS, AX
MOV DX, OFFSET HW
MOV AH, 09H
INT 21H
MOV AX, 4C00H
INT 21H
END
...
...An example of code written in C-asm (using the Intel x86 assembly), which displays a number in binary data received as input, is as follows:
#include <stdio.h>
#include <iostream.h>
#include <conio.h>
int main()
{
int a;
/* Acquisizione del valore numerico */
printf("Inserisci un valore compreso tra -32768 e 32768: ");
scanf("%d", &a);
/* Visualizzazione del messaggio di risposta */
printf("Il valore corrispondente in binario รจ: ");
/* Keyword per delimitare le sezioni di codice Assembly */
asm
{
/* Visualizzazione della stringa di bit corrispondente */
MOV BX,WORD PTR a
MOV CX,00Ah
}
/* Etichetta esterna */
Ciclo:
asm
{
/* Estrazione di un bit */
MOV DL,00H
RCL BX,1 /* Il valore del bit viene posto nel flag di carry */
ADC DL,'0' /* Determino il carattere da visualizzare */
MOV AH,02H /* Visualizzazione */
INT 21h
Loop Ciclo
}
return 0;
}
Which is the compiler or the command for compile these codes? I tried with gcc but I have to modify the syntax.