EDN首页   博客首页

日志档案

发表于 2007-6-19 19:55:29

1

标签: 无标签

学习UCOSII

把学习过程记录下来吧.也算做是自己的笔记.不喜欢手写.

系统分类: 单片机   |   用户分类: 无分类   |   来源: 无分类   |   【推荐给朋友】   |   【添加到收藏夹】

    阅读(550)    回复(3)  

投一票您将和博主都有获奖机会!

最新评论

  • mao1984

    2007-6-19 20:40:18

    #include <stdio.h>
    #include <conio.h>
    #include <string.h>
    #include <dos.h>
    #include <malloc.h>
    #define  DISP_MAX_X                     80
    #define  DISP_BASE                  0xB800

     void PC_DispChar (char x, char y, char c, char color)
    {
       char far *pscr;
       int      offset;


      offset  = (int)y * DISP_MAX_X * 2 + (int)x * 2;  /* Calculate position on the screen         */
      pscr    = (char far *)MK_FP(DISP_BASE, offset);
      *pscr++ = c;                                           /* Put character in video RAM               */
      *pscr  = color;                                       /* Put video attribute in video RAM         */
    }
    main()
    { PC_DispChar(20,14,50,12);
    return 0;
    }

  • mao1984

    2007-6-19 20:41:01

    这个在BC45下面编译通不过

      *pscr++ = c;  

    好像是提示这个有错

  • mao1984

    2007-6-19 20:24:20

    /* MK_FP example */

    #include <stdio.h>
    #include <conio.h>
    #include <string.h>
    #include <dos.h>
    #include <malloc.h>

    main()
    {

      char *str = "hello\n";
      char far *farstr;

      printf ("the address pointed to by str is %04X:%04X\n",
        FP_SEG(str), FP_OFF(str));
      farstr = (char far *)MK_FP( FP_SEG(str),  FP_OFF(str));

      printf ("the string pointed by far pointer is %s\n", farstr);
      return 0;
    }