mirror of
https://github.com/Russell-S-Harper/COMMON.git
synced 2024-11-28 05:51:09 +00:00
33 lines
338 B
Plaintext
33 lines
338 B
Plaintext
#include "rom.h"
|
|
#include "macros.h"
|
|
#include "globals.h"
|
|
|
|
* = $600
|
|
|
|
HDR(DEMO)
|
|
CMN
|
|
SET(R0, 9.4662)
|
|
PSH(R0)
|
|
BRS(FACTORIAL)
|
|
POP(R4)
|
|
ESC
|
|
BRK
|
|
|
|
BGN(FACTORIAL)
|
|
POP(R1)
|
|
SET(R2, 1)
|
|
MOD(R3, R1, R2)
|
|
SUB(R1, R1, R3)
|
|
_1 TST(R1)
|
|
BRZ(_2)
|
|
MUL(R2, R2, R1)
|
|
DCR(R1)
|
|
BRA(_1)
|
|
_2 PSH(R2)
|
|
RTN
|
|
END(FACTORIAL)
|
|
|
|
END(DEMO)
|
|
|
|
SVD_T .BYTE 0, 0, 0, 0
|