Sorceress

Stacks in QBasic

Dec 24th, 2016
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. DIM stack(255) as LONG
  2. DIM stackptr as LONG
  3.  
  4. Function Push(x)
  5. stackptr = stackptr + 1
  6. stack(stackptr) = x
  7. End Function
  8.  
  9. Function Pop(x)
  10. x = stack(stackptr)
  11. stackptr = stackptr - 1
  12. End Function
Advertisement
Add Comment
Please, Sign In to add comment