All pastes #772921 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-11-14 04:12 UTC
rendered paste body
/*
 * This file is part of the LinuxBIOS project.
 *
 * Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 */

#define u8 unsigned char

static xdata at 0x7f3f u8 disable_reg;
static xdata at 0x7f3e u8 output_enable_reg;

void main(void)
{
        /* Set bit 6 in DISABLE_REG to enable serial port 1. */
        disable_reg |= (1 << 6);

        while (1) {
                /* Clear bit 1 of OUTPUT_ENABLE_REG (the iRESET_OUT bit). */
                output_enable_reg &= ~(1 << 1);

                /* TODO: Add a few NOPs. */
        }
}