Skip to content

Runtime stack visualizer: Displays the runtime stack given a number of variables and their types.

Notifications You must be signed in to change notification settings

ryanmcclure4/stackVisualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

#Stack Visualizer A program that allows you to see how the variables in your program are stored in the stack.

###Usage

  • Compile with a C compiler and make an executable.
  • Run it like any other C program.

It will ask you to specify the number of variables you are going to input. When you enter your variables, the name must only be one character long.

Input should look exactly like this(don't end lines in a semicolon as you would when writing the program):

int a
char b
long c

###Example output

Number of variables to initialize : 12
int a
char b
short c
int d
float e
double f
float g
char h
char i
char j
short k
char l
	 _______________________________
	|        |             |        |
	| OFFSET |    STACK    | MEMORY |
	|________|_____________|________|
	|                               |
	|	 	 ---------------   LOW  |
	|  -36	| X | l |   k   |   ^   |
	|  -32	| X | j | i | h |   ^   |
	|  -28	|       g       |   ^   |
	|  -24	|       f       |   ^   |
	|  -20	|       f       |   ^   |
	|  -16	|       e       |   ^   |
	|  -12	|       d       |   ^   |
	|  -8	|   c   | X | b |   ^   |
	|  -4	|       a       |   ^   |
	|  %fp -> --------------   HIGH |
	|_______________________________|

###Additional info

  • It can accept a char, short, int, long, float, and double. Making any of these unsigned or constant won't change the output.

  • An 'X' represents padding, so don't name any variables 'X' because then you won't know if you are looking at your variable or padding.

  • At this point, it can't deal with arrays.

  • It is set to hold 50 stack frames, but if you want more you can change STACKSIZE

About

Runtime stack visualizer: Displays the runtime stack given a number of variables and their types.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages