Greetings everyone,
I'm new to programming, and I'm having trouble running a c program in an 8051 emulator. I'm using emu51.exe
C:\UHCL\CPROGR~1\asm51>asm51.exe
8051 Cross-Assembler, Version 1.2k(c) Copyright 1984-1996 by MetaLink
Source file drive and name [.ASM]:
1\P08-15.c Second passASSEMBLY COMPLETE, 30 ERRORS FOUND
Although the HEX and LST files are created, they don't appear to load into the emu51.exe emulator. I assume it is due to the errors I'm receiving during "assembly" in asm51.exe. Below is the source that I am using. If you could help me out with this, I would certainly appreciate an email!
#include
#define MAX_ROWS 5 #define MAX_COLS 4
void fillArray (int table[][MAX_COLS], int numRows);
int main (void) {
int row; int col; int ary[MAX_ROWS][MAX_COLS];
fillArray(ary, MAX_ROWS); printf("Data: \n"); for (row = 0; row < 5; row++) { for (col = 0; col < 4; col++) printf("%8d", ary [row][col]); printf("\n"); } return 0; }
void fillArray (int table[][MAX_COLS], int numRows) {
for (int row = 0; row < numRows; row++) { table [row][0] = row * 10; for (int col = 1; col < MAX_COLS; col++) table [row][col] = table [row][col - 1] + 1; } return; }
Best regards,
Mark