/* * Copyright (C) 2010 Tobias Klauser * * This file is part of nios2sim-ng. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include #include #include "nios2sim-ng.h" #include "nios2.h" #include "memory.h" uint8_t memory_get_byte(struct memory *mem, int32_t offset) { uint8_t *base = (uint8_t *) mem->base; return base[offset]; } void memory_dump(struct memory *mem, uint32_t offset, size_t count) { size_t i; for (i = 0; i < count; i++) { if ((i + 1) % 4 == 1) info("%08x: ", (unsigned int) (offset + i)); info(" %08x", mem->base[offset / 4 + i]); if ((i + 1) % 4 == 0) info("\n"); } }