📄 vaxemulat.s
字号:
# r0<31:16> - 0 # r2<31:16> - 0 #-Lcvtps: movzwl operand_1(sp),r0 # r0<15:0> <- srclen.rw movl operand_2(sp),r1 # r1 <- srcaddr.ab movzwl operand_3(sp),r2 # r2<15:0> <- dstlen.rw movl operand_4(sp),r3 # r3 <- dstaddr.ab # now that the operands have been loaded, the only exception parameter # other than the pc/psl pair that needs to be saved is the old pc. however, # there is no reason why the state of the stack needs to be altered and we # save two instructions if we leave the stack alone. pushab vax$exit_emulator # store the return pc jmp vax$cvtps # do the actual work #+ # input parameters: # # opcode(sp) # old_pc(sp) # operand_1(sp) - srclen.rw # operand_2(sp) - srcaddr.ab # operand_3(sp) - tbladdr.ab # operand_4(sp) - dstlen.rw # operand_5(sp) - dstaddr.ab # operand_6(sp) # operand_7(sp) # operand_8(sp) # new_pc(sp) # exception_psl(sp) # # output parameters: # # r0<15:0> - srclen.rw # r0<31:16> - dstlen.rw # r1 - srcaddr.ab # r2 - tbladdr.ab # r3 - dstaddr.ab #-Lcvtpt: rotl $16,operand_4(sp),r0 # r0<31:16> <- dstlen.rw movw operand_1(sp),r0 # r0<15:0> <- srclen.rw movl operand_2(sp),r1 # r1 <- srcaddr.ab movl operand_3(sp),r2 # r2 <- tbladdr.ab movl operand_5(sp),r3 # r3 <- dstaddr.ab # now that the operands have been loaded, the only exception parameter # other than the pc/psl pair that needs to be saved is the old pc. however, # there is no reason why the state of the stack needs to be altered and we # save two instructions if we leave the stack alone. pushab vax$exit_emulator # store the return pc jmp vax$cvtpt # do the actual work #+ # input parameters: # # opcode(sp) # old_pc(sp) # operand_1(sp) - srclen.rw # operand_2(sp) - srcaddr.ab # operand_3(sp) - dstlen.rw # operand_4(sp) - dstaddr.ab # operand_5(sp) # operand_6(sp) # operand_7(sp) # operand_8(sp) # new_pc(sp) # exception_psl(sp) # # output parameters: # # r0<15:0> - srclen.rw # r1 - srcaddr.ab # r2<15:0> - dstlen.rw # r3 - dstaddr.ab # # implicit output: # # r0<31:16> - 0 # r2<31:16> - 0 #-Lcvtsp: movzwl operand_1(sp),r0 # r0<15:0> <- srclen.rw movl operand_2(sp),r1 # r1 <- srcaddr.ab movzwl operand_3(sp),r2 # r2<15:0> <- dstlen.rw movl operand_4(sp),r3 # r3 <- dstaddr.ab # now that the operands have been loaded, the only exception parameter # other than the pc/psl pair that needs to be saved is the old pc. however, # there is no reason why the state of the stack needs to be altered and we # save two instructions if we leave the stack alone. pushab vax$exit_emulator # store the return pc jmp vax$cvtsp # do the actual work #+ # input parameters: # # opcode(sp) # old_pc(sp) # operand_1(sp) - srclen.rw # operand_2(sp) - srcaddr.ab # operand_3(sp) - tbladdr.ab # operand_4(sp) - dstlen.rw # operand_5(sp) - dstaddr.ab # operand_6(sp) # operand_7(sp) # operand_8(sp) # new_pc(sp) # exception_psl(sp) # # output parameters: # # r0<15:0> - srclen.rw # r0<31:16> - dstlen.rw # r1 - srcaddr.ab # r2 - tbladdr.ab # r3 - dstaddr.ab #-Lcvttp: rotl $16,operand_4(sp),r0 # r0<31:16> <- dstlen.rw movw operand_1(sp),r0 # r0<15:0> <- srclen.rw movl operand_2(sp),r1 # r1 <- srcaddr.ab movl operand_3(sp),r2 # r2 <- tbladdr.ab movl operand_5(sp),r3 # r3 <- dstaddr.ab # now that the operands have been loaded, the only exception parameter # other than the pc/psl pair that needs to be saved is the old pc. however, # there is no reason why the state of the stack needs to be altered and we # save two instructions if we leave the stack alone. pushab vax$exit_emulator # store the return pc jmp vax$cvttp # do the actual work #+ # input parameters: # # opcode(sp) # old_pc(sp) # operand_1(sp) - divrlen.rw # operand_2(sp) - divraddr.ab # operand_3(sp) - divdlen.rw # operand_4(sp) - divdaddr.ab # operand_5(sp) - quolen.rw # operand_6(sp) - quoaddr.ab # operand_7(sp) # operand_8(sp) # new_pc(sp) # exception_psl(sp) # # output parameters: # # r0<15:0> - divrlen.rw # r1 - divraddr.ab # r2<15:0> - divdlen.rw # r3 - divdaddr.ab # r4<15:0> - quolen.rw # r5 - quoaddr.ab # # implicit output: # # r0<31:16> - 0 # r2<31:16> - 0 # r4<31:16> - 0 #-Ldivp: movzwl operand_1(sp),r0 # r0<15:0> <- divrlen.rw movl operand_2(sp),r1 # r1 <- divraddr.ab movzwl operand_3(sp),r2 # r2<15:0> <- divdlen.rw movl operand_4(sp),r3 # r3 <- divdaddr.ab movzwl operand_5(sp),r4 # r4<15:0> <- quolen.rw movl operand_6(sp),r5 # r5 <- quoaddr.ab # now that the operands have been loaded, the only exception parameter # other than the pc/psl pair that needs to be saved is the old pc. however, # there is no reason why the state of the stack needs to be altered and we # save two instructions if we leave the stack alone. pushab vax$exit_emulator # store the return pc jmp vax$divp # do the actual work #+ # input parameters: # # opcode(sp) # old_pc(sp) # operand_1(sp) - len.rw # operand_2(sp) - srcaddr.ab # operand_3(sp) - dstaddr.ab # operand_4(sp) # operand_5(sp) # operand_6(sp) # operand_7(sp) # operand_8(sp) # new_pc(sp) # exception_psl(sp) # # output parameters: # # r0<15:0> - len.rw # r1 - srcaddr.ab # r3 - dstaddr.ab # # implicit output: # # r0<31:16> - 0 # r2 - unpredictable #-Lmovp: movzwl operand_1(sp),r0 # r0<15:0> <- len.rw movl operand_2(sp),r1 # r1 <- srcaddr.ab movl operand_3(sp),r3 # r3 <- dstaddr.ab # now that the operands have been loaded, the only exception parameter # other than the pc/psl pair that needs to be saved is the old pc. however, # there is no reason why the state of the stack needs to be altered and we # save two instructions if we leave the stack alone. # the movp instruction is the only instruction in this entire set that # preserves the setting of the c-bit. the c-bit setting in the saved psl # is propogated into the current psl because the current psl forms the # initial setting for the final settings of the condition codes. bicpsw $psl$m_c # assume c bit is clear bitb $psl$m_c,exception_psl(sp) # is the saved c-bit set? beql 1f # skip next if saved c-bit is clear bispsw $psl$m_c # otherwise, set the c-bit # note that it is crucial that no instructions that alter the c-bit can # execute until the psl is saved in vax$movp. pushab preserves the c-bit.1: pushab vax$exit_emulator # store the return pc jmp vax$movp # do the actual work #+ # input parameters: # # opcode(sp) # old_pc(sp) # operand_1(sp) - mulrlen.rw # operand_2(sp) - mulraddr.ab # operand_3(sp) - muldlen.rw # operand_4(sp) - muldaddr.ab # operand_5(sp) - prodlen.rw # operand_6(sp) - prodaddr.ab # operand_7(sp) # operand_8(sp) # new_pc(sp) # exception_psl(sp) # # output parameters: # # r0<15:0> - mulrlen.rw # r1 - mulraddr.ab # r2<15:0> - muldlen.rw # r3 - muldaddr.ab # r4<15:0> - prodlen.rw # r5 - prodaddr.ab # # implicit output: # # r0<31:16> - 0 # r2<31:16> - 0 # r4<31:16> - 0 #-Lmulp: movzwl operand_1(sp),r0 # r0<15:0> <- mulrlen.rw movl operand_2(sp),r1 # r1 <- mulraddr.ab movzwl operand_3(sp),r2 # r2<15:0> <- muldlen.rw movl operand_4(sp),r3 # r3 <- muldaddr.ab movzwl operand_5(sp),r4 # r4<15:0> <- prodlen.rw movl operand_6(sp),r5 # r5 <- prodaddr.ab # now that the operands have been loaded, the only exception parameter # other than the pc/psl pair that needs to be saved is the old pc. however, # there is no reason why the state of the stack needs to be altered and we # save two instructions if we leave the stack alone. pushab vax$exit_emulator # store the return pc jmp vax$mulp # do the actual work #+ # input parameters: # # opcode(sp) # old_pc(sp) # operand_1(sp) - sublen.rw # operand_2(sp) - subaddr.ab # operand_3(sp) - diflen.rw # operand_4(sp) - difaddr.ab # operand_5(sp) # operand_6(sp) # operand_7(sp) # operand_8(sp) # new_pc(sp) # exception_psl(sp) # # output parameters: # # r0<15:0> - sublen.rw # r1 - subaddr.ab # r2<15:0> - diflen.rw # r3 - difaddr.ab # # implicit output: # # r0<31:16> - 0 # r2<31:16> - 0 #-Lsubp4: movzwl operand_1(sp),r0 # r0<15:0> <- sublen.rw movl operand_2(sp),r1 # r1 <- subaddr.ab movzwl operand_3(sp),r2 # r2<15:0> <- diflen.rw movl operand_4(sp),r3 # r3 <- difaddr.ab # now that the operands have been loaded, the only exception parameter # other than the pc/psl pair that needs to be saved is the old pc. however, # there is no reason why the state of the stack needs to be altered and we # save two instructions if we leave the stack alone. pushab vax$exit_emulator # store the return pc jmp vax$subp4 # do the actual work #+ # input parameters: # # opcode(sp) # old_pc(sp) # operand_1(sp) - sublen.rw # operand_2(sp) - subaddr.ab # operand_3(sp) - minlen.rw # operand_4(sp) - minaddr.ab # operand_5(sp) - diflen.rw # operand_6(sp) - difaddr.ab # operand_7(sp) # operand_8(sp) # new_pc(sp) # exception_psl(sp) # # output parameters: # # r0<15:0> - sublen.rw # r1 - subaddr.ab # r2<15:0> - minlen.rw # r3 - minaddr.ab # r4<15:0> - diflen.rw # r5 - difaddr.ab # # implicit output: # # r0<31:16> - 0 # r2<31:16> - 0 # r4<31:16> - 0 #-Lsubp6: movzwl operand_1(sp),r0 # r0<15:0> <- sublen.rw movl operand_2(sp),r1 # r1 <- subaddr.ab movzwl operand_3(sp),r2 # r2<15:0> <- minlen.rw movl operand_4(sp),r3 # r3 <- minaddr.ab movzwl operand_5(sp),r4 # r4<15:0> <- diflen.rw movl operand_6(sp),r5 # r5 <- difaddr.ab # now that the operands have been loaded, the only exception parameter # other than the pc/psl pair that needs to be saved is the old pc. however, # there is no reason why the state of the stack needs to be altered and we # save two instructions if we leave the stack alone. pushab vax$exit_emulator # store the return pc jmp vax$subp6 # do the actual work #+ # input parameters: # # opcode(sp) # old_pc(sp) # operand_1(sp) - srclen.rw # operand_2(sp) - srcaddr.ab # operand_3(sp) - pattern.ab # operand_4(sp) - dstaddr.ab # operand_5(sp) # operand_6(sp) # operand_7(sp) # operand_8(sp) # new_pc(sp) # exception_psl(sp) # # output parameters: # # r0<15:0> - srclen.rw # r1 - srcaddr.ab # r3 - pattern.ab # r5 - dstaddr.ab # # implicit output: # # r0<31:16> - 0 # r2 - explicitly set to zero # r4 - explicitly set to zero #-Leditpc: movzwl operand_1(sp),r0 # r0<15:0> <- srclen.rw movl operand_2(sp),r1 # r1 <- srcaddr.ab clrl r2 # r2 <- 0 movl operand_3(sp),r3 # r3 <- pattern.ab clrl r4 # r4 <- 0 movl operand_4(sp),r5 # r5 <- dstaddr.ab # now that the operands have been loaded, the only exception parameter # other than the pc/psl pair that needs to be saved is the old pc. however, # there is no reason why the state of the stack needs to be altered and we # save two instructions if we leave the stack alone. pushab vax$exit_emulator # store the return pc jmp vax$editpc # do the actual work #+ # functional description: # # this is the common exit path for all instruction-specific routines. # the condition codes returned by the vax$xxxxxx routine are stored in # the exception psl and control is passed back to the instruction stream # that executed the reserved instruction. # # input parameters: # # psl contains condition code settings from vax$xxxxxx routine. # # opcode(sp) - opcode of reserved instruction # old_pc(sp) - pc of reserved instruction # operand_1(sp) - first operand specifier # operand_2(sp) - second operand specifier # operand_3(sp) - third operand specifier # operand_4(sp) - fourth operand specifier # operand_5(sp) - fifth operand specifier # operand_6(sp) - sixth operand specifier # operand_7(sp) - seventh operand specifier (currently unused) # operand_8(sp) - eight operand specifier (currently unused) # new_pc(sp) - pc of instruction following reserved instruction # exception_psl(sp) - psl at time of exception # # implicit input: # # general registers contain architecturally specified values according # to specific instruction that was emulated. # # implicit output: # # control is passed to the location designated by "new pc" with the # condition codes as determined by vax$xxxxxx. the exit routine also # preserves general registers. #- .globl vax$exit_emulatorvax$exit_emulator: movpsl -(sp) # save the new psl on the stack # note that the next instruction makes no assumptions about the condition # codes in the saved psl. insv (sp)+,$0,$4,exception_psl(sp) # replace saved condition codes addl2 $new_pc,sp # adjust stack pointer (discard old pc) rei # returnLvax$ashp: jmp vax$ashp # ashp entryLvax$cvtlp_restart: jmp vax$cvtlp_restart # cvtlp entryLvax$cvtsp: jmp vax$cvtsp # cvtsp entryLvax$crc: jmp vax$crc # crc entryLvax$addp4: jmp vax$addp4 # addp4 entryLvax$addp6: jmp vax$addp6 # addp6 entryLvax$subp4: jmp vax$subp4 # subp4 entryLvax$subp6: jmp vax$subp6 # subp6 entryLvax$cvtpt_restart: jmp vax$cvtpt_restart # cvtpt entryLvax$mulp: jmp vax$mulp # mulp entryLvax$cvttp_restart: jmp vax$cvttp_restart # cvttp entryLvax$divp: jmp vax$divp # divp entryLvax$cmpc3: jmp vax$cmpc3 # cmpc3 entryLvax$scanc: jmp vax$scanc # scanc entryLvax$spanc: jmp vax$spanc # spanc entryLvax$cmpc5: jmp vax$cmpc5 # cmpc5 entryLvax$movtc: jmp vax$movtc # movtc entryLvax$movtuc: jmp vax$movtuc # movtuc entryLvax$movp: jmp vax$movp # movp entryLvax$cmpp3: jmp vax$cmpp3 # cmpp3 entryLvax$cvtpl_restart: jmp vax$cvtpl_restart # cmtpl entryLvax$cmpp4: jmp vax$cmpp4 # cmpp4 entryLvax$editpc_restart: jmp vax$editpc # editpc entryLvax$matchc: jmp vax$matchc # matchc entryLvax$locc: jmp vax$locc # locc entryLvax$skpc: jmp vax$skpc # skpc entry
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -