-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPDP8.asm
More file actions
40 lines (35 loc) · 756 Bytes
/
PDP8.asm
File metadata and controls
40 lines (35 loc) · 756 Bytes
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
TITLE PDP8 (PDP8.asm)
INCLUDE Irvine32.inc
INCLUDE PDP8_Extract.inc
INCLUDE PDP8_Instructions.inc
INCLUDE PDP8_Operate.inc
INCLUDE PDP8_Interface.inc
.data
halted BYTE 0
accumulator WORD 0
link BYTE 0
programCounter WORD 0
ram WORD 111100000010b, 4094 DUP(0)
instructions DWORD accumulatorAnd, twosComplementAdd, incrementSkipIfZero, depositAccumulator,
jumpToSubroutine, jump, ioTransfer, operate
.code
main PROC
call interface
exit
main ENDP
start PROC uses eax ebx
cycle:
.IF halted == 1
call haltMessage
.ELSE
call extractVariables
xor ebx, ebx
mov bl, opCode
mov eax, instructions[ebx * TYPE instructions]
call eax
inc programCounter
jmp cycle
.ENDIF
ret
start ENDP
END main