Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

TCC 0.9.26 (Win32) (Announce)

posted by RayeR Homepage, CZ, 28.06.2013, 00:14

Here's my simple test:

#include <stdio.h>

#define get_gdt(gdtr) asm __volatile__ ("sgdt %0" : "=m" (*gdtr) : : "memory") // precte obsah GDTR registru [mem48]

typedef struct {                       // 48-bit adresa GDT/IDT
  short unsigned int limit;            // size limit of GDT [Bytes-1]
  unsigned long base;                  // linear base address of the GDT in physical memory
} __attribute__((packed)) GDTR;

int main(void)
{
  GDTR gdtr;
  printf("\nSimple Compiler Test, GCC version: %s\n", __VERSION__);
  printf("size of char:        %u Bytes\n", (int)sizeof(char));
  printf("size of short int:   %u Bytes\n", (int)sizeof(short int));
  printf("size of int:         %u Bytes\n", (int)sizeof(int));
  printf("size of long:        %u Bytes\n", (int)sizeof(long));
  printf("size of long long:   %u Bytes\n", (int)sizeof(long long));
  printf("size of size_t:      %u Bytes\n", (int)sizeof(size_t));
  printf("size of void *:      %u Bytes\n", (int)sizeof(void *));
  printf("size of float:       %u Bytes\n", (int)sizeof(float));
  printf("size of double:      %u Bytes\n", (int)sizeof(double));
  printf("size of long double: %u Bytes\n", (int)sizeof(long double));
  printf("size of GDTR:        %u Bytes (should be 6 Bytes)\n", (int)sizeof(GDTR));
  get_gdt(&gdtr);
  printf("GDT base: %lXh, limit: %Xh\n", gdtr.base, gdtr.limit);
  return(0);
}

---
DOS gives me freedom to unlimited HW access.

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 400 users online (0 registered, 400 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum