-
Notifications
You must be signed in to change notification settings - Fork 1
/
PDP8_Interface.inc
88 lines (81 loc) · 1.97 KB
/
PDP8_Interface.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
TITLE PDP8_Interface (PDP8_Interface.inc)
INCLUDE PDP8_FileInput.inc
INCLUDE PDP8_RawInput.inc
.data
welcomeMessage1 BYTE " MASM Assembly PDP-8 Simulator", 0
welcomeMessage2 BYTE "---------------------------------", 0
welcomeMessage3 BYTE "Entry Mode 1: Manual instructions by line (not yet functional).", 0
welcomeMessage4 BYTE "Entry Mode 2: Pull from file (default is PDP8_Ram.txt) (not functional).", 0
welcomeMessage5 BYTE "Entry Modes not functional! Pulling hard-coded instructions...", 0
entry1Selected BYTE "Entry mode [1] selected.", 0
entry2Selected BYTE "Entry mode [2] selected.", 0
prompt BYTE "--> ", 0
input BYTE 2 DUP(0)
buffer BYTE 5000 DUP(0)
inputErrorMessage BYTE "Input not recognized.", 0
haltFrontMessage BYTE "Program halted! PC at location ", 0
haltBackMessage BYTE ". Terminating on keypress...", 0
.code
interface PROC uses ecx edx
call welcomeMessage
;promptLoop:
; lea edx, prompt
; call writeString
; lea edx, input
; mov ecx, SIZEOF input
; call readString
; .IF input == "1"
; lea edx, entry1Selected
; call writeString
; call crlf
; call manualEntry
; .ELSEIF input == "2"
; lea edx, entry2Selected
; call writeString
; call crlf
; call fileEntry
; .ELSE
; call inputError
; jmp promptLoop
; .ENDIF
call start
ret
interface ENDP
welcomeMessage PROC uses edx
lea edx, welcomeMessage1
call writeString
call crlf
lea edx, welcomeMessage2
call writeString
call crlf
call crlf
lea edx, welcomeMessage3
call writeString
call crlf
lea edx, welcomeMessage4
call writeString
call crlf
call crlf
lea edx, welcomeMessage5
call writeString
call crlf
call crlf
ret
welcomeMessage ENDP
inputError PROC
lea edx, inputErrorMessage
call writeString
call crlf
call crlf
ret
inputError ENDP
haltMessage PROC uses eax edx
xor eax, eax
lea edx, haltFrontMessage
call writeString
mov ax, programCounter
call writeDec
call crlf
call waitMsg
ret
haltMessage ENDP