|
|
|
|
|
by dfinninger
2110 days ago
|
|
I had to use this recently for an online course. It was super nice: def pushConstant(num: Int): String =
s"""
|@$num
|D=A
|$accessTopOfStack
|M=D
|$incrementStackPointer
|""".stripMargin
accessTopOfStack and incrementStackPointer are other functions that return text. It made composing Assembly a breeze. |
|