Skip to content

Instantly share code, notes, and snippets.

@hthmkhlf
Created July 8, 2019 06:48
Show Gist options
  • Save hthmkhlf/f90d394a22371bd0235298516b53be6a to your computer and use it in GitHub Desktop.
Save hthmkhlf/f90d394a22371bd0235298516b53be6a to your computer and use it in GitHub Desktop.
program boxit;
#include ("stdlib.hhf");
static
iDatavalue : int8 := 0 ;
Begin boxit;
stdout.put("Gimme a decimal value to use as n: ");
stdin.get(iDatavalue);
mov(iDatavalue, BH);
DoWhileLp:
DoWhileLpBody:
ForLp:
InitializeForLp:
mov(BH, CH);
ForLpTerminationTest:
cmp(CH, 0);
jnl ForLpDone;
ForLpBody:
stdout.put("I = ", CH, nl);
ForLpIncrement:
dec(CH);
jmp ForLpTerminationTest;
ForLpDone:
dec(CH);
DoWhileLpTermination:
cmp(CH, 0);
jbe DoWhileLpDone;
jmp DoWhileLpBody;
DoWhileLpDone:
stdout.puti8(BH);
end boxit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment