Skip to content

MBEDOBE/monty

Repository files navigation

0x19.C - Stacks, Queues - LIFO, FIFO

Description

In this team project we are tasked to create an interpreter for Monty ByteCode files. These files will have commands per line to manipulate the data structure given.

ow to work with git submodules


Files

  • Contains the main function that takes in the file and runs the parser.
  • Header file.
  • Functions that parses the file from main, then parses the lines. While parsing, data is stored into structs to be passed onto other functions.
  • Contains functions that checks arguments from lines of the file. Checks for if push function is in the file line.
  • Our get operations function that matches the aruguments with what opcode function we need to run.
  • Contains push, pall, free_stack, and nop.
  • Contains pint, pop, swap, pchar, and pstr.
  • Contains rotl, rotr, qpush.
  • Contains add, sub, div, mul, mod.
  • Contains stack and queue.

Tasks

0. push, pall

  • Implement the push and pall opcodes.
  • The opcode push pushes an element to the stack.
  • The opcode pall prints all the values on the stack, starting from the top of the stack.

1. pint

  • Implement the pint opcode
  • The opcode pint prints the value at the top of the stack, followed by a new line.

2. pop

  • Implement the pop opcode.
  • The opcode pop removes the top element of the stack.

3. swap

  • Implement the swap opcode
  • The opcode swap swaps the top two elements of the stack.

4. add

  • Implement the add opcode
  • The opcode add adds the top two elements of the stack.

5. nop

  • Implement the nop opcode
  • The opcode nop doesn't do anything

Authors/Collaborators

D. Mbedobe KUNJI || Adowarim Lugu

About

0x19.C - Stacks, Queues - LIFO, FIFO

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published