Category : Miscellaneous Language Source Code
Archive   : 8085.ZIP
Filename : START80.ARI

 
Output of file : START80.ARI contained in archive : 8085.ZIP
% START80.ARI - from A. Lane: "Simulating an 8085 with Prolog"

% This file starts everything up.

go :-
write('Loading memory.'),nl,
consult(memory),
write('Initializing memory.'),nl,
init_mem,
abolish(init_mem/0),
write('Loading monitor.'), nl,
consult(mon80),
write('Loading command parser.'),nl,
consult(parse80),
write('Loading tokenizer.'), nl,
consult(tokens80),
write('Loading miscellaneous routines.'),nl,
consult(preds80),
write('Loading help information'),nl,
consult(help80),
write('Loading opcode predicates.'),nl,
consult(ops8085),
asserta(state(regs(0,0,0,0,0,0,0),0,255,flags(0,0,0,0,0))),
sign_on,
monitor.

% op(_) :- write('instruction executed').

monitor :-
repeat,
prompt,
get_token_list(Tokens),
ifthenelse( parse_tokens(Command,Tokens,[]), % run command thru DCG. if valid
call(Command) , % do it, else
write('invalid request') ), % tell user no.
fail.

execute_instruction :-
retract(state(R,PC,SP,F)),
NewPC is PC + 1,
asserta(state(R,NewPC,SP,F)),
get_mem(PC,Instruction),
op(Instruction),!.

sign_on :-
cls,
write('8085 simulator'),nl,
write($ Type 'h' for help.$), nl.

prompt :-
tget(_,Col), % find out what column cursor's in.
ifthen( Col \= 0, nl), % if cursor not in column 0, new line.
write('->'),!. % print prompt.
%
% end START80.ARI


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : 8085.ZIP
Filename : START80.ARI

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/