You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
1.2 KiB
89 lines
1.2 KiB
.include "instr.inc"
|
|
.text
|
|
|
|
.global _start
|
|
_start:
|
|
ld_r0 0x40ff
|
|
ld_r1 0x50ff
|
|
ld_r2 0x60ff
|
|
ld_r3 0x70ff
|
|
|
|
mix
|
|
mix1_ld_r1 mem_password
|
|
mix1_inc_r1
|
|
mix1_ldr_r0_r1
|
|
mix1_ld_r1 0x5871
|
|
mix1_cp_r0_r1
|
|
mix1_jp_ne loc_203b
|
|
mix1_inc_r3
|
|
loc_203b:
|
|
mix1_switch2
|
|
mix2_ldr_r0 mem_password + 3
|
|
mix2_xor_r0 0x54c2
|
|
mix2_cp_r0 0x6da4
|
|
mix2_jp_ne loc_2049
|
|
mix2_inc_r3
|
|
loc_2049:
|
|
mix2_switch3
|
|
mix3_ld_r1 mem_password + 1
|
|
mix3_dec_r1
|
|
mix3_ldrb_r0_r1
|
|
mix3_add_r0_r0
|
|
mix3_add_r0_r0
|
|
mix3_cp_r0 0x011c
|
|
mix3_jp_ne loc_2058
|
|
mix3_inc_r3
|
|
loc_2058:
|
|
mix3_ld_r0 -1
|
|
mix3_end
|
|
|
|
ld_r2 -1
|
|
brk
|
|
brk
|
|
brk
|
|
brk
|
|
|
|
# ld_r0 0xab67
|
|
# ld_r1 0x1234
|
|
#loop:
|
|
# strb_r0 mod + 1
|
|
# brk
|
|
#mod:
|
|
# copr 0
|
|
# brk
|
|
# inc_r0
|
|
# jp loop
|
|
# ret
|
|
|
|
ld_r2 str_yes
|
|
jp_eq end
|
|
ld_r2 str_no
|
|
end:
|
|
call PrintStr
|
|
ret
|
|
|
|
break:
|
|
ld_r0 -1
|
|
brk
|
|
ret
|
|
|
|
mem_test:
|
|
.2byte 0x1000
|
|
mem_test2:
|
|
.2byte 0x1100
|
|
mem_test3:
|
|
.2byte 0x1200
|
|
mem_test4:
|
|
.2byte 0x1300
|
|
|
|
mem_input:
|
|
.ascii "A\0" # 0x9ec0
|
|
|
|
str_yes:
|
|
.ascii "yes\n\0"
|
|
str_no:
|
|
.ascii "no\n\0"
|
|
|
|
.fill 0x100 - (. - _start)
|
|
mem_password:
|
|
.byte 0x47, 0x71, 0x58, 0x66, 0x39, 0x06, 0x07, 0x08
|
|
|