Skip to content

Instantly share code, notes, and snippets.

@shirriff
Last active October 24, 2022 14:22
Embed
What would you like to do?
HP Nanoprocessor code to determine the number of days in a month
d0 STR-0 Store the next byte (7) in register 0.
07
0c SLE Skip two instructions if accumulator <= register 0.
03 DED Decrement the accumulator in decimal mode
5f NOP No operation
d0 STR-0 Store the next byte (0x31) in register 0
31
30 SBZ-0 Skip two instruction bytes if accumulator bit 0 is zero
81 JMP-1 Jump to 0x1c9 (end of this code block)
c9
a1 CBN-1 Clear accumulator bit 1
d0 STR-0 Store the next byte (0x30) in register 0
30
0f SAN Skip two instruction bytes if accumulator not zero
d0 STR-0 Store next byte (0x28) in register 0
28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment