PUSHEM
PUSHEM is macro assembler for the BytePusher machine. It works exclusively in hex. There are some primitives, and then you can also define macros for other uses.
Tables
PUSHEM works by creating tables to do calculations with. There are two kind of tables, small tables (256 bytes) and big tables (64K bytes).
Here is an example of creating a big table for adding numbers:
\T __MAJOR #1 __MINOR
Macros
You can create macros which can expand into larger pieces of codes.
Here is an example to make a label name at the current point in the program:
{ Label (name) \c ^1 ? }
Instructions
An instruction can store a source address, destination address, and jump address. By default, the jump address is the address of the next instruction.
To make a move instruction:
\x #0006C0 #00004F
To jump:
\j +#000100
You can combine multiple moves for indirect moves and stuff:
\x Counter x&Next \c Next ? \x Table1 Counter
Examples
External resources
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.