-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathtyping.armstrong
More file actions
86 lines (65 loc) · 2.18 KB
/
Copy pathtyping.armstrong
File metadata and controls
86 lines (65 loc) · 2.18 KB
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
#AS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This is a very simple typing program. All of the letters and many symbols can be typed with your keyboard. //
// You can also delete previously typed characters with the BACKSPACE key. //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
change $chMemOffset = 53546
change $charCount = 0
change $cursorChar = 8
change $lastKey = 168
change $expLoc = 53500
change $expLoc2 = 53502
// Cursor/clear character
add $chMemOffset,$charCount -> $actualAddress
change *[1]$actualAddress = $cursorChar
#mainLoop // Main loop
// Get any key press
change $key = *[1]$expLoc
change $randColor = 27389
// If the user is pressing a key
if $key!=168:
// Only get 1 key press if the user holds it down
if $key!=$lastKey:
if $key==70: // If backspace key pressed
if $charCount>0:
// Clear character
add $chMemOffset,$charCount -> $actualAddress
change *[1]$actualAddress = 0
// Move backward in memory
sub $charCount,1 -> $charCount
// Cursor character
add $chMemOffset,$charCount -> $actualAddress
change *[1]$actualAddress = $cursorChar
endif
endif
if $key!=70: // If backspace key is NOT pressed
// Put character into memory
add $chMemOffset,$charCount -> $actualAddress
and $randColor,0b11111111 -> $randColor
bsl $randColor,8 -> $randColor
add $key,$randColor -> $coloredKey // Set the color using new system.
change *[1]$actualAddress = $coloredKey
add $randColor,$coloredKey -> $randColor
mult $randColor,$charCount -> $randColor
// Increment character position
add $charCount,1 -> $charCount
// Cursor/clear character
add $chMemOffset,$charCount -> $actualAddress
change *[1]$actualAddress = $cursorChar
// Reset character count if exceeds char limit
if $charCount==324:
change $charCount = 0
endif
endif
change $lastKey = $key
change *[1]$expLoc2 = 23424
asm"
vbuf
"
endif
endif
// If the user releases the key, reset lastkey
if $key==168:
change $lastKey = $key
endif
goto #mainLoop