Hi I'm taking a system software class on my uni and I'm making an assembly code with SIC. I've already written a code with C. So I'm translating it to SIC and I got a question about variable policy of SIC. Can I reuse population to store the calculated number? just like C variable? I think it's too basic so I couldn't get an answer when I googled it. Thank you!
int main(void) {
double current_population = 11778;
int birth = 180;
int death= 120;
double immigrant = 53.333;
/*one day is 24 hours, so it's1440 minute
the value of birth and death, immigrant are based on a day.
*/
for (int i = 0; i < 7; i++) {
current_population = current_population + birth + immigrant - death;
printf("%d day의 인구 : %d\n", i + 1, (int)current_population);
}
return 0;
}
here is unfinished sic code (very rough)
LDX ZERO
LDA population
ADD birth
SUB death
ADD immigrant
STA population
population WORD 11778
birth WORD 180
death WORD 120
immigrant WORD 53