--- title: "Machine Code Programming — Understanding the Stack" type: "article" slug: "machine-code-programming-understanding-the-stack" url: "http://localhost/article/machine-code-programming-understanding-the-stack/" markdown_url: "http://localhost/article/machine-code-programming-understanding-the-stack.md" published_at: "2020-10-27T21:11:13+00:00" modified_at: "2024-06-23T01:09:33+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Often when writing machine code (MC) programs, it's useful to keep the MC above RAMTOP. But few people understand how to move RAMTOP and the Z80's stack pointer from within MC." category: - name: "Syntax" slug: "syntax" taxonomy: "category" url: "http://localhost/category/periodicals/syntax/" post_tag: - name: "1982" slug: "year-1982" taxonomy: "post_tag" url: "http://localhost/tag/year-1982/" - name: "Machine language programming" slug: "machine-language" taxonomy: "post_tag" url: "http://localhost/tag/machine-language/" - name: "Tutorial" slug: "tutorial" taxonomy: "post_tag" url: "http://localhost/tag/tutorial/" - name: "ZX80" slug: "zx80" taxonomy: "post_tag" url: "http://localhost/tag/zx80/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX80" slug: "zx80" taxonomy: "model" url: "http://localhost/model/zx80/" - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" indiv: - name: "Ian Logan" slug: "ian-logan" taxonomy: "indiv" url: "http://localhost/indiv/ian-logan/" publication: "Syntax" publication_r: id: 10246 title: "Syntax" type: "periodical" url: "http://localhost/periodical/syntax/" authors: "Ian Logan" volume: "3" issue: "8" issues_articles: - id: 26706 title: "Syntax/Syntax ZX80 v3 n8" type: "issue" url: "http://localhost/issue/syntax-syntax-zx80-v3-n8/" pages: "19" pubdate: "August 1982" archive_link: false volumeissue: "v3n8" --- # Machine Code Programming — Understanding the Stack Often when writing machine code (MC) programs, it’s useful to keep the MC above RAMTOP. But few people understand how to move RAMTOP and the Z80’s stack pointer from within MC.