forked from Samiha-Sadek/Microprocessor-Simulation-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWName.inc
More file actions
47 lines (45 loc) · 945 Bytes
/
WName.inc
File metadata and controls
47 lines (45 loc) · 945 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
41
42
43
44
45
46
47
.286
WriteName MACRO Name, player
Local playerOne
Local Display
Local NextChar
Local NameEnd
pusha
cmp player, 1
je playerOne
;Player 2:
mov ax, 0
mov ah, 02 ;SetCursorPosition
mov dl, 22 ;X coordinated
mov dh, 0 ;Ycoordinated
mov bx, 0
int 10h
jmp Display ;skip player1
playerOne:
mov ax, 0
mov ah, 02h ;SetCursorPosition
mov dl, 1 ;X coordinated
mov dh, 0 ;Ycoordinated
mov bx, 0
int 10h
Display:
lea di, Name
NextChar:
mov al, [di]
cmp al, 24h
je NameEnd
mov bl, 0Ch ;Color is red
mov bh, 0 ;Display page
mov ah, 0Eh ;Teletype
int 10h
mov ax, 0
mov ah, 02h ;SetCursorPosition
inc dl ;X coordinated
mov dh, 0 ;Ycoordinated
mov bx, 0
int 10h
inc di
jmp NextChar
NameEnd:
popa
ENDM WriteName