Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- assumption: BF uses ASCII characters
- todo: use a jump table to jump to labels based on the ASCII character, jump to invalid_character in all other places
- basic structure:
- - read BF program into memory (stack or main memory? maybe depend on program size?)
- - initialize BF memory, should be fixed size, so has to be initialized to zeroes before program starts in data section
- - use register to keep track of where you are in BF program
- - read current character, somehow use the jump table (indirect indexing? lea? use register?)
- - use correct methods, then jump back to read loop (in case of [ save current address into register, then when ] found jump back)
- - finish program once at end of BF memory (somehow)
Advertisement
Add Comment
Please, Sign In to add comment