|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||19||9||7||43.750%|
One thing almost all computers have in common, whether it is a simple stack-based calculator, a 6502 powered BBC Micro, or a brand new Android phone, every modern computer requires programs that turn either high-level languages or assembly language into machine code.
UKIEPC recently designed their own processor. While very easy to load programs onto, it is not as complex as some, since it has only one aim: show a number on an innovative laser display board!
The available memory consists of three 8-bit registers: A, X, and Y, plus an infinite stack. At program start these registers are initialised to unknown values, and the stack is empty.
The processor supports six unique instructions:
Due to memory constraints, the maximum number of instructions that can be written to disk is 40. Further instructions will not be executed.
Given a number, write a program to output the number on the laser display board.
When run in sequence the lines should output the number N. The last instruction should be a DI.
ST A ST X PH A PH X AD PL Y DI Y
ST X PH X PH X PH X AD PL Y PH Y PH Y AD AD PL A DI A