X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=os9x_65c816.s;h=30aba8fea7ed7c40196286bd74280c8f407a7488;hb=866653747023eb587fed75258cd7a83c1a274804;hp=02e886e4439eb7f8d259199bc093be911bc17735;hpb=909f5635bffc4c3516ddbba4f9c63c2a7333afc7;p=drnoksnes diff --git a/os9x_65c816.s b/os9x_65c816.s index 02e886e..30aba8f 100644 --- a/os9x_65c816.s +++ b/os9x_65c816.s @@ -1,10 +1,8 @@ - .DATA + /**************************************************************** ****************************************************************/ - .align 4 - - @ notaz - .equiv ASM_SPC700, 1 ;@ 1 = use notaz's ASM_SPC700 core +@ notaz +.equiv ASM_SPC700, 1 ;@ 1 = use notaz's ASM_SPC700 core /**************************************************************** DEFINES @@ -37,24 +35,11 @@ rscratch9 .req R10 @ ?????? reg_cpu_var .req R14 - @ not used @ R13 @ Pointer 32 bit on a struct. @ R15 = pc (sic!) - -/* -.equ Carry 1 -.equ Zero 2 -.equ IRQ 4 -.equ Decimal 8 -.equ IndexFlag 16 -.equ MemoryFlag 32 -.equ Overflow 64 -.equ Negative 128 -.equ Emulation 256*/ - .equ STATUS_SHIFTER, 24 .equ MASK_EMUL, (1<<(STATUS_SHIFTER-1)) .equ MASK_SHIFTER_CARRY, (STATUS_SHIFTER+1) @@ -142,13 +127,6 @@ reg_cpu_var .req R14 /*****************************************************************/ -.macro trace_asm val - push {r0-r5, r12, lr} - mov r0, #\val - bl print_asm_i - pop {r0-r5, r12, lr} -.endm - /* prepare */ .macro PREPARE_C_CALL STMFD R13!,{R12,R14} @@ -601,7 +579,6 @@ reg_cpu_var .req R14 .endif .endm -@ #include "os9x_65c816_mac_mem.h" .macro S9xGetWord @ in : rscratch (0x00hhmmll) @ out : rscratch (0xhhll0000) @@ -1153,6 +1130,12 @@ reg_cpu_var .req R14 MOVS rscratch,rscratch .endm +@ START OF PROGRAM CODE + +.text + +.align 4 + .globl asmS9xGetByte .globl asmS9xGetWord .globl asmS9xSetByte @@ -2881,7 +2864,7 @@ SW_not_aligned4: 1111: .endm .macro Op30 /*BMI*/ - asmRelative + asmRelative BranchCheck0 TST rstatus, #MASK_NEG BEQ 1111f @@ -3103,15 +3086,14 @@ SW_not_aligned4: .endm .macro OpAB BIC reg_d_bank,reg_d_bank, #0xFF - PullBrS + PullBrS ORR reg_d_bank,reg_d_bank,rscratch, LSR #24 UPDATE_ZN ADD2CYCLE .endm -.macro Op2B - BIC reg_d,reg_d, #0xFF000000 - BIC reg_d,reg_d, #0x00FF0000 - PullWrS +.macro Op2B + UXTH reg_d,reg_d + PullWrS ORR reg_d,rscratch,reg_d UPDATE_ZN ADD2CYCLE @@ -4476,9 +4458,8 @@ void asm_S9xOpcode_NMI(void) /**************************************************************** GLOBAL ****************************************************************/ - .globl test_opcode - .globl asmMainLoop - +.global asmMainLoop +.type asmMainLoop, function @ void asmMainLoop(asm_cpu_var_t *asmcpuPtr); asmMainLoop: @@ -4571,6 +4552,7 @@ endmainLoop: LDMFD R13!,{R4-R11, LR} BX LR .pool +.size asmMainLoop, asmMainLoop-. @ void test_opcode(struct asm_cpu_var *asm_var); test_opcode: