summaryrefslogtreecommitdiff
path: root/assembly/win95/win95.S
diff options
context:
space:
mode:
Diffstat (limited to 'assembly/win95/win95.S')
-rw-r--r--assembly/win95/win95.S64
1 files changed, 63 insertions, 1 deletions
diff --git a/assembly/win95/win95.S b/assembly/win95/win95.S
index 932f230..d547c11 100644
--- a/assembly/win95/win95.S
+++ b/assembly/win95/win95.S
@@ -14,6 +14,8 @@ beq a0,t0,retailkey
li t0,2
beq a0,t0,oemkey
li t0,3
+beq a0,t0,office97key
+li t0,4
beq a0,t0,upgradepassword
j _start
@@ -192,6 +194,66 @@ bnez t0,1b
j anykey
+office97key:
+
+# Clear the screen
+la a0,clearscreenmsg
+li a7,4
+ecall
+
+# Section 1a: Any 3 digits, save what the last one was
+li t0,3
+1:
+li a0,0
+li a1,9
+li a7,128
+ecall
+mv s0,a0
+li a7,1
+ecall
+addi t0,t0,-1
+bnez t0,1b
+
+# Section 1b: Last digit from previous section plus 1 or 2 (mod 10)
+li a0,1
+li a1,2
+li a7,128
+ecall
+add a0,s0,a0
+li t0,10
+rem a0,a0,t0
+addi a0,a0,0x30
+li a7,11
+ecall
+
+# A dash
+li a0,'-'
+li a7,11
+ecall
+
+# Section 2a: Any 6 digits
+li s0,0
+li t0,6
+1:
+li a0,0
+li a1,9
+li a7,128
+ecall
+add s0,s0,a0
+li a7,1
+ecall
+addi t0,t0,-1
+bnez t0,1b
+
+# Section 2b: Check digit for section 2a
+li t0,7
+rem s0,s0,t0
+sub a0,t0,s0
+li a7,1
+ecall
+
+j anykey
+
upgradepassword:
# Clear the screen
@@ -352,7 +414,7 @@ la a0,inputerrormsg
ecall
j upgradepassword_restart
-menumsg: .asciz "1: Retail Key\n2: OEM Key\n3: Upgrade Password\n\nEnter your choice:\n"
+menumsg: .asciz "1: Retail Key\n2: OEM Key\n3: Office 97 Key\n4: Upgrade Password\n\nEnter your choice:"
keypromptmsg: .asciz "Enter key: "
passwordheadermsg: .asciz "Password: "
inputerrormsg: .asciz "Invalid entry\n\n"