Showing posts with label algoritma dan pemrograman.. Show all posts
Showing posts with label algoritma dan pemrograman.. Show all posts

Monday, June 10, 2013

Latihan

untuk melakukan program ini, kalian buat project terlebih dahulu. File-New-Project. Setelah itu muncul New Target. Ganti Platform dengan DOS(standard) dan Target Model Small. Lalu untuk menyimpan klik Browse. Setelah itu OK.
 
#include <conio.h>
#include <dos.h>
#include <stdlib.h>
#define UCHAR unsigned char
#define VIDEO_INT 0x10

void cetak (UCHAR letter, UCHAR colour);
void setcursorpos (UCHAR baris, UCHAR kolom);

int main(void)
{
   setcursorpos(3,4);
   cetak (0x49,0x1f);
    setcursorpos(3,5);
   cetak (0x00,0x1f);
    setcursorpos(3,6);
   cetak (0x4c,0x1f);
    setcursorpos(3,7);
   cetak (0x4f,0x1f);
    setcursorpos(3,8);
   cetak (0x56,0x1f);
    setcursorpos(3,9);
   cetak (0x45,0x1f);
   setcursorpos(3,10);
   cetak (0x00,0x1f);
   setcursorpos(3,11);
   cetak (0x59,0x1f);
   setcursorpos(3,12);
   cetak (0x4f,0x1f);
   setcursorpos(3,13);
   cetak (0x55,0x1f);

getch();
return EXIT_SUCCESS;
}

void cetak (UCHAR letter, UCHAR colour)
{
asm mov ah,0x09;
asm mov al,letter;
asm mov bh,0x00;
asm mov bl,colour;
asm mov ch,0x00;
asm mov cl,0x01;
asm int VIDEO_INT;
return;
}

void setcursorpos (UCHAR baris, UCHAR kolom)
{
asm mov ah,0x02;
asm mov bh,0x00;
asm mov dh,baris;
asm mov dl,kolom;
asm int VIDEO_INT;

return;
}

(DRF)