.global __trap_interrupt
.global __init_stack
.global __low_level_init
.global __do_copy_data
.global __do_clear_bss
.global main
.global __stop_progExec__
.global __ctors_end
.global create_password
.global get_password
.global check_password
.global unlock_door
.global __do_nothing
.global INT
.global putchar
.global getchar
.global getsn
.global puts
.global _unexpected_

.text
.org 0x10
__trap_interrupt: ret
.org 0x4400
__init_stack: mov #0x4400, r1
.org 0x4404
__low_level_init: mov &0x015c, r5
.org 0x4408
and.b #-0x1, r5
.org 0x440a
bis #0x5a08, r5
.org 0x440e
__do_copy_data: clr r15
.org 0x4410
nop
.org 0x4412
tst r15
.org 0x4414
jz 0xe
.org 0x4416
mov r5, &0x015c
.org 0x441a
decd r15
.org 0x441c
mov 0x45c2(r15), 0x2400(r15)
.org 0x4422
jnz -0xc
.org 0x4424
__do_clear_bss: mov #0x8, r15
.org 0x4426
nop
.org 0x4428
tst r15
.org 0x442a
jz 0xc
.org 0x442c
mov r5, &0x015c
.org 0x4430
dec r15
.org 0x4432
mov.b #0x0, 0x2400(r15)
.org 0x4436
jnz -0xa
.org 0x4438
main: add #0xff9c, r1
.org 0x443c
call #0x447e
.org 0x4440
mov #0x44e4 , r15
.org 0x4444
call #0x4594
.org 0x4448
mov r1, r15
.org 0x444a
call #0x44b2
.org 0x444e
mov r1, r15
.org 0x4450
call #0x44bc
.org 0x4454
tst r15
.org 0x4456
jnz 0xa
.org 0x4458
mov #0x4503 , r15
.org 0x445c
call #0x4594
.org 0x4460
jmp 0xc
.org 0x4462
mov #0x4520 , r15
.org 0x4466
call #0x4594
.org 0x446a
call #0x44d6
.org 0x446e
clr r15
.org 0x4470
add #0x64, r1
.org 0x4474
__stop_progExec__: bis #0xf0, r2
.org 0x4478
jmp -0x4
.org 0x447a
__ctors_end: br #0x45c0
.org 0x447e
create_password: mov #0x2400, r15
.org 0x4482
mov.b #0x7d, 0x0(r15)
.org 0x4488
mov.b #0x49, 0x1(r15)
.org 0x448e
mov.b #0x3c, 0x2(r15)
.org 0x4494
mov.b #0x6a, 0x3(r15)
.org 0x449a
mov.b #0x51, 0x4(r15)
.org 0x44a0
mov.b #0x37, 0x5(r15)
.org 0x44a6
mov.b #0x3f, 0x6(r15)
.org 0x44ac
mov.b #0x0, 0x7(r15)
.org 0x44b0
ret
.org 0x44b2
get_password: mov #0x64, r14
.org 0x44b6
call #0x4584
.org 0x44ba
ret
.org 0x44bc
check_password: clr r14
.org 0x44be
mov r15, r13
.org 0x44c0
add r14, r13
.org 0x44c2
cmp.b @r13, 0x2400(r14)
.org 0x44c6
jne 0xa
.org 0x44c8
inc r14
.org 0x44ca
cmp #0x8, r14
.org 0x44cc
jne -0xe
.org 0x44ce
mov #0x1, r15
.org 0x44d0
ret
.org 0x44d2
clr r15
.org 0x44d4
ret
.org 0x44d6
unlock_door: push #0x7f
.org 0x44da
call #0x4530
.org 0x44de
incd r1
.org 0x44e0
ret
.org 0x44e2
__do_nothing: ret
.org 0x44e4
.strings: .string "Enter the password to continue"
.org 0x4503
.string "Invalid password; try again."
.org 0x4520
.string "Access Granted!"
.org 0x4530
INT: mov 0x2(r1), r14
.org 0x4534
push r2
.org 0x4536
mov r14, r15
.org 0x4538
swpb r15
.org 0x453a
mov r15, r2
.org 0x453c
bis #0x8000, r2
.org 0x4540
call #0x10
.org 0x4544
pop r2
.org 0x4546
ret
.org 0x4548
putchar: decd r1
.org 0x454a
push r15
.org 0x454c
push #0x0
.org 0x454e
mov r15, 0x4(r1)
.org 0x4552
call #0x4530
.org 0x4556
mov 0x4(r1), r15
.org 0x455a
add #0x6, r1
.org 0x455e
ret
.org 0x4560
getchar: push r4
.org 0x4562
mov r1, r4
.org 0x4564
incd r4
.org 0x4566
decd r1
.org 0x4568
mov #0xfffc, r15
.org 0x456c
add r4, r15
.org 0x456e
push r15
.org 0x4570
push #0x1
.org 0x4572
call #0x4530
.org 0x4576
mov.b -0x4(r4), r15
.org 0x457a
sxt r15
.org 0x457c
add #0x6, r1
.org 0x4580
pop r4
.org 0x4582
ret
.org 0x4584
getsn: push r14
.org 0x4586
push r15
.org 0x4588
push #0x2
.org 0x458a
call #0x4530
.org 0x458e
add #0x6, r1
.org 0x4592
ret
.org 0x4594
puts: push r11
.org 0x4596
mov r15, r11
.org 0x4598
jmp 0xe
.org 0x459a
inc r11
.org 0x459c
sxt r15
.org 0x459e
push r15
.org 0x45a0
push #0x0
.org 0x45a2
call #0x4530
.org 0x45a6
add #0x4, r1
.org 0x45a8
mov.b @r11, r15
.org 0x45aa
tst.b r15
.org 0x45ac
jnz -0x12
.org 0x45ae
push #0xa
.org 0x45b2
push #0x0
.org 0x45b4
call #0x4530
.org 0x45b8
add #0x4, r1
.org 0x45ba
clr r15
.org 0x45bc
pop r11
.org 0x45be
ret
.org 0x45c0
_unexpected_: reti pc
