So the program I'm trying to write in HLA should do the dollowing: I enter a digit, and it gives a pattern of numbers. The pattern should show all the odd numbers from 1 up to that number followed by all the even numbers from 2 up to that number. Here is my code:
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;
However, it is a infinite loop and I'm not sure how to solve this issue.
I Highly appreciate any and all help!